|
@@ -59,6 +59,7 @@ import com.zhongzheng.modules.exam.vo.ExamApplyVo;
|
|
|
import com.zhongzheng.modules.exam.vo.ExamSessionVo;
|
|
|
import com.zhongzheng.modules.goods.domain.Goods;
|
|
|
import com.zhongzheng.modules.goods.domain.GoodsQuestionRel;
|
|
|
+import com.zhongzheng.modules.goods.domain.QuestionMerchant;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsQuestionRelService;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
@@ -71,8 +72,10 @@ import com.zhongzheng.modules.inform.service.IInformRemindService;
|
|
|
import com.zhongzheng.modules.inform.service.IInformUserService;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
|
|
|
import com.zhongzheng.modules.inform.vo.InformRemindVo;
|
|
|
+import com.zhongzheng.modules.order.domain.Order;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
+import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
import com.zhongzheng.modules.system.domain.SysConfig;
|
|
|
import com.zhongzheng.modules.system.domain.SysTask;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
@@ -180,6 +183,8 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
@Autowired
|
|
|
private IMajorService majorService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IOrderService iOrderService;
|
|
|
@Autowired
|
|
|
private IOrderGoodsService iOrderGoodsService;
|
|
|
@Autowired
|
|
@@ -2836,6 +2841,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
public String subRecordUserExport(SubUserExportBo bo) {
|
|
|
String tenantId = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
SysTenant sysTenant = iSysTenantService.getById(Long.valueOf(tenantId));
|
|
|
+ String schoolName = ObjectUtils.isNotNull(sysTenant.getSchoolName()) ? sysTenant.getSchoolName() : "广东省祥粤建设职业培训学校";
|
|
|
if (ObjectUtils.isNotNull(sysTenant.getExamRoom()) && sysTenant.getExamRoom() == 1) {
|
|
|
//公用祥粤考场
|
|
|
List<SysTenant> list = iSysTenantService
|
|
@@ -2866,7 +2872,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
if (!dirw.exists()) {
|
|
|
dirw.mkdirs();
|
|
|
}
|
|
|
- String photoPath = majorPath + "/" + "广东省祥粤建设职业培训学校";
|
|
|
+ String photoPath = majorPath + "/" + schoolName;
|
|
|
File dirw2 = new File(photoPath);
|
|
|
if (!dirw2.exists()) {
|
|
|
dirw2.mkdirs();
|
|
@@ -2932,7 +2938,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
examApplyExports.add(export);
|
|
|
});
|
|
|
//打包zip
|
|
|
- String zipPath = majorPath + "/" + "广东省祥粤建设职业培训学校.zip";
|
|
|
+ String zipPath = majorPath + "/" + String.format("%s.zip",schoolName);
|
|
|
FileUtils.toZip(zipPath, photoPath, true);
|
|
|
//删除本地资源
|
|
|
Path pathStr = Paths.get(photoPath);
|
|
@@ -3062,6 +3068,70 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public boolean saveSubscribeOffline(SubscribeOfflineBo bo) {
|
|
|
+ OrderGoods orderGoods = iOrderGoodsService.getById(bo.getOrderGoodsId());
|
|
|
+ if (ObjectUtils.isNull(orderGoods)){
|
|
|
+ throw new CustomException("訂單獲取失敗!");
|
|
|
+ }
|
|
|
+ //校验是否已申请
|
|
|
+ Long count = baseMapper.getCountOfflineOrder(bo.getOrderGoodsId());
|
|
|
+ if (count > 0){
|
|
|
+ throw new CustomException("您已申请补考次数,正在等待审核,请勿重复申请!");
|
|
|
+ }
|
|
|
+ User user = iUserService.getById(bo.getUserId());
|
|
|
+ if (ObjectUtils.isNull(user)){
|
|
|
+ throw new CustomException("用戶獲取失敗!");
|
|
|
+ }
|
|
|
+ //判斷是否喲補充考試的商品
|
|
|
+ Long goodsId = baseMapper.getReplenishmentExam(orderGoods.getGoodsId());
|
|
|
+ if (ObjectUtils.isNull(goodsId)){
|
|
|
+ throw new CustomException("请先配置补考商品");
|
|
|
+ }
|
|
|
+ Goods goods = iGoodsService.getById(goodsId);
|
|
|
+ //创建补考待审订单
|
|
|
+ Order order = new Order();
|
|
|
+ //生成订单号
|
|
|
+ String out_trade_no = DateUtils.getDateOrderSn();
|
|
|
+ order.setOrderSn(out_trade_no);
|
|
|
+ //学员预约信息
|
|
|
+ order.setUserId(user.getUserId());
|
|
|
+ order.setOrderPrice(orderGoods.getGoodsRealPrice());
|
|
|
+ order.setOrderStatus(0);
|
|
|
+ order.setCreateTime(DateUtils.getNowTime());
|
|
|
+ order.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ order.setOrderType(6);
|
|
|
+ order.setPayPrice(goods.getStandPrice());
|
|
|
+ order.setOrderFrom(12);
|
|
|
+ order.setStatus(0);
|
|
|
+ order.setOrderBase(1);
|
|
|
+ order.setPayStatus(0);
|
|
|
+ order.setCheckStatus(0);
|
|
|
+ order.setOrderRefundStatus(1);
|
|
|
+ order.setInvoiceStatus(0);
|
|
|
+ order.setFinishStatus(0);
|
|
|
+ order.setOperationType(1);
|
|
|
+ iOrderService.save(order);
|
|
|
+ //订单商品
|
|
|
+ OrderGoods add = new OrderGoods();
|
|
|
+ add.setOrderSn(out_trade_no);
|
|
|
+ add.setGoodsId(goods.getGoodsId());
|
|
|
+ add.setGoodsYear(goods.getYear().toString());
|
|
|
+ add.setGoodsRealPrice(goods.getStandPrice());
|
|
|
+ add.setGoodsPrice(goods.getStandPrice());
|
|
|
+ add.setCreateTime(DateUtils.getNowTime());
|
|
|
+ add.setUpdateTime(DateUtils.getNowTime());
|
|
|
+ add.setStatus(0);
|
|
|
+ add.setGoodsReceived(goods.getStandPrice());
|
|
|
+ add.setRefundStatus(0);
|
|
|
+ add.setPayStatus(1);
|
|
|
+ add.setReplenishSign(orderGoods.getOrderGoodsId());
|
|
|
+ add.setExamSign(bo.getAppId());
|
|
|
+ iOrderGoodsService.save(add);
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
private String applyTimeTransition(String time) {
|
|
|
List<String> collect = Arrays.stream(time.split(":")).collect(Collectors.toList());
|
|
|
StringBuffer result = new StringBuffer();
|