Ver Fonte

删除结算单

qzy há 4 semanas atrás
pai
commit
f67e5c6e27

+ 0 - 9
sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlementController.java

@@ -42,15 +42,6 @@ public class HtTradeSettlementController {
 		return AjaxJson.getSuccess();
 	}
 
-	/** 删 - 根据id列表 */
-	@RequestMapping("deleteByIds")
-	@SaCheckPermission(HtTradeSettlement.PERMISSION_CODE_DEL)
-	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
-		int line = SP.publicMapper.deleteByIds(HtTradeSettlement.TABLE_NAME, ids);
-		return AjaxJson.getByLine(line);
-	}
-
 	/** 改 */
 	@RequestMapping("update")
 	@SaCheckPermission(HtTradeSettlement.PERMISSION_CODE_EDIT)

+ 8 - 4
sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlementService.java

@@ -71,8 +71,12 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
     /**
      * 删
      */
+    @Transactional
     void delete(Long id) {
         removeById(id);
+        SoMap soMap = new SoMap();
+        soMap.put("sale_main_id", id);
+        tbOrderMapper.deleteByMap(soMap);
     }
 
     /**
@@ -102,13 +106,13 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
      * 远程调用: 添加大订单时同时生成边民订单
      */
     public boolean tradeSettlementDto(TradeSettlementDto tradeSettlementDto) {
-        LambdaQueryWrapper<HtTradeSettlement>  wrapper = new LambdaQueryWrapper<>();
+        LambdaQueryWrapper<HtTradeSettlement> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(HtTradeSettlement::getPlatSeqNo, tradeSettlementDto.getPlatSeqNo());
         List<HtTradeSettlement> htTradeSettlements = htTradeSettlementMapper.selectList(wrapper);
         //删除已存在的大订单与小订单,保留航通送过来的最新记录
-        if(htTradeSettlements.size()>0) {
+        if (htTradeSettlements.size() > 0) {
             List<Long> idList = htTradeSettlements.stream().map(item -> item.getId()).collect(Collectors.toList());
-            LambdaQueryWrapper<TbOrder>  orderWrapper = new LambdaQueryWrapper<>();
+            LambdaQueryWrapper<TbOrder> orderWrapper = new LambdaQueryWrapper<>();
             orderWrapper.in(TbOrder::getSaleMainId, idList);
             int orderDelete = tbOrderMapper.delete(orderWrapper);
 
@@ -198,7 +202,7 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
             //发送短信
             if (result == 1) {
                 String content = "您好,您的[边民互市订单]已经生成,订单商品是[" + tbOrder.getGoodsNames() + "]。请前往app进行交易确认";
-              // SystemObject.smsFactory.handler().sendSMS(tbPeople.getPhone(), content);
+                // SystemObject.smsFactory.handler().sendSMS(tbPeople.getPhone(), content);
             }
         }
         htTradeSettlement.setTotalPrice(totalPrice);