单据同步删除

dev_ksck_axxyy
anthonywj 10 months ago
parent 104fd02dfa
commit 1b232af9b6

@ -1,11 +1,14 @@
package com.glxp.api.controller.sync; package com.glxp.api.controller.sync;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.annotation.Log;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.BusinessType;
import com.glxp.api.constant.SyncDelType; import com.glxp.api.constant.SyncDelType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.dao.dev.DeviceInfoMapper; import com.glxp.api.dao.dev.DeviceInfoMapper;
@ -23,7 +26,7 @@ import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.service.auth.InvBusUserService; import com.glxp.api.service.auth.InvBusUserService;
import com.glxp.api.service.auth.WarehouseBussinessTypeService; import com.glxp.api.service.auth.WarehouseBussinessTypeService;
import com.glxp.api.service.basic.*; import com.glxp.api.service.basic.*;
import com.glxp.api.service.inout.IoOrderService; import com.glxp.api.service.inout.*;
import com.glxp.api.service.inout.impl.IoCodeService; import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.inv.DeviceInspectTaskDetailService; import com.glxp.api.service.inv.DeviceInspectTaskDetailService;
import com.glxp.api.service.inv.DeviceInspectTaskService; import com.glxp.api.service.inv.DeviceInspectTaskService;
@ -34,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -230,9 +234,41 @@ public class SyncDelController extends BaseController {
@Resource @Resource
DeviceInfoMapper deviceInfoMapper; DeviceInfoMapper deviceInfoMapper;
public BaseResponse deleteDevInfoData(DeviceInfoEntity deviceInfoEntity) { public BaseResponse deleteDevInfoData(DeviceInfoEntity deviceInfoEntity) {
deviceInfoMapper.delete(new QueryWrapper<DeviceInfoEntity>().eq("deviceCode",deviceInfoEntity.getDeviceCode())); deviceInfoMapper.delete(new QueryWrapper<DeviceInfoEntity>().eq("deviceCode", deviceInfoEntity.getDeviceCode()));
return ResultVOUtils.success("删除成功"); return ResultVOUtils.success("删除成功");
} }
@Resource
private IoCodeTempService codeTempService;
@Resource
IoOrderDetailBizService orderDetailBizService;
@Resource
IoOrderDetailCodeService orderDetailCodeService;
/**
*
*/
@AuthRuleAnnotation("")
@Log(title = "单据同步删除", businessType = BusinessType.DELETE)
@PostMapping("/udiwms/sync/order/delete")
public BaseResponse deleteOrder(DeleteRequest deleteRequest) {
List<String> delBillNos = new ArrayList<>();
if (CollUtil.isNotEmpty(deleteRequest.getBillNos())) {
delBillNos.addAll(deleteRequest.getBillNos());
} else {
delBillNos.add(deleteRequest.getBillNo());
}
orderService.deleteInvByBillNo(delBillNos);
for (String billNo : delBillNos) {
orderService.deleteByBillNo(billNo);
orderDetailBizService.deleteByOrderId(billNo);
orderDetailCodeService.deleteByOrderId(billNo);
codeTempService.deleteByBillNo(billNo);
codeService.deleteCodeByOrderId(billNo);
}
return ResultVOUtils.success("同步删除成功");
}
} }

Loading…
Cancel
Save