wangpengfei 1 year ago
parent
commit
e1bf681dac
  1. 2
      src/main/java/com/yxt/yythmall/api/ordorder/OrdOrderQuery.java
  2. 18
      src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java
  3. 14
      src/main/java/com/yxt/yythmall/biz/newcomerrecorecord/NewcomerRecoRecordService.java
  4. 6
      src/main/java/com/yxt/yythmall/biz/ordorder/OrdOrderRest.java
  5. 37
      src/main/java/com/yxt/yythmall/biz/ordorder/OrdOrderService.java
  6. 18
      src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java
  7. 4
      src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsService.java
  8. 4
      src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml
  9. 56
      src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java
  10. 2
      src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java
  11. 3
      src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java
  12. 1
      src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java

2
src/main/java/com/yxt/yythmall/api/ordorder/OrdOrderQuery.java

@ -13,4 +13,6 @@ public class OrdOrderQuery implements Query {
private String endDate; //结束时间
private String customerSid; //总数
private String state;
private String mainSid;
private String payTime;
}

18
src/main/java/com/yxt/yythmall/biz/customerstore/CustomerStoreService.java

@ -153,7 +153,23 @@ public class CustomerStoreService extends MybatisBaseService<CustomerStoreMapper
vo.setStart(start);
vo.setEnd(end);
vo.setReserveDate(start);
String reserveDate=reserveDate(start);
vo.setReserveDate(reserveDate);
return vo;
}
public String reserveDate(String start){
CannotReserveDictionary cannotReserveDictionary=new CannotReserveDictionary();
int i=0;
do {
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
start=sdf.format(DateUtil.offsetDay(DateUtil.parse(start),+1));
cannotReserveDictionary=cannotReserveDictionaryService.getOne(new QueryWrapper<CannotReserveDictionary>().eq("unavailableTime",start));
i++;
} while (cannotReserveDictionary!=null);
if(i>=5){
start="";
}
return start;
}
}

14
src/main/java/com/yxt/yythmall/biz/newcomerrecorecord/NewcomerRecoRecordService.java

