applet/src/main/java/com/jilongda/applet/controller/TCouponReceiveController.java
@@ -69,6 +69,7 @@ } tCouponReceive.setAmountCondition(coupon.getAmountCondition()); tCouponReceive.setStatus(1); tCouponReceive.setCouponName(coupon.getName()); tCouponReceiveService.save(tCouponReceive); return ApiResult.success(); } applet/src/main/java/com/jilongda/applet/model/TCouponReceive.java
@@ -65,5 +65,8 @@ @ApiModelProperty(value = "1待使用 2已使用 3已过期") @TableField("status") private Integer status; @ApiModelProperty(value = "优惠券名称") @TableField("couponName") private String couponName; } applet/src/main/java/com/jilongda/applet/service/impl/TAppUserServiceImpl.java
@@ -67,6 +67,7 @@ } tCouponReceive.setAmountCondition(tCoupon.getAmountCondition()); tCouponReceive.setStatus(1); tCouponReceive.setCouponName(tCoupon.getName()); couponReceiveMapper.insert(tCouponReceive); } }else { applet/src/main/resources/mapping/TStoreMapper.xml
@@ -55,6 +55,7 @@ </if> from t_store where isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} and status = 1 ORDER BY <if test="query.lon != null and query.lon != '' and query.lat != null and query.lat != ''"> IFNULL(distance,0), manage/src/main/java/com/jilongda/manage/component/AliOssManageFileUploadController.java
@@ -32,7 +32,7 @@ @Slf4j @Api(tags = "Ali-OSS文件上传接口") @RestController @CrossOrigin @CrossOrigin("*") @RequestMapping("/ali-oss/") public class AliOssManageFileUploadController { manage/src/main/java/com/jilongda/manage/controller/TCouponController.java
@@ -93,6 +93,7 @@ } tCouponReceive.setAmountCondition(dto.getAmountCondition()); tCouponReceive.setStatus(1); tCouponReceive.setCouponName(dto.getName()); tCouponReceives.add(tCouponReceive); } couponReceiveService.saveBatch(tCouponReceives); @@ -112,6 +113,7 @@ } tCouponReceive.setAmountCondition(dto.getAmountCondition()); tCouponReceive.setStatus(1); tCouponReceive.setCouponName(dto.getName()); tCouponReceives1.add(tCouponReceive); } couponReceiveService.saveBatch(tCouponReceives1); manage/src/main/java/com/jilongda/manage/controller/TOrderAftersalesController.java
@@ -81,35 +81,37 @@ @ApiOperation(value = "订单售后详情") @GetMapping(value = "/detail") public ApiResult<TOrderAftersalesDetailVO> detail(Integer id) { TOrderAftersales byId = orderAftersalesService.getById(id); TOrder byId1 = orderService.getById(byId.getOrderId()); TStore byId2 = tStoreService.getById(byId1.getStoreId()); SecUser byId3 = secUserService.getById(byId.getSysId()); TOptometrist byId5 = tOptometristService.getById(byId.getOptometristId()); TOrderAftersales orderAftersales = orderAftersalesService.getById(id); TOrder order = orderService.getById(orderAftersales.getOrderId()); TStore store = tStoreService.getById(order.getStoreId()); SecUser sysUser = secUserService.getById(orderAftersales.getSysId()); TOptometrist optometrist = tOptometristService.getById(orderAftersales.getOptometristId()); TOrderAftersalesDetailVO res = new TOrderAftersalesDetailVO(); BeanUtils.copyProperties(byId,res); res.setOrderId(byId1.getId()); if (byId1.getUserId()!=null){ TAppUser byId4 = appUserService.getById(byId1.getUserId()); BeanUtils.copyProperties(orderAftersales,res); res.setOrderId(order.getId()); if (order.getUserId()!=null){ TAppUser byId4 = appUserService.getById(order.getUserId()); if (byId4!=null){ res.setPhone(byId4.getPhone()); res.setName(byId4.getName()); res.setRealName(byId4.getRealName()); } }else{ res.setPhone(byId1.getPhone()); res.setRealName(byId1.getRealName()); res.setPhone(order.getPhone()); res.setRealName(order.getRealName()); } res.setStoreName(byId2.getName()); res.setOptometristName(byId5.getName()); res.setSalesUser(byId3.getNickName()); res.setOrderTime(TimeUtils.localDateTimeToString(byId1.getCreateTime())); res.setAfterSalesTime(TimeUtils.localDateTimeToString(byId.getCreateTime())); List<TOrderGoods> list = goodsService.lambdaQuery().eq(TOrderGoods::getOrderId, byId1.getId()).list(); res.setStoreName(store.getName()); if (optometrist!=null){ res.setOptometristName(optometrist.getName()); } res.setSalesUser(sysUser.getNickName()); res.setOrderTime(TimeUtils.localDateTimeToString(order.getCreateTime())); res.setAfterSalesTime(TimeUtils.localDateTimeToString(orderAftersales.getCreateTime())); List<TOrderGoods> list = goodsService.lambdaQuery().eq(TOrderGoods::getOrderId, order.getId()).list(); res.setGoodsList(list); res.setOrderMoney(byId1.getOrderMoney()); res.setCouponMoney(byId1.getCouponMoney()); res.setPayMoney(byId1.getPayMoney()); res.setOrderMoney(order.getOrderMoney()); res.setCouponMoney(order.getCouponMoney()); res.setPayMoney(order.getPayMoney()); return ApiResult.success(res); } manage/src/main/java/com/jilongda/manage/controller/TOrderController.java
@@ -81,6 +81,8 @@ private TSupplierService supplierService; @Autowired private TMaterialService materialService; @Autowired private TLineUpService lineUpService; @PostMapping("/obs-upload") @ApiOperation(value = "文件上传",tags = "管理后台-文件上传") @@ -229,38 +231,38 @@ // 减少对应库存 one.setTotal(one.getTotal()-1); tLensGoods.add(one); // 生成销售订单主表 TWarehousing tWarehousing = new TWarehousing(); tWarehousing.setStatus(5); tWarehousing.setType(2); tWarehousing.setStoreId(dto.getStoreId()); tWarehousing.setRemark("销售订单-镜片"); tWarehousing.setOrderNum(dto.getId()+""); warehousingService.save(tWarehousing); // 生成明细记录 TLensWarehousingDetail tLensWarehousingDetail = new TLensWarehousingDetail(); tLensWarehousingDetail.setBrand(orderGood.getBrandName()); TSupplier supplier = supplierService.getById(lensSeries.getSupplierId()); if (supplier!=null){ tLensWarehousingDetail.setSupplier(supplier.getName()); } tLensWarehousingDetail.setSeries(lensSeries.getName()); tLensWarehousingDetail.setRefractiveIndex(orderGood.getRefractiveIndex()); if (StringUtils.hasLength(orderGood.getLLens())){ tLensWarehousingDetail.setBallMirror(orderGood.getLLens().split(",")[0]); tLensWarehousingDetail.setColumnMirror(orderGood.getLLens().split(",")[0]); } if (StringUtils.hasLength(orderGood.getRLens())){ tLensWarehousingDetail.setBallMirror(orderGood.getRLens().split(",")[0]); tLensWarehousingDetail.setColumnMirror(orderGood.getRLens().split(",")[0]); } tLensWarehousingDetail.setType(orderGood.getType()); tLensWarehousingDetail.setTotal(1); tLensWarehousingDetail.setSeriesId(lensSeries.getId()); tLensWarehousingDetail.setWarehousingId(tWarehousing.getId()); tLensWarehousingDetail.setOrderId(dto.getId()); lensWarehousingDetailService.save(tLensWarehousingDetail); // // 生成销售订单主表 // // TWarehousing tWarehousing = new TWarehousing(); // tWarehousing.setStatus(5); // tWarehousing.setType(2); // tWarehousing.setStoreId(dto.getStoreId()); // tWarehousing.setRemark("销售订单-镜片"); // tWarehousing.setOrderNum(dto.getId()+""); // warehousingService.save(tWarehousing); // // 生成明细记录 // TLensWarehousingDetail tLensWarehousingDetail = new TLensWarehousingDetail(); // tLensWarehousingDetail.setBrand(orderGood.getBrandName()); // TSupplier supplier = supplierService.getById(lensSeries.getSupplierId()); // if (supplier!=null){ // tLensWarehousingDetail.setSupplier(supplier.getName()); // } // tLensWarehousingDetail.setSeries(lensSeries.getName()); // tLensWarehousingDetail.setRefractiveIndex(orderGood.getRefractiveIndex()); // if (StringUtils.hasLength(orderGood.getLLens())){ // tLensWarehousingDetail.setBallMirror(orderGood.getLLens().split(",")[0]); // tLensWarehousingDetail.setColumnMirror(orderGood.getLLens().split(",")[0]); // } // if (StringUtils.hasLength(orderGood.getRLens())){ // tLensWarehousingDetail.setBallMirror(orderGood.getRLens().split(",")[0]); // tLensWarehousingDetail.setColumnMirror(orderGood.getRLens().split(",")[0]); // } // tLensWarehousingDetail.setType(orderGood.getType()); // tLensWarehousingDetail.setTotal(1); // tLensWarehousingDetail.setSeriesId(lensSeries.getId()); // tLensWarehousingDetail.setWarehousingId(tWarehousing.getId()); // tLensWarehousingDetail.setOrderId(dto.getId()); // lensWarehousingDetailService.save(tLensWarehousingDetail); }else { return ApiResult.failed("商品库存不足"); @@ -318,8 +320,13 @@ } if (dto.getUserId()!=null){ if (dto.getCouponId()!=null){ List<TCouponReceive> couponReceives = couponReceiveService.lambdaQuery().eq(TCouponReceive::getUserId, dto.getUserId()) .eq(TCouponReceive::getCouponId, dto.getCouponId()) TCouponReceive couponReceive = couponReceiveService.getById(dto.getCouponId()); if (couponReceive==null){ return ApiResult.failed("优惠券不存在"); } List<TCouponReceive> couponReceives = couponReceiveService.lambdaQuery() .eq(TCouponReceive::getId, dto.getUserId()) .eq(TCouponReceive::getCouponId, couponReceive.getCouponId()) .orderByDesc(TCouponReceive::getCreateTime).list(); if (couponReceives.isEmpty())return ApiResult.failed("优惠券不存在"); TCouponReceive tCouponReceive = couponReceives.get(0); @@ -330,8 +337,29 @@ } List<TOptometryDetail> optometryDetails = dto.getOptometryDetails(); if (!CollectionUtils.isEmpty(optometryDetails)){ int temp =0; if (dto.getUserId()!=null){ TOptometry optometry = new TOptometry(); long count = lineUpService.count(Wrappers.lambdaQuery(TLineUp.class) .eq(TLineUp::getStoreId, dto.getStoreId())); optometry.setCode(""+(count+1)); optometry.setUserId(dto.getUserId()); optometry.setAge(dto.getAge()); optometry.setGender(dto.getGender()); optometry.setRealName(dto.getRealName()); optometry.setPhone(dto.getPhone()); optometry.setStoreId(dto.getStoreId()); optometry.setStatus(3); optometryService.save(optometry); temp = optometry.getId(); } for (TOptometryDetail optometryDetail : optometryDetails) { optometryDetail.setOrderId(dto.getId()); if (dto.getUserId()!=null){ optometryDetail.setOptometryId(temp); } } optometryDetailService.saveBatch(optometryDetails); } manage/src/main/java/com/jilongda/manage/controller/TWarehousingController.java
@@ -238,7 +238,7 @@ one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); list1.add(one); }else { return ApiResult.failed("商品不存在"); return ApiResult.failed("库存不足"); } } @@ -309,7 +309,7 @@ one.setTotal(one.getTotal()-frameWarehousingDetail.getTotal()); list1.add(one); }else { return ApiResult.failed("商品不存在"); return ApiResult.failed("库存不足"); } } manage/src/main/resources/mapping/TCouponReceiveMapper.xml
@@ -26,7 +26,7 @@ </sql> <select id="pageList" resultType="com.jilongda.manage.vo.TAppUserCouponVO"> select t1.* t_coupon_receive t1 from t_coupon_receive t1 where t1.userId = #{query.id} and t1.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} </select> manage/src/main/resources/mapping/TFrameGoods.xml
@@ -5,7 +5,7 @@ <select id="lensReceiptList" resultType="com.jilongda.manage.vo.TFrameGoodsVO"> select t1.*,t2.name as model,t5.name as supplier,t3.name as material,t4.name as store, t2.sale as sale,t2.cost as cost,t6.name as brand,t7.frameThreshold t2.sale as sales,t2.cost as cost,t6.name as brand,t7.frameThreshold from t_frame_goods t1 left join t_model t2 on t1.modelId=t2.id manage/src/main/resources/mapping/TLensWarehousingDetailMapper.xml
@@ -28,7 +28,7 @@ </sql> <select id="pageLensList" resultType="com.jilongda.manage.vo.TLensWarehousingDetailVO"> select tlwd.id, tlwd.warehousingId, tlwd.brand, tlwd.supplier, tlwd.series, tlwd.total, tlwd.refractiveIndex, tlwd.ballMirror, tlwd.code, tlwd.createTime,tlwd.columnMirror, tlwd.updateTime, tlwd.createBy, tlwd.updateBy, tlwd.isDelete, tlwd.`type`,tw.storeId tlwd.updateTime, tlwd.createBy, tlwd.updateBy, tlwd.isDelete, tlwd.`type`,tw.storeId,tw.status as status from t_lens_warehousing_detail tlwd left join t_warehousing tw on tlwd.warehousingId = tw.id <where> @@ -61,6 +61,7 @@ </if> and tlwd.isDelete = ${@com.jilongda.common.enums.DisabledEnum@NO.getCode()} </where> and tw.status!=5 ORDER BY tlwd.createTime DESC </select> manage/src/main/resources/mapping/TOptometristMapper.xml
@@ -38,7 +38,7 @@ and t2.`name` like concat('%',#{query.name},'%') </if> <if test="query.userId != null and query.userId != ''"> and t2.id like concat('%',#{query.userId},'%') and t1.userId like concat('%',#{query.userId},'%') </if> <if test="query.realName != null and query.realName != ''"> and t1.realName like concat('%',#{query.realName},'%') optometrist/src/main/java/com/jilongda/optometrist/controller/TOptometristController.java
@@ -183,7 +183,9 @@ Integer userId = loginInfoUtil.getUserId(); List<TLineUp> list = tLineUpService.lambdaQuery().eq(TLineUp::getStatus, 2) .eq(TLineUp::getOptometristId, userId).list(); if (!list.isEmpty())return ApiResult.failed("当前还有未结束的验光单"); if (!list.isEmpty()){ return ApiResult.failed("当前还有未结束的验光单"); } TLineUp lineUp = tLineUpService.getById(id); // 获取今天凌晨00:00:00和今日23:59:59 Date start = new Date(); @@ -203,6 +205,7 @@ } tLineUpService.updateBatchById(lineUps); lineUp.setStatus(2); lineUp.setOptometristId(userId); tLineUpService.updateById(lineUp); return ApiResult.success(); }