@ -66,16 +66,19 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
public ResultBean recommendedAssistance(NewcomerRecoRecordDto dto) {
ResultBean rb = new ResultBean().fail();
//如果被推荐人有被推荐记录但没购买 就直接跳出
NewcomerRecoRecord newcomer=baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("recommendedSid",dto.getCustomerSid()));
if(newcomer!=null){
return rb.success();
if(StringUtils.isBlank(dto.getCustomerSid())){
return rb.setMsg("参数不全");
}
if(StringUtils.isBlank(dto.getOrderSid())){
return rb.setMsg("参数不全");
}
NewcomerRecoRecord newcomer=baseMapper.selectOne(new QueryWrapper<NewcomerRecoRecord>().eq("recommendedSid",dto.getCustomerSid()));
if(newcomer!=null){
return rb.success();
}
LpkCustomer customer=lpkCustomerService.getOne(new QueryWrapper<LpkCustomer>().eq("sid",dto.getCustomerSid()));
if(null==customer){
return rb.setMsg("参数不全");
return rb.setMsg("此用户不存在");
}
if(!customer.getIsNewUser().equals("1")){
return rb.setMsg("您不是新人");
@ -112,6 +115,9 @@ public class NewcomerRecoRecordService extends MybatisBaseService<NewcomerRecoRe
}
public ResultBean recordList(String customerSid) {
ResultBean rb = new ResultBean();
if(StringUtils.isBlank(customerSid)){
return rb.setMsg("参数不全");
}
RecommendNewUserBagVo vo=new RecommendNewUserBagVo();
List<RecommendNewUserBag> bags=recommendNewUserBagService.list(new QueryWrapper<RecommendNewUserBag>().eq("isGrounding","1"));
RecommendNewUserBagVo bagVo=new RecommendNewUserBagVo();

6
src/main/java/com/yxt/yythmall/biz/ordorder/OrdOrderRest.java

@ -54,4 +54,10 @@ public class OrdOrderRest {
public ResultBean changePayState(@PathVariable("sid") String sid) {
return ordOrderService.changePayState(sid);
}
@PostMapping("/getPreOrder")
@ApiOperation(value = "获取预下单时间")
public ResultBean getPreOrder(@RequestBody OrdOrderQuery query) {
return ordOrderService.getPreOrder(query);
}
}

37
src/main/java/com/yxt/yythmall/biz/ordorder/OrdOrderService.java

@ -30,6 +30,7 @@ import com.yxt.yythmall.biz.lpkgoods.LpkGoodsService;
import com.yxt.yythmall.biz.ordorderdetails.OrdOrderDetailService;
import com.yxt.yythmall.biz.shoppingcart.ShoppingCartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -48,6 +49,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
private static final String OrderUrl="https://supervise.yxtsoft.com/lpkapi/empcardgift/generateTopEmpCard?mainSid=";
private static final String or="https://supervise.yxtsoft.com/lpkapi/vegetablecellar/addGoods?mainSid=";
private static final String payUrl="https://supervise.yxtsoft.com/lpkapi/empsreservoorder/getPreOrder";
@Autowired
OrdOrderDetailService ordOrderDetailsService;
@Autowired
@ -62,12 +64,19 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
OrdOrderDetailService ordOrderDetailService;
@Autowired
private FileUploadComponent fileUploadComponent;
@Value("${weixin.miniprogram.appid:wx4724e3a3c27f36b5}")
String appId;
@Value("${weixin.miniprogram.secret:971fd3b8aa7b08ce3e8a5f3e502b1a8d}")
String secret;
@Transactional(rollbackFor = Exception.class)
public ResultBean createOrder(OrdOrderDto dto) {
ResultBean rb = ResultBean.fireFail();
PayResult result=new PayResult();
if(StringUtils.isBlank(dto.getCustomerSid())){
return rb.setMsg("参数不全");
}
Map<String,Object>map =new HashMap<>();
LpkCustomerVo vo= lpkCustomerService.getCustomerInfo(dto.getCustomerSid()).getData();
Map<String, Object> sendBody=buildMessageBody( vo.getSid(), vo.getWxMpOpenid(),dto.getTotalTee(),dto.getOrdOrderDetailsVoList(),OrderUrl);
@ -151,9 +160,17 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
public ResultBean createVegeOrder(OrdOrderDto dto) {
ResultBean rb = ResultBean.fireFail();
PayResult result=new PayResult();
if(StringUtils.isBlank(dto.getCustomerSid())){
return rb.setMsg("参数不全");
}
if(StringUtils.isBlank(dto.getBrandId())){
return rb.setMsg("参数不全");
}
List<OrdOrderDetailVo> ordOrderDetailVos=new ArrayList<>();
ShoppingCartQuery query=new ShoppingCartQuery();
query.setCustomerSid(dto.getCustomerSid());
query.setBrandId(dto.getBrandId());
List<ShoppingCartVo> vos=shoppingCartService.shoppingCartList(query).getData();
@ -262,6 +279,9 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
public ResultBean createNewUserBagOrder(OrdOrderDto dto) {
ResultBean rb = ResultBean.fireFail();
PayResult result=new PayResult();
if(StringUtils.isBlank(dto.getCustomerSid())){
return rb.setMsg("参数不全");
}
List<OrdOrderDetailVo> ordOrderDetailVos=new ArrayList<>();
List<GiftBagGoodss> vos=appletGiftBagService.getGoodsByBagSid(dto.getBagSid()).getData();
@ -379,6 +399,7 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
mp_template_msg.put("name", name);
mp_template_msg.put("timeRemarks", "10");
mp_template_msg.put("returnUrl", returnUrl);
mp_template_msg.put("payUrl",payUrl);
return mp_template_msg;
}
@ -412,6 +433,9 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
public ResultBean<OrdOrderVo> getOrderDetails(String sid) {
ResultBean rb=new ResultBean().fail();
OrdOrderVo pagging = baseMapper.getOrderDetails(sid);
if(StringUtils.isBlank(sid)){
return rb.setMsg("参数不全");
}
List<OrdOrderDetail> details=ordOrderDetailService.list(new QueryWrapper<OrdOrderDetail>().eq("orderSid",pagging.getSid()));
if(StringUtils.isBlank(pagging.getMeet())){
pagging.setMeet(pagging.getTotalTee());
@ -466,6 +490,9 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
}
public ResultBean changePayState(String sid) {
ResultBean rb=new ResultBean().fail();
if(StringUtils.isBlank(sid)){
return rb.setMsg("参数不全");
}
OrdOrder order=baseMapper.selectOne(new QueryWrapper<OrdOrder>().eq("sid",sid));
if(order.getPayStatus()==2){
order.setPayStatus(3);
@ -473,6 +500,16 @@ public class OrdOrderService extends MybatisBaseService<OrdOrderMapper, OrdOrder
}
return rb.success().setData(order);
}
public ResultBean getPreOrder(OrdOrderQuery query) {
ResultBean rb=new ResultBean().fail();
if(StringUtils.isBlank(query.getMainSid())){
return rb.setMsg("参数不全");
}
OrdOrder order=baseMapper.selectOne(new QueryWrapper<OrdOrder>().eq("mainSid",query.getMainSid()));
order.setCreateTime(DateUtil.parse(query.getPayTime()));
baseMapper.updateById(order);
return rb.success().setData(order);
}
/**

18
src/main/java/com/yxt/yythmall/biz/shoppingcart/ShoppingCartService.java

@ -55,6 +55,12 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
public ResultBean save(ShoppingCartDto dto) {
ResultBean rb = ResultBean.fireFail();
ShoppingCart entity = new ShoppingCart();
if(StringUtils.isBlank(dto.getCustomerSid())){
return rb.setMsg("参数不全");
}
if(StringUtils.isBlank(dto.getGoodsSid())){
return rb.setMsg("参数不全");
}
List<ShoppingCart> list = baseMapper.selectList(new QueryWrapper<ShoppingCart>().eq("customerSid", dto.getCustomerSid())
.eq("goodsSid", dto.getGoodsSid())
.eq("affiliation", dto.getAffiliation()));
@ -78,6 +84,12 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
public ResultBean<List<ShoppingCartVo>> shoppingCartList(ShoppingCartQuery query) {
ResultBean rb = ResultBean.fireFail();
ShoppingCart entity = new ShoppingCart();
if(StringUtils.isBlank(query.getCustomerSid())){
return rb.setMsg("参数不全");
}
if(StringUtils.isBlank(query.getBrandId())){
return rb.setMsg("参数不全");
}
List<ShoppingCartVo> list = baseMapper.ShoppingCartList(query.getCustomerSid(), query.getBrandId());
list.forEach(s -> {
s.setTotalPrice(removeZeros(String.valueOf((Double.valueOf(s.getJPrice()) * Double.valueOf(s.getGoodsNumber())))));
@ -113,6 +125,12 @@ public class ShoppingCartService extends MybatisBaseService<ShoppingCartMapper,
public ResultBean getGoodsWeight(ShoppingCartQuery query) {
ResultBean rb = new ResultBean().fail();
if(StringUtils.isBlank(query.getCustomerSid())){
return rb.setMsg("参数不全");
}
if(StringUtils.isBlank(query.getBrandId())){
return rb.setMsg("参数不全");
}
List<ShoppingCartVo> list = baseMapper.ShoppingCartList(query.getCustomerSid(), query.getBrandId());
double price = 0;
double standbyPrice =0;

4
src/main/java/com/yxt/yythmall/biz/transferrecords/TransferRecordsService.java

@ -71,7 +71,9 @@ public class TransferRecordsService extends MybatisBaseService<TransferRecordsMa
// return rb.setMsg("参数不全");
// }
TransferRecords transferRecords=baseMapper.selectOne(new QueryWrapper<TransferRecords>().eq("transferCode",code));
if(null==transferRecords){
return rb.setMsg("没有找到对应的转赠单号");
}
List<TransferRecordsGoodsDetails> list=transferRecordsGoodsDetailsService.list(new QueryWrapper<TransferRecordsGoodsDetails>().eq("orderSid",transferRecords.getSid()));
for (TransferRecordsGoodsDetails transferRecordsGoodsDetails : list) {
LpkGoods k=lpkGoodsService.getOne(new QueryWrapper<LpkGoods>().eq("sid",transferRecordsGoodsDetails.getGoodsSid()));

4
src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderMapper.xml

@ -247,8 +247,8 @@
o.userName,
o.userPhone,
case o.state
when 0 then '未提货'
when 1 then '已提'
when 0 then '待提菜'
when 1 then '已提'
end stateValue ,
case o.affiliation
when 1001000 then '百姓菜窖'

56
src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderRest.java

@ -28,63 +28,11 @@ public class VegeCellarReserveOrderRest {
public ResultBean submission(@RequestBody VegeCellarReserveOrderDto dto) {
return vegeCellarReserveOrderService.submission(dto);
}
//
// @ApiOperation("订单列表")
// @PostMapping("/orderList")
// public ResultBean<PagerVo<VegeCellarReserveOrderVo>> orderList(@RequestBody PagerQuery<VegeCellarReserveOrderQuery> pq) {
// return vegeCellarReserveOrderService.orderList(pq);
// }
// @ApiOperation("订单门店汇总列表")
// @PostMapping("/orderListByStore")
// public ResultBean<PagerVo<VegeCellarReserveOrderVo>> orderListByStore(@RequestBody PagerQuery<VegeCellarReserveOrderQuery> pq) {
// return vegeCellarReserveOrderService.orderListByStore(pq);
// }
// @ApiOperation("订单门店支行汇总列表")
// @PostMapping("/orderListByBank")
// public ResultBean<PagerVo<VegeCellarReserveOrderVo>> orderListByBank(@RequestBody PagerQuery<VegeCellarReserveOrderQuery> pq) {
// return vegeCellarReserveOrderService.orderListByBank(pq);
// }
// @ApiOperation("订单总汇总列表")
// @PostMapping("/orderListByZ")
// public ResultBean<PagerVo<VegeCellarReserveOrderVo>> orderListByZ(@RequestBody PagerQuery<VegeCellarReserveOrderQuery> pq) {
// return vegeCellarReserveOrderService.orderListByZ(pq);
// }
// @ApiOperation("根据提货卡查询预约记录")
// @GetMapping("/orderByCardSid/{sid}")
// public ResultBean orderByCardSid(@PathVariable("sid") String sid) {
// return vegeCellarReserveOrderService.orderByCardSid(sid);
// }
//
@ApiOperation("移动端预约订单列表")
@PostMapping("/orderListByUserSid")
public ResultBean<PagerVo<VegeCellarReserveOrderVo>> orderListByUserSid(@RequestBody PagerQuery<VegeCellarReserveOrderQuery> pq) {
return vegeCellarReserveOrderService.orderListByUserSid(pq);
}
//
// @ApiOperation("预约记录详情")
// @GetMapping("/orderDetails/{orderSid}")
// public ResultBean orderDetails(@PathVariable("orderSid") String orderSid) {
// return vegeCellarReserveOrderService.orderDetails(orderSid);
// }
//
// @ApiOperation(value = "预约订单信息列表导出")
// @PostMapping("/exportExcel")
// public void exportExcel(@RequestBody VegeCellarReserveOrderQuery query) {
// vegeCellarReserveOrderService.exportExcel(query);
// }
// @ApiOperation(value = "预约订单门店汇总导出")
// @PostMapping("/exportExcelByStore")
// public void exportExcelByStore(@RequestBody VegeCellarReserveOrderQuery query) {
// vegeCellarReserveOrderService.exportExcelByStore(query);
// }
// @ApiOperation(value = "预约订单支行汇总导出")
// @PostMapping("/exportExcelByBank")
// public void exportExcelByBank(@RequestBody VegeCellarReserveOrderQuery query) {
// vegeCellarReserveOrderService.exportExcelByBank(query);
// }
// @ApiOperation(value = "预约订单总汇总导出")
// @PostMapping("/exportExcelByZ")
// public void exportExcelByZ(@RequestBody VegeCellarReserveOrderQuery query) {
// vegeCellarReserveOrderService.exportExcelByZ(query);
// }
}

2
src/main/java/com/yxt/yythmall/biz/vegecallerreserveorder/VegeCellarReserveOrderService.java

@ -53,7 +53,7 @@ public class VegeCellarReserveOrderService extends MybatisBaseService<VegeCellar
ResultBean rb = new ResultBean().fail();
boolean b = isSatAndSun(dto.getReserveDate());
if (!b) {
return rb.setMsg("周六、周日不能预约提货");
return rb.setMsg("当前提货时间不可预约提货");
}
if (StringUtils.isBlank(dto.getCustomerSid())) {
return rb.setMsg("参数不全");

3
src/main/java/com/yxt/yythmall/biz/vegetablecellar/VegetableCellarService.java

@ -69,6 +69,9 @@ public class VegetableCellarService extends MybatisBaseService<VegetableCellarMa
public ResultBean addGoods(String mainSid) {
ResultBean rb = ResultBean.fireFail();
OrdOrder ordOrder=ordOrderService.getOne(new QueryWrapper<OrdOrder>().eq("mainSid",mainSid));
if(null==ordOrder){
return rb.setMsg("此订单不存在");
}
if(ordOrder.getPayStatus()!=2){
return rb.setMsg("此订单不可用");
}

1
src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java

@ -75,6 +75,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
//2024-01-17
.excludePathPatterns("/lpkgiftcard/getAllGoodsType/**")
.excludePathPatterns("/appletnotice/getNotice")
.excludePathPatterns("/empsreservoorder/getPreOrder")
.excludePathPatterns("/lpkgoods/getAllGoodsType/**")
.excludePathPatterns("/transferrecords/submission")
.excludePathPatterns("/vegetablecellar/receiveTransferGoods")

Loading…
Cancel
Save