第三方单据代码提交
parent
5da45aea70
commit
9f5c9687b1
@ -0,0 +1,423 @@
|
||||
package com.glxp.api.controller.thrsys;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.annotation.AuthRuleAnnotation;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BasicProcessStatus;
|
||||
import com.glxp.api.constant.Constant;
|
||||
import com.glxp.api.entity.system.SystemParamConfigEntity;
|
||||
import com.glxp.api.entity.thrsys.*;
|
||||
import com.glxp.api.http.HttpOkClient;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.req.thrsys.*;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.thrsys.ThrOrderResponse;
|
||||
import com.glxp.api.service.system.SystemParamConfigService;
|
||||
import com.glxp.api.service.thrsys.*;
|
||||
import com.glxp.api.util.CustomUtil;
|
||||
import com.glxp.api.util.RedisUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ThrOrderController {
|
||||
@Resource
|
||||
private ThrOrderService thrOrderService;
|
||||
@Resource
|
||||
private ThrOrderDetailService thrOrderDetailService;
|
||||
@Resource
|
||||
private ThrOrdersDlService thrOrdersDlService;
|
||||
@Resource
|
||||
private ThrOrderImportLogService thrOrderImportLogService;
|
||||
@Resource
|
||||
private ThrOrderImportDetailService thrOrderImportDetailService;
|
||||
@Resource
|
||||
RedisUtil redisUtil;
|
||||
@Resource
|
||||
private SystemParamConfigService systemParamConfigService;
|
||||
@Resource
|
||||
private IThrBusTypeOriginService iThrBusTypeOriginService;
|
||||
|
||||
@Resource
|
||||
HttpOkClient httpOkClient;
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/thrsys/getOrders")
|
||||
public BaseResponse getOrders(FilterThrOrderRequest filterThrOrderRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<ThrOrderEntity> thrOrderEntities
|
||||
= thrOrderService.filterThrOrder(filterThrOrderRequest);
|
||||
PageInfo<ThrOrderEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(thrOrderEntities);
|
||||
PageSimpleResponse<ThrOrderEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(thrOrderEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@GetMapping("/udiwms/thrsys/getOrderDetails")
|
||||
public BaseResponse getOrderDetails(FilterThrOrderDetailRequest filterThrOrderDetailRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<ThrOrderDetailEntity> thrOrderDetailEntities
|
||||
= thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
PageInfo<ThrOrderDetailEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(thrOrderDetailEntities);
|
||||
PageSimpleResponse<ThrOrderDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(thrOrderDetailEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/postOrderDetail")
|
||||
public BaseResponse postOrderDetail(@RequestBody PostThrOrderRequest postThrOrderRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
String genKey = postThrOrderRequest.getGenKey();
|
||||
if (genKey == null) {
|
||||
genKey = CustomUtil.getId();
|
||||
}
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey);
|
||||
if (thrOrderImportLogEntity == null) {
|
||||
thrOrderImportLogEntity = new ThrOrderImportLogEntity();
|
||||
thrOrderImportLogEntity.setGenKey(genKey);
|
||||
if (postThrOrderRequest.getUploadType() != null) {
|
||||
thrOrderImportLogEntity.setFromType("文件上传");
|
||||
} else
|
||||
thrOrderImportLogEntity.setFromType("第三方系统上传");
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
|
||||
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
|
||||
}
|
||||
List<ThrOrderResponse> erpOrderResponses = postThrOrderRequest.getDatas();
|
||||
if (erpOrderResponses != null && erpOrderResponses.size() > 0) {
|
||||
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities = new ArrayList<>();
|
||||
String finalGenKey = genKey;
|
||||
for (ThrOrderResponse erpOrderResponse : erpOrderResponses) {
|
||||
List<ThrOrderResponse.SubErpOrder> subErpOrders = erpOrderResponse.getSubErpOrders();
|
||||
if (subErpOrders != null && subErpOrders.size() > 0) {
|
||||
for (ThrOrderResponse.SubErpOrder subErpOrder : subErpOrders) {
|
||||
ThrOrderImportDetailEntity thrOrderDetailEntity = new ThrOrderImportDetailEntity();
|
||||
BeanUtils.copyProperties(erpOrderResponse, thrOrderDetailEntity);
|
||||
BeanUtils.copyProperties(subErpOrder, thrOrderDetailEntity);
|
||||
thrOrderDetailEntity.setGenKeyFk(finalGenKey);
|
||||
thrOrderDetailEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
|
||||
thrOrderDetailEntity.setUpdateTime(new Date());
|
||||
thrOrderImportDetailEntities.add(thrOrderDetailEntity);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
thrOrderImportDetailService.insertOrderImportDetails(thrOrderImportDetailEntities);
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
thrOrderImportLogService.importThrOrder(finalGenKey);
|
||||
} else {
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
return ResultVOUtils.error(500, "上传数据为空");
|
||||
}
|
||||
return ResultVOUtils.success("单据上传成功!");
|
||||
}
|
||||
|
||||
@PostMapping("/udiwms/thrsys/postFileOrder")
|
||||
public BaseResponse postFileOrder(@RequestBody PostFileThrOrderRequest postThrOrderRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
String genKey = postThrOrderRequest.getGenKey();
|
||||
if (genKey == null) {
|
||||
genKey = CustomUtil.getId();
|
||||
}
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey);
|
||||
if (thrOrderImportLogEntity == null) {
|
||||
thrOrderImportLogEntity = new ThrOrderImportLogEntity();
|
||||
thrOrderImportLogEntity.setGenKey(genKey);
|
||||
if (postThrOrderRequest.getUploadType() != null) {
|
||||
thrOrderImportLogEntity.setFromType("文件上传");
|
||||
} else
|
||||
thrOrderImportLogEntity.setFromType("第三方系统上传");
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
|
||||
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
|
||||
}
|
||||
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities = postThrOrderRequest.getDatas();
|
||||
if (thrOrderImportDetailEntities != null && thrOrderImportDetailEntities.size() > 0) {
|
||||
String finalGenKey = genKey;
|
||||
for (ThrOrderImportDetailEntity thrOrderImportDetailEntity : thrOrderImportDetailEntities) {
|
||||
thrOrderImportDetailEntity.setThirdSysFk(postThrOrderRequest.getThirdSys());
|
||||
thrOrderImportDetailEntity.setGenKeyFk(genKey);
|
||||
thrOrderImportDetailEntity.setStatus(String.valueOf(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS));
|
||||
thrOrderImportDetailEntity.setUpdateTime(new Date(System.currentTimeMillis()));
|
||||
}
|
||||
thrOrderImportDetailService.insertOrderImportDetails(thrOrderImportDetailEntities);
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
thrOrderImportLogService.importThrOrder(finalGenKey);
|
||||
} else {
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_FAIL);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
return ResultVOUtils.error(500, "上传数据为空");
|
||||
}
|
||||
return ResultVOUtils.success("单据上传成功!");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/udiwms/thrsys/delOrder")
|
||||
public BaseResponse delOrder(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
String id = deleteRequest.getId();
|
||||
ThrOrderEntity thrOrderEntity = thrOrderService.findById(id);
|
||||
String msg = selectDelect(thrOrderEntity);
|
||||
if (msg == null) {
|
||||
boolean b = thrOrderService.deleteById(id);
|
||||
thrOrderDetailService.deleteByOrderIdFk(thrOrderEntity.getId() + "");
|
||||
if (b)
|
||||
return ResultVOUtils.success("删除成功");
|
||||
else return ResultVOUtils.error(500, "无法删除!");
|
||||
} else return ResultVOUtils.error(500, msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/delOrderDetail")
|
||||
public BaseResponse delOrderDetail(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
boolean b = thrOrderDetailService.deleteById(deleteRequest.getId());
|
||||
if (b)
|
||||
return ResultVOUtils.success("删除成功");
|
||||
else return ResultVOUtils.error(500, "无法删除!");
|
||||
|
||||
}
|
||||
|
||||
public String selectDelect(ThrOrderEntity thrOrderEntity) {
|
||||
FilterThrOrderRequest filterErpOrderRequest = new FilterThrOrderRequest();
|
||||
//todo 单据类型还没设计好
|
||||
// filterErpOrderRequest.setErpOrderId(thrOrderEntity.getBillNo());
|
||||
// List<ThrErpOrderResponse> erpOrderEntities = myErpOrderService.filterAllMyErpOrder(filterErpOrderRequest);
|
||||
// if (erpOrderEntities != null && erpOrderEntities.size() > 0) {
|
||||
// return "单据" + thrOrderEntity.getBillNo() + "已于出入库单据关联,无法删除";
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@RequestMapping("/udiwms/thrsys/order/delAll")
|
||||
public BaseResponse delAll() {
|
||||
thrOrderService.deleteAll();
|
||||
thrOrderDetailService.deleteAll();
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@RequestMapping("/udiwms/thrsys/orders/downloadAll")
|
||||
public BaseResponse downloadAll(FilterThrOrderRequest filterThrProductsRequest) {
|
||||
String data = (String) redisUtil.get(Constant.dlThrOrders);
|
||||
if (false) {//(data != null && data.equals("true")) {
|
||||
return ResultVOUtils.error(500, "当前任务正在下载更新业务单据信息,请稍后重试!");
|
||||
} else {
|
||||
redisUtil.set(Constant.dlThrOrders, "true", 10 * 30);
|
||||
if (filterThrProductsRequest.getBillAction() == null) {
|
||||
return ResultVOUtils.error(500, "未选择业务类型!");
|
||||
}
|
||||
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = new ThrOrderImportLogEntity();
|
||||
String genKey = CustomUtil.getId();
|
||||
thrOrderImportLogEntity.setGenKey(genKey);
|
||||
thrOrderImportLogEntity.setFromType("第三方系统获取");
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
|
||||
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
|
||||
if (filterThrProductsRequest.getErpOrderResponses() != null) {//选中导出
|
||||
thrOrdersDlService.importSelectOrders(genKey, filterThrProductsRequest.getErpOrderResponses(), filterThrProductsRequest.getThirdSysFk());
|
||||
} else { //结果导出
|
||||
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(), null);
|
||||
}
|
||||
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
|
||||
}
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/thrsys/orders/orderDownload")
|
||||
public BaseResponse orderDownload(@RequestBody FilterThrOrderRequest filterThrProductsRequest) {
|
||||
String data = (String) redisUtil.get(Constant.dlThrOrders);
|
||||
if (false) {//(data != null && data.equals("true")) {
|
||||
return ResultVOUtils.error(500, "当前任务正在下载更新业务单据信息,请稍后重试!");
|
||||
} else {
|
||||
redisUtil.set(Constant.dlThrOrders, "true", 10 * 30);
|
||||
if (filterThrProductsRequest.getBillAction() == null) {
|
||||
return ResultVOUtils.error(500, "未选择业务类型!");
|
||||
}
|
||||
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = new ThrOrderImportLogEntity();
|
||||
String genKey = CustomUtil.getId();
|
||||
thrOrderImportLogEntity.setGenKey(genKey);
|
||||
thrOrderImportLogEntity.setFromType("第三方系统获取");
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date());
|
||||
thrOrderImportLogEntity.setThirdSysFk(filterThrProductsRequest.getThirdSysFk());
|
||||
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
|
||||
if (filterThrProductsRequest.getErpOrderResponses() != null && filterThrProductsRequest.getErpOrderResponses().size() > 0) {//选中导出
|
||||
thrOrdersDlService.importSelectOrders(genKey, filterThrProductsRequest.getErpOrderResponses(), filterThrProductsRequest.getThirdSysFk());
|
||||
} else { //结果导出
|
||||
thrOrdersDlService.importOrders(genKey, filterThrProductsRequest.getBillAction(), filterThrProductsRequest);
|
||||
}
|
||||
return ResultVOUtils.success("后台开始下载更新,请稍后刷新查看");
|
||||
}
|
||||
}
|
||||
|
||||
@AuthRuleAnnotation("")
|
||||
@PostMapping("/udiwms/smp/postOrder")
|
||||
public BaseResponse postSmpOrder(@RequestBody PostSmpOrderRequest postSmpOrderRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
|
||||
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("smp_uploadOrder_url");
|
||||
String postUrl;
|
||||
if (systemParamConfigEntity == null)
|
||||
return ResultVOUtils.error(500, "上传供应商平台接口地址未定义");
|
||||
else
|
||||
postUrl = systemParamConfigEntity.getParamValue();
|
||||
|
||||
List<String> ids = postSmpOrderRequest.getIds();
|
||||
for (String id : ids) {
|
||||
ThrOrderEntity thrOrderEntity = thrOrderService.findById(id);
|
||||
UploadSmpRequest uploadSmpRequest = new UploadSmpRequest();
|
||||
BeanUtils.copyProperties(thrOrderEntity, uploadSmpRequest);
|
||||
uploadSmpRequest.setType(1);
|
||||
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
|
||||
filterThrOrderDetailRequest.setOrderIdFk(id);
|
||||
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
if (thrOrderDetailEntities != null && thrOrderDetailEntities.size() > 0) {
|
||||
List<UploadSmpRequest.SubErpOrder> subErpOrders = new ArrayList<>();
|
||||
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
|
||||
UploadSmpRequest.SubErpOrder subErpOrder = new UploadSmpRequest.SubErpOrder();
|
||||
BeanUtils.copyProperties(thrOrderDetailEntity, subErpOrder);
|
||||
subErpOrders.add(subErpOrder);
|
||||
}
|
||||
uploadSmpRequest.setSubErpOrders(subErpOrders);
|
||||
|
||||
String response = httpOkClient.uCloudPost(postUrl, uploadSmpRequest);
|
||||
BaseResponse baseResponse =
|
||||
JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
|
||||
});
|
||||
if (baseResponse.getCode() == 20000) {
|
||||
return ResultVOUtils.success("上传成功!");
|
||||
} else {
|
||||
return ResultVOUtils.error(baseResponse.getCode(), baseResponse.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
return ResultVOUtils.error(500, "上传数据成功");
|
||||
}
|
||||
//只查询第三方单据
|
||||
@GetMapping("/udiwms/thirdOrder/filter")
|
||||
public BaseResponse filterThirdOrder(FilterOrderRequest filterErpOrderRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
//
|
||||
// if (filterErpOrderRequest.getIsDownThrSys()) {
|
||||
// BaseResponse<PageSimpleResponse<ErpOrderResponse>> responseBaseResponse = erpOrderClient.getErpOrderResponse(filterErpOrderRequest);
|
||||
// return responseBaseResponse;
|
||||
// }
|
||||
|
||||
|
||||
ThrSystemDetailEntity thrSystemDetailEntity = iThrBusTypeOriginService.findSysByAction(filterErpOrderRequest.getBillAction(), "orderQueryUrl");
|
||||
filterErpOrderRequest.setThirdOrderFk(thrSystemDetailEntity.getThirdSysFk());
|
||||
if (thrSystemDetailEntity == null || !thrSystemDetailEntity.getEnabled()) {
|
||||
return ResultVOUtils.error(500, "第三方系统业务单据接口服务未启用");
|
||||
}
|
||||
|
||||
if (thrSystemDetailEntity.getThirdSysFk() == null) {
|
||||
return ResultVOUtils.error(500, "第三方业务单据服务未关联");
|
||||
}
|
||||
|
||||
|
||||
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
|
||||
BeanUtils.copyProperties(filterErpOrderRequest, filterThrOrderRequest);
|
||||
filterThrOrderRequest.setPage(filterErpOrderRequest.getPage());
|
||||
filterThrOrderRequest.setLimit(filterErpOrderRequest.getLimit());
|
||||
List<ThrOrderResponse> erpOrderResponses = new ArrayList<>();
|
||||
List<ThrOrderEntity> data = thrOrderService.filterThrOrder(filterThrOrderRequest);
|
||||
if (data != null && data.size() > 0) {
|
||||
for (ThrOrderEntity thrOrderEntity : data) {
|
||||
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
|
||||
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
|
||||
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailService.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
ThrOrderResponse erpOrderResponse = new ThrOrderResponse();
|
||||
BeanUtils.copyProperties(thrOrderEntity, erpOrderResponse);
|
||||
List<ThrOrderResponse.SubErpOrder> subErpOrders = new ArrayList<>();
|
||||
if (thrOrderDetailEntities != null && thrOrderDetailEntities.size() > 0) {
|
||||
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
|
||||
ThrOrderResponse.SubErpOrder subErpOrder = new ThrOrderResponse.SubErpOrder();
|
||||
BeanUtils.copyProperties(thrOrderDetailEntity, subErpOrder);
|
||||
subErpOrders.add(subErpOrder);
|
||||
}
|
||||
}
|
||||
erpOrderResponse.setSubErpOrders(subErpOrders);
|
||||
erpOrderResponses.add(erpOrderResponse);
|
||||
}
|
||||
}
|
||||
//todo 单据表还未设计好
|
||||
// if (thrSystemDetailEntity.getLocalAction() != null) {
|
||||
// BaseResponse<PageSimpleResponse<ThrOrderResponse>> loca = getLoaclData(filterErpOrderRequest);
|
||||
// erpOrderResponses.addAll(loca.getData().getList());
|
||||
// }
|
||||
PageInfo<ThrOrderEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(data);
|
||||
PageSimpleResponse<ThrOrderResponse> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(erpOrderResponses);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,327 @@
|
||||
package com.glxp.api.controller.thrsys;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.glxp.api.common.enums.ResultEnum;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.common.util.ResultVOUtils;
|
||||
import com.glxp.api.constant.BasicProcessStatus;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportLogEntity;
|
||||
import com.glxp.api.req.system.DeleteRequest;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.service.thrsys.ThrOrderImportDetailService;
|
||||
import com.glxp.api.service.thrsys.ThrOrderImportLogService;
|
||||
import com.glxp.api.util.CustomUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ThrOrderImportLogController {
|
||||
|
||||
@Resource
|
||||
ThrOrderImportLogService thrOrderImportLogService;
|
||||
@Resource
|
||||
ThrOrderImportDetailService thrOrderImportDetailService;
|
||||
|
||||
|
||||
@GetMapping("/udiwms/thrOrder/importLog/filter")
|
||||
public BaseResponse filter(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<ThrOrderImportLogEntity> udiInfoImportLogEntities
|
||||
= thrOrderImportLogService.filterThrOrderImportLog(filterThrCorpImportLogRequest);
|
||||
PageInfo<ThrOrderImportLogEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(udiInfoImportLogEntities);
|
||||
PageSimpleResponse<ThrOrderImportLogEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(udiInfoImportLogEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
@GetMapping("/udiwms/thrOrder/importLog/filterDetail")
|
||||
public BaseResponse filterDetail(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest,
|
||||
BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities
|
||||
= thrOrderImportDetailService.filterOrderImportDetail(filterThrCorpImportLogRequest);
|
||||
PageInfo<ThrOrderImportDetailEntity> pageInfo;
|
||||
pageInfo = new PageInfo<>(thrOrderImportDetailEntities);
|
||||
PageSimpleResponse<ThrOrderImportDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
|
||||
pageSimpleResponse.setTotal(pageInfo.getTotal());
|
||||
pageSimpleResponse.setList(thrOrderImportDetailEntities);
|
||||
return ResultVOUtils.success(pageSimpleResponse);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/udiwms/thrOrder/importLog/deleteLog")
|
||||
public BaseResponse deleteLog(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
String id = deleteRequest.getId();
|
||||
FilterThrCorpImportLogRequest filterInCodeLogRequest = new FilterThrCorpImportLogRequest();
|
||||
filterInCodeLogRequest.setId(Integer.parseInt(id));
|
||||
List<ThrOrderImportLogEntity> corpImportLogEntities = thrOrderImportLogService.filterThrOrderImportLog(filterInCodeLogRequest);
|
||||
if (corpImportLogEntities != null && corpImportLogEntities.size() > 0) {
|
||||
ThrOrderImportLogEntity corpImportLogEntity = corpImportLogEntities.get(0);
|
||||
thrOrderImportLogService.deleteById(corpImportLogEntity.getId() + "");
|
||||
thrOrderImportDetailService.deleteByGenkey(corpImportLogEntity.getGenKey());
|
||||
}
|
||||
|
||||
return ResultVOUtils.success("删除成功");
|
||||
}
|
||||
|
||||
@PostMapping("/udiwms/thrOrder/importLog/delete")
|
||||
public BaseResponse delete(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
|
||||
}
|
||||
if (thrOrderImportDetailService.deleteById(deleteRequest.getId()))
|
||||
return ResultVOUtils.success("删除成功");
|
||||
else
|
||||
return ResultVOUtils.error(500, "删除成功");
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/udiwms/thrOrder/importLog/upload")
|
||||
public BaseResponse uploadOrders(@RequestParam("file") List<MultipartFile> files, @RequestParam("thirdSys") String thirdSys) {
|
||||
|
||||
String filePath = "D:\\udiwms\\filePath\\";
|
||||
File createFile = new File(filePath);
|
||||
if (!createFile.exists()) {
|
||||
createFile.mkdirs();
|
||||
}
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
MultipartFile file = files.get(i);
|
||||
if (file.isEmpty()) {
|
||||
return ResultVOUtils.error(500, "上传第" + (i++) + "个文件失败");
|
||||
}
|
||||
String fileName = file.getOriginalFilename();
|
||||
try {
|
||||
InputStream inputStream = file.getInputStream();
|
||||
Workbook workbook = null;
|
||||
String filetype = fileName.substring(fileName.lastIndexOf("."));
|
||||
|
||||
if (".xls".equals(filetype)) {
|
||||
workbook = new HSSFWorkbook(inputStream);
|
||||
} else if (".xlsx".equals(filetype)) {
|
||||
workbook = new XSSFWorkbook(inputStream);
|
||||
} else {
|
||||
return ResultVOUtils.error(500, "请上传excel文件");
|
||||
}
|
||||
Sheet sheet = null;
|
||||
Row row = null;
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = new ThrOrderImportLogEntity();
|
||||
String genKey = CustomUtil.getId();
|
||||
thrOrderImportLogEntity.setGenKey(genKey);
|
||||
thrOrderImportLogEntity.setThirdSysFk(thirdSys);
|
||||
thrOrderImportLogEntity.setFromType("文件导入");
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogEntity.setUpdateTime(new Date(System.currentTimeMillis()));
|
||||
thrOrderImportLogService.insertImportLog(thrOrderImportLogEntity);
|
||||
List<ThrOrderImportDetailEntity> corpImportDetailEntities = new ArrayList<>();
|
||||
for (int j = 0; j < 1; j++) {//workbook.getNumberOfSheets()
|
||||
sheet = workbook.getSheetAt(j);
|
||||
if (sheet == null) {
|
||||
continue;
|
||||
}
|
||||
// 滤过第一行标题
|
||||
row = sheet.getRow(0);
|
||||
if ((row.getCell(0) == null || row.getCell(1) == null || row.getCell(2) == null
|
||||
|| row.getCell(3) == null || row.getCell(4) == null || row.getCell(5) == null || row.getCell(6) == null) ||
|
||||
(!"单据号".equals(row.getCell(0).getStringCellValue())
|
||||
|| !"单据日期".equals(row.getCell(1).getStringCellValue())
|
||||
|| !"往来单位ID".equals(row.getCell(2).getStringCellValue())
|
||||
|| !"往来单位名称".equals(row.getCell(3).getStringCellValue())
|
||||
|| !"单据类型".equals(row.getCell(4).getStringCellValue())
|
||||
|| !"单据状态".equals(row.getCell(5).getStringCellValue())
|
||||
|| !"产品ID".equals(row.getCell(6).getStringCellValue()))) {
|
||||
return ResultVOUtils.error(500, "文件格式错误!");
|
||||
}
|
||||
for (int k = sheet.getFirstRowNum() + 1; k <= sheet.getLastRowNum(); k++) {
|
||||
row = sheet.getRow(k);
|
||||
if (row == null || row.getRowNum() <= 0) {
|
||||
continue;
|
||||
}
|
||||
if (filterEmpty(row)) {
|
||||
continue;
|
||||
}
|
||||
ThrOrderImportDetailEntity corpImportDetailEntity = new ThrOrderImportDetailEntity();
|
||||
Cell cell1 = row.getCell(0);
|
||||
if (cell1 != null) {
|
||||
cell1.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setBillNo(cell1.getStringCellValue());
|
||||
}
|
||||
Cell cell2 = row.getCell(1);
|
||||
if (cell2 != null) {
|
||||
cell2.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setBilldate(cell2.getStringCellValue());
|
||||
}
|
||||
Cell cell3 = row.getCell(2);
|
||||
if (cell3 != null) {
|
||||
cell3.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setCorpId(cell3.getStringCellValue());
|
||||
|
||||
}
|
||||
Cell cell4 = row.getCell(3);
|
||||
if (cell4 != null) {
|
||||
cell4.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setCorpName(cell4.getStringCellValue());
|
||||
|
||||
}
|
||||
Cell cell5 = row.getCell(4);
|
||||
if (cell5 != null) {
|
||||
cell5.setCellType(CellType.STRING);
|
||||
String billType = cell5.getStringCellValue();
|
||||
//todo 表功能还未设计好
|
||||
// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByName(billType);
|
||||
// if (bussinessTypeEntity != null) {
|
||||
// corpImportDetailEntity.setBillType(bussinessTypeEntity.getAction());
|
||||
// } else
|
||||
// corpImportDetailEntity.setBillType(billType);
|
||||
|
||||
|
||||
}
|
||||
Cell cell6 = row.getCell(5);
|
||||
if (cell6 != null) {
|
||||
cell6.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setBillFlag(cell6.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell7 = row.getCell(6);
|
||||
if (cell7 != null) {
|
||||
cell7.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setProductId(cell7.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell8 = row.getCell(7);
|
||||
if (cell8 != null) {
|
||||
cell8.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setProductName(cell8.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell9 = row.getCell(8);
|
||||
if (cell9 != null) {
|
||||
cell9.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setSpec(cell9.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell10 = row.getCell(9);
|
||||
if (cell10 != null) {
|
||||
cell10.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setBatchNo(cell10.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell11 = row.getCell(10);
|
||||
if (cell11 != null) {
|
||||
cell11.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setProductDate(cell11.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell12 = row.getCell(11);
|
||||
if (cell12 != null) {
|
||||
cell12.setCellType(CellType.STRING);
|
||||
corpImportDetailEntity.setExpireDate(cell12.getStringCellValue());
|
||||
}
|
||||
|
||||
Cell cell13 = row.getCell(12);
|
||||
if (cell13 != null) {
|
||||
cell13.setCellType(CellType.STRING);
|
||||
String count = cell13.getStringCellValue();
|
||||
if (count != null && !"".equals(count)) {
|
||||
corpImportDetailEntity.setCount(String.valueOf(Integer.parseInt(count)));
|
||||
}
|
||||
}
|
||||
Cell cell14 = row.getCell(13);
|
||||
if (cell14 != null) {
|
||||
cell14.setCellType(CellType.STRING);
|
||||
String count = cell14.getStringCellValue();
|
||||
if (count != null && !"".equals(count)) {
|
||||
corpImportDetailEntity.setReCount(String.valueOf(Integer.parseInt(count)));
|
||||
}
|
||||
}
|
||||
|
||||
corpImportDetailEntity.setThirdSysFk(thirdSys);
|
||||
corpImportDetailEntity.setGenKeyFk(genKey);
|
||||
corpImportDetailEntity.setStatus(String.valueOf(BasicProcessStatus.UDIINFO_IMPORT_CODE_UNPROCESS));
|
||||
corpImportDetailEntity.setUpdateTime(new Date(System.currentTimeMillis()));
|
||||
corpImportDetailEntities.add(corpImportDetailEntity);
|
||||
}
|
||||
}
|
||||
thrOrderImportDetailService.insertOrderImportDetails(corpImportDetailEntities);
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS);
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
workbook.close();
|
||||
thrOrderImportLogService.importThrOrder(genKey);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return ResultVOUtils.success("上传成功");
|
||||
}
|
||||
|
||||
|
||||
public boolean filterEmpty(Row row) {
|
||||
|
||||
if (row.getCell(0) != null) {
|
||||
row.getCell(0).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(1) != null) {
|
||||
row.getCell(1).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(2) != null) {
|
||||
row.getCell(2).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(3) != null) {
|
||||
row.getCell(3).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(4) != null) {
|
||||
row.getCell(4).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(5) != null) {
|
||||
row.getCell(5).setCellType(CellType.STRING);
|
||||
}
|
||||
if (row.getCell(6) != null) {
|
||||
row.getCell(6).setCellType(CellType.STRING);
|
||||
}
|
||||
if ((row.getCell(0) == null && row.getCell(1) == null && row.getCell(2) == null
|
||||
&& row.getCell(3) == null && row.getCell(4) == null && row.getCell(5) == null && row.getCell(6) == null) ||
|
||||
(
|
||||
(row.getCell(0) != null && row.getCell(1) != null && row.getCell(2) != null
|
||||
&& row.getCell(3) != null && row.getCell(4) != null && row.getCell(5) != null && row.getCell(6) != null) &&
|
||||
("".equals(row.getCell(0).getStringCellValue())
|
||||
&& "".equals(row.getCell(1).getStringCellValue())
|
||||
&& "".equals(row.getCell(2).getStringCellValue())
|
||||
&& "".equals(row.getCell(3).getStringCellValue())
|
||||
&& "".equals(row.getCell(4).getStringCellValue())
|
||||
&& "".equals(row.getCell(5).getStringCellValue())
|
||||
&& "".equals(row.getCell(6).getStringCellValue()))
|
||||
)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrOrderDao {
|
||||
|
||||
List<ThrOrderEntity> filterThrOrder(FilterThrOrderRequest filterThrOrderRequest);
|
||||
|
||||
List<ThrOrderEntity> filterReceiveOrder(FilterThrOrderRequest filterThrOrderRequest);
|
||||
|
||||
|
||||
boolean insertThrOrder(ThrOrderEntity thrCorpEntity);
|
||||
|
||||
boolean importThrOrder(ThrOrderEntity thrCorpEntity);
|
||||
|
||||
boolean insertThrOrders(@Param("thrOrderEntities") List<ThrOrderEntity> thrOrderEntities);
|
||||
|
||||
boolean updateThrOrder(ThrOrderEntity thrOrderEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteAll();
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrOrderDetailDao {
|
||||
|
||||
List<ThrOrderDetailEntity> filterThrOrderDetailDetail(FilterThrOrderDetailRequest filterThrOrderDetailRequest);
|
||||
|
||||
boolean insertThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
|
||||
|
||||
boolean importThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
|
||||
|
||||
boolean insertThrOrderDetails(@Param("thrOrderDetailEntities") List<ThrOrderDetailEntity> thrOrderDetailEntities);
|
||||
|
||||
boolean updateThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByOrderIdFk(@Param("orderIdFk") String orderIdFk);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
boolean deleteByTime();
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderExportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrOrderExportLogDao {
|
||||
|
||||
List<ThrOrderExportLogEntity> filterThrOrderExportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity);
|
||||
|
||||
boolean updateThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByTime();
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrOrderImportDetailDao {
|
||||
|
||||
List<ThrOrderImportDetailEntity> filterOrderdDetailImport(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertOrderdDetailImport(ThrOrderImportDetailEntity thrOrderImportDetailEntity);
|
||||
|
||||
boolean updateOrderdDetailImport(ThrOrderImportDetailEntity thrOrderImportDetailEntity);
|
||||
|
||||
boolean insertOrderdDetailImports(@Param("orders") List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByGenkey(@Param("genKey") String genKey);
|
||||
|
||||
boolean deleteByTime();
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.glxp.api.dao.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ThrOrderImportLogDao {
|
||||
|
||||
List<ThrOrderImportLogEntity> filterThrOrderImportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity);
|
||||
|
||||
boolean updateImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity);
|
||||
|
||||
boolean deleteById(@Param("id") String id);
|
||||
|
||||
boolean deleteByTime();
|
||||
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.glxp.api.entity.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-01-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("thr_order_detail")
|
||||
public class ThrOrderDetailEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("productId")
|
||||
private String productId;
|
||||
|
||||
@TableField("productName")
|
||||
private String productName;
|
||||
|
||||
@TableField("spec")
|
||||
private String spec;
|
||||
|
||||
@TableField("batchNo")
|
||||
private String batchNo;
|
||||
|
||||
@TableField("expireDate")
|
||||
private String expireDate;
|
||||
|
||||
@TableField("productDate")
|
||||
private String productDate;
|
||||
|
||||
@TableField("count")
|
||||
private String count;
|
||||
|
||||
@TableField("reCount")
|
||||
private String reCount;
|
||||
|
||||
@TableField("orderIdFk")
|
||||
private String orderIdFk;
|
||||
|
||||
@TableField("thirdSysFk")
|
||||
private String thirdSysFk;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@TableField("price")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 往来单位
|
||||
*/
|
||||
@TableField("corpName")
|
||||
private String corpName;
|
||||
|
||||
/**
|
||||
* 医疗器械注册人
|
||||
*/
|
||||
@TableField("ylqxzcrbarmc")
|
||||
private String ylqxzcrbarmc;
|
||||
|
||||
/**
|
||||
* 注册证号
|
||||
*/
|
||||
@TableField("zczbhhzbapzbh")
|
||||
private String zczbhhzbapzbh;
|
||||
|
||||
/**
|
||||
* 生产企业
|
||||
*/
|
||||
@TableField("manufactory")
|
||||
private String manufactory;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("createUser")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package com.glxp.api.entity.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-01-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("thr_order_import_detail")
|
||||
public class ThrOrderImportDetailEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("billNo")
|
||||
private String billNo;
|
||||
|
||||
@TableField("billdate")
|
||||
private String billdate;
|
||||
|
||||
@TableField("corpId")
|
||||
private String corpId;
|
||||
|
||||
@TableField("corpName")
|
||||
private String corpName;
|
||||
|
||||
@TableField("billType")
|
||||
private String billType;
|
||||
|
||||
@TableField("billFlag")
|
||||
private String billFlag;
|
||||
|
||||
@TableField("productId")
|
||||
private String productId;
|
||||
|
||||
@TableField("productName")
|
||||
private String productName;
|
||||
|
||||
@TableField("spec")
|
||||
private String spec;
|
||||
|
||||
@TableField("batchNo")
|
||||
private String batchNo;
|
||||
|
||||
@TableField("expireDate")
|
||||
private String expireDate;
|
||||
|
||||
@TableField("productDate")
|
||||
private String productDate;
|
||||
|
||||
@TableField("count")
|
||||
private String count;
|
||||
|
||||
@TableField("reCount")
|
||||
private String reCount;
|
||||
|
||||
@TableField("status")
|
||||
private String status;
|
||||
|
||||
@TableField("genKeyFk")
|
||||
private String genKeyFk;
|
||||
|
||||
@TableField("thirdSysFk")
|
||||
private String thirdSysFk;
|
||||
|
||||
@TableField("originType")
|
||||
private String originType;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("createUser")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createTime")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updateTime")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package com.glxp.api.entity.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-01-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("thr_order_upload_bustypes")
|
||||
public class ThrOrderUploadBustypesEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField("action")
|
||||
private String action;
|
||||
|
||||
@TableField("name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("createUser")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createTime")
|
||||
private Data createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updateTime")
|
||||
private Data updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
package com.glxp.api.entity.thrsys;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 作者
|
||||
* @since 2023-01-13
|
||||
*/
|
||||
@Data
|
||||
@TableName("thr_order_upload")
|
||||
public class ThrOrderUploadEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("id")
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 是否自动上传
|
||||
*/
|
||||
@TableField("autoUpload")
|
||||
private Integer autoUpload;
|
||||
|
||||
/**
|
||||
* 同步时间间隔
|
||||
*/
|
||||
@TableField("orderSyncTime")
|
||||
private Integer orderSyncTime;
|
||||
|
||||
/**
|
||||
* 待校验单据
|
||||
*/
|
||||
@TableField("orderUnCheck")
|
||||
private Integer orderUnCheck;
|
||||
|
||||
/**
|
||||
* 未验收单据
|
||||
*/
|
||||
@TableField("orderUnReceive")
|
||||
private Integer orderUnReceive;
|
||||
|
||||
/**
|
||||
* 已完成单据
|
||||
*/
|
||||
@TableField("orderScanFinish")
|
||||
private Integer orderScanFinish;
|
||||
|
||||
/**
|
||||
* UDIMS平台
|
||||
*/
|
||||
@TableField("checkUdims")
|
||||
private Integer checkUdims;
|
||||
|
||||
/**
|
||||
* PDA已校验
|
||||
*/
|
||||
@TableField("checkPdaEd")
|
||||
private Integer checkPdaEd;
|
||||
|
||||
/**
|
||||
* pda未校验
|
||||
*/
|
||||
@TableField("checkPdaUn")
|
||||
private Integer checkPdaUn;
|
||||
|
||||
/**
|
||||
* 扫码通
|
||||
*/
|
||||
@TableField("checkPc")
|
||||
private Integer checkPc;
|
||||
|
||||
/**
|
||||
* 网页端新增
|
||||
*/
|
||||
@TableField("checkWebNew")
|
||||
private Integer checkWebNew;
|
||||
|
||||
/**
|
||||
* 缺量补单
|
||||
*/
|
||||
@TableField("checkChange")
|
||||
private Integer checkChange;
|
||||
|
||||
/**
|
||||
* 自助平台同步
|
||||
*/
|
||||
@TableField("checkSp")
|
||||
private Integer checkSp;
|
||||
|
||||
/**
|
||||
* 平衡补单
|
||||
*/
|
||||
@TableField("checkBalacne")
|
||||
private Integer checkBalacne;
|
||||
|
||||
/**
|
||||
* 单据上传起始时间
|
||||
*/
|
||||
@TableField("orderStartTime")
|
||||
private String orderStartTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField("createUser")
|
||||
private String createUser;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField("createTime")
|
||||
private Data createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField("updateUser")
|
||||
private String updateUser;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField("updateTime")
|
||||
private Data updateTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("remark")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
package com.glxp.api.http;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.glxp.api.common.res.BaseResponse;
|
||||
import com.glxp.api.constant.ConstantStatus;
|
||||
import com.glxp.api.entity.thrsys.ThrSystemEntity;
|
||||
import com.glxp.api.req.thrsys.FilterOrderRequest;
|
||||
import com.glxp.api.res.PageSimpleResponse;
|
||||
import com.glxp.api.res.thrsys.ThrErpOrderResponse;
|
||||
|
||||
import com.glxp.api.res.thrsys.ThrOrderResponse;
|
||||
import com.glxp.api.service.thrsys.ThrSystemService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 获取ERP出入库单据
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ErpOrderClient {
|
||||
|
||||
@Autowired
|
||||
private ThrSystemService thrSystemService;
|
||||
@Resource
|
||||
HttpOkClient httpOkClient;
|
||||
|
||||
public List<ThrOrderResponse> getErpOrder(String url, List<String> billCodes, String action) {
|
||||
List<ThrOrderResponse> erpOrderEntities = new ArrayList<>();
|
||||
if (billCodes != null && billCodes.size() > 0) {
|
||||
for (int i = 0; i < billCodes.size(); i++) {
|
||||
List<ThrOrderResponse> ThrErpOrderResponses = getErpOrder(url, Arrays.asList(billCodes.get(i)), action);
|
||||
if (ThrErpOrderResponses != null) {
|
||||
erpOrderEntities.addAll(ThrErpOrderResponses);
|
||||
}
|
||||
}
|
||||
}
|
||||
return erpOrderEntities;
|
||||
}
|
||||
|
||||
public BaseResponse<PageSimpleResponse<ThrOrderResponse>> getThrOrderResponse(FilterOrderRequest filterOrderRequest) {
|
||||
|
||||
//查询第三方服务授权参数
|
||||
ThrSystemEntity thrSystemEntity = thrSystemService.selectByThirdId("thirdId");
|
||||
String url = thrSystemEntity.getThridUrl() + "/udiwms/erp/getOrders";
|
||||
String response = httpOkClient.uCloudPost(url, filterOrderRequest, thrSystemEntity);
|
||||
try {
|
||||
BaseResponse<PageSimpleResponse<ThrOrderResponse>> responseBaseResponse =
|
||||
JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThrOrderResponse>>>() {
|
||||
});
|
||||
return responseBaseResponse;
|
||||
} catch (Exception e) {
|
||||
log.error("获取订单数据异常", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<ThrErpOrderResponse> getErpOrder(FilterOrderRequest filterOrderRequest) {
|
||||
try {
|
||||
BaseResponse<PageSimpleResponse<ThrOrderResponse>> responseBaseResponse = getThrOrderResponse(filterOrderRequest);
|
||||
List<ThrOrderResponse> purchaseinResponseList = responseBaseResponse.getData().getList();
|
||||
if (purchaseinResponseList != null && purchaseinResponseList.size() > 0) {
|
||||
List<ThrErpOrderResponse> erpOrderEntities = new ArrayList<>();
|
||||
for (ThrOrderResponse ThrOrderResponse : purchaseinResponseList) {
|
||||
for (ThrOrderResponse.SubErpOrder subPurchase : ThrOrderResponse.getSubErpOrders()) {
|
||||
ThrErpOrderResponse ThrErpOrderResponse = new ThrErpOrderResponse();
|
||||
ThrErpOrderResponse.setErpOrderId(ThrOrderResponse.getBillNo());
|
||||
ThrErpOrderResponse.setCompanyid(ThrOrderResponse.getCorpId());
|
||||
ThrErpOrderResponse.setCompanyname(ThrOrderResponse.getCorpName());
|
||||
ThrErpOrderResponse.setCredate(ThrOrderResponse.getBilldate());
|
||||
ThrErpOrderResponse.setGoodsid(subPurchase.getProductId());
|
||||
ThrErpOrderResponse.setGoodsname(subPurchase.getProductName());
|
||||
ThrErpOrderResponse.setBatchNo(subPurchase.getBatchNo());
|
||||
ThrErpOrderResponse.setProductDate(subPurchase.getProductDate());
|
||||
ThrErpOrderResponse.setExpireDate(subPurchase.getExpireDate());
|
||||
ThrErpOrderResponse.setErpCount(subPurchase.getCount());
|
||||
ThrErpOrderResponse.setReCount(subPurchase.getReCount());
|
||||
ThrErpOrderResponse.setOriginType(ThrOrderResponse.getOriginType());
|
||||
ThrErpOrderResponse.setGoodsunit(subPurchase.getSpec());
|
||||
ThrErpOrderResponse.setOrderFromType(ConstantStatus.SORDER_FROM_ONLINE);
|
||||
erpOrderEntities.add(ThrErpOrderResponse);
|
||||
}
|
||||
}
|
||||
return erpOrderEntities;
|
||||
}
|
||||
} catch (
|
||||
Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// public BaseResponse submitOrder(UdiwmsOrderRequest udiwmsOrderRequest) {
|
||||
// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(udiwmsOrderRequest.getThirdSys());
|
||||
// String url = basicThirdSysEntity.getThridUrl() + "/udiwms/erp/submitOrders";
|
||||
// String response = httpOkClient.uCloudPost(url, udiwmsOrderRequest);
|
||||
// try {
|
||||
// BaseResponse<PageSimpleResponse<ThrOrderResponse>> responseBaseResponse =
|
||||
// JSONObject.parseObject(response, new TypeReference<BaseResponse<PageSimpleResponse<ThrOrderResponse>>>() {
|
||||
// });
|
||||
// return responseBaseResponse;
|
||||
// } catch (Exception e) {
|
||||
// log.error("获取订单数据异常", e);
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
// public BaseResponse postBill(Map<String, List<ThrErpOrderResponse>> postMap, String billAction, String uploadUrl, String thirdSysFk) {
|
||||
// ERPPostBillRequest erpPostBillRequest = new ERPPostBillRequest();
|
||||
// erpPostBillRequest.setPostMap(postMap);
|
||||
// erpPostBillRequest.setBillAction(billAction);
|
||||
//
|
||||
// //查询第三方服务授权参数
|
||||
// BasicThirdSysEntity basicThirdSysEntity = basicThirdSysService.selectByThirdId(thirdSysFk);
|
||||
// String response = httpOkClient.uCloudPost(uploadUrl, erpPostBillRequest, basicThirdSysEntity);
|
||||
// BaseResponse baseResponse = JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
|
||||
// });
|
||||
// return baseResponse;
|
||||
// }
|
||||
//
|
||||
// public BaseResponse postBill(ERPPostBillRequest erpPostBillRequest, String uploadUrl) {
|
||||
// String response = httpOkClient.uCloudPost(uploadUrl, erpPostBillRequest);
|
||||
// BaseResponse baseResponse =
|
||||
// JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
|
||||
// });
|
||||
// return baseResponse;
|
||||
// }
|
||||
//
|
||||
// public BaseResponse signBill(USignRequest signRequest, String url) {
|
||||
// String response = httpOkClient.uCloudPost(url, signRequest);
|
||||
// BaseResponse baseResponse =
|
||||
// JSONObject.parseObject(response, new TypeReference<BaseResponse>() {
|
||||
// });
|
||||
// return baseResponse;
|
||||
// }
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.req.ListPageRequest;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class FilterThrOrderDetailRequest extends ListPageRequest {
|
||||
|
||||
private String orderIdFk;
|
||||
private String thirdSysFk;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostFileThrOrderRequest {
|
||||
|
||||
private String genKey;
|
||||
private String thirdSys;
|
||||
private String uploadType;
|
||||
private List<ThrOrderImportDetailEntity> datas;
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostSmpOrderRequest {
|
||||
|
||||
List<String> ids;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
|
||||
import com.glxp.api.res.thrsys.ThrOrderResponse;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class PostThrOrderRequest {
|
||||
|
||||
private String genKey;
|
||||
private String thirdSys;
|
||||
private String uploadType;
|
||||
private List<ThrOrderResponse> datas;
|
||||
|
||||
//增加字段
|
||||
private String startDate; //起始日期
|
||||
private String endDate; //结束日期
|
||||
private String createUser; //创建人
|
||||
private String reviewUser; //审核人
|
||||
private String address; //地址
|
||||
private String linkMan; //联系人
|
||||
private String linkTel; //联系电话
|
||||
private String remark; //备注
|
||||
private String remark1; //备注1
|
||||
private String remark2; //备注2
|
||||
private String remark3; //备注3
|
||||
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
package com.glxp.api.req.thrsys;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UploadSmpRequest {
|
||||
|
||||
private String billNo;
|
||||
private String billdate;
|
||||
private String corpId;
|
||||
private String corpName;
|
||||
private String billType;
|
||||
private String billFlag;
|
||||
private String thirdSysFk;
|
||||
private Integer type;
|
||||
private List<SubErpOrder> subErpOrders;
|
||||
|
||||
public String getBillNo() {
|
||||
return billNo;
|
||||
}
|
||||
|
||||
public void setBillNo(String billNo) {
|
||||
this.billNo = billNo;
|
||||
}
|
||||
|
||||
public String getBilldate() {
|
||||
return billdate;
|
||||
}
|
||||
|
||||
public void setBilldate(String billdate) {
|
||||
this.billdate = billdate;
|
||||
}
|
||||
|
||||
public String getCorpId() {
|
||||
return corpId;
|
||||
}
|
||||
|
||||
public void setCorpId(String corpId) {
|
||||
this.corpId = corpId;
|
||||
}
|
||||
|
||||
public String getCorpName() {
|
||||
return corpName;
|
||||
}
|
||||
|
||||
public void setCorpName(String corpName) {
|
||||
this.corpName = corpName;
|
||||
}
|
||||
|
||||
public String getBillType() {
|
||||
return billType;
|
||||
}
|
||||
|
||||
public void setBillType(String billType) {
|
||||
this.billType = billType;
|
||||
}
|
||||
|
||||
|
||||
public List<SubErpOrder> getSubErpOrders() {
|
||||
return subErpOrders;
|
||||
}
|
||||
|
||||
public void setSubErpOrders(List<SubErpOrder> subErpOrders) {
|
||||
this.subErpOrders = subErpOrders;
|
||||
}
|
||||
|
||||
public String getBillFlag() {
|
||||
return billFlag;
|
||||
}
|
||||
|
||||
public void setBillFlag(String billFlag) {
|
||||
this.billFlag = billFlag;
|
||||
}
|
||||
|
||||
public String getThirdSysFk() {
|
||||
return thirdSysFk;
|
||||
}
|
||||
|
||||
public void setThirdSysFk(String thirdSysFk) {
|
||||
this.thirdSysFk = thirdSysFk;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public static class SubErpOrder {
|
||||
private String productId;
|
||||
private String productName;
|
||||
private String spec;
|
||||
private String batchNo;
|
||||
private String expireDate;
|
||||
private String productDate;
|
||||
private Integer count; //账面数量
|
||||
private Integer reCount; //实际数量
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getSpec() {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void setSpec(String spec) {
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getBatchNo() {
|
||||
return batchNo;
|
||||
}
|
||||
|
||||
public void setBatchNo(String batchNo) {
|
||||
this.batchNo = batchNo;
|
||||
}
|
||||
|
||||
public String getExpireDate() {
|
||||
return expireDate;
|
||||
}
|
||||
|
||||
public void setExpireDate(String expireDate) {
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
|
||||
public String getProductDate() {
|
||||
return productDate;
|
||||
}
|
||||
|
||||
public void setProductDate(String productDate) {
|
||||
this.productDate = productDate;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Integer getReCount() {
|
||||
return reCount;
|
||||
}
|
||||
|
||||
public void setReCount(Integer reCount) {
|
||||
this.reCount = reCount;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,190 @@
|
||||
package com.glxp.api.res.thrsys;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ThrOrderResponse {
|
||||
private Integer id;
|
||||
private String billNo;
|
||||
private String billdate;
|
||||
private String corpId;
|
||||
private String corpName;
|
||||
private String billType;
|
||||
private String billFlag;
|
||||
private String originType;
|
||||
private String locStorageCode;
|
||||
private String invWarehouseCode;//当前分库
|
||||
private String fromSubInvCode; //往来分库
|
||||
|
||||
private String thirdSysFk;
|
||||
|
||||
private List<ThrOrderResponse.SubErpOrder> subErpOrders;
|
||||
|
||||
//增加字段
|
||||
private String startDate; //起始日期
|
||||
private String endDate; //结束日期
|
||||
private String createUser; //创建人
|
||||
private String reviewUser; //审核人
|
||||
private String address; //地址
|
||||
private String linkMan; //联系人
|
||||
private String linkTel; //联系电话
|
||||
private String remark; //备注
|
||||
private String remark1; //备注1
|
||||
private String remark2; //备注2
|
||||
private String remark3; //备注3
|
||||
private String invWarehouseName;
|
||||
private String fromSubInvName;
|
||||
|
||||
public static class SubErpOrder {
|
||||
private Integer id;
|
||||
private String productId;
|
||||
private String productName;
|
||||
private String spec;
|
||||
private String batchNo;
|
||||
private String expireDate;
|
||||
private String productDate;
|
||||
private Integer count; //账面数量
|
||||
private Integer reCount; //实际数量
|
||||
private String orderIdFk;
|
||||
private String thirdSysFk;
|
||||
private String sweepCount;
|
||||
private String relId; //基础信息关联表主键
|
||||
|
||||
private String detailId; //明细ID
|
||||
private String corpName; //往来单位
|
||||
private BigDecimal price; //单价
|
||||
|
||||
public String getDetailId() {
|
||||
return detailId;
|
||||
}
|
||||
|
||||
public void setDetailId(String detailId) {
|
||||
this.detailId = detailId;
|
||||
}
|
||||
|
||||
public String getCorpName() {
|
||||
return corpName;
|
||||
}
|
||||
|
||||
public void setCorpName(String corpName) {
|
||||
this.corpName = corpName;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOrderIdFk() {
|
||||
return orderIdFk;
|
||||
}
|
||||
|
||||
public void setOrderIdFk(String orderIdFk) {
|
||||
this.orderIdFk = orderIdFk;
|
||||
}
|
||||
|
||||
public String getThirdSysFk() {
|
||||
return thirdSysFk;
|
||||
}
|
||||
|
||||
public void setThirdSysFk(String thirdSysFk) {
|
||||
this.thirdSysFk = thirdSysFk;
|
||||
}
|
||||
|
||||
public String getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(String productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
return productName;
|
||||
}
|
||||
|
||||
public void setProductName(String productName) {
|
||||
this.productName = productName;
|
||||
}
|
||||
|
||||
public String getSpec() {
|
||||
return spec;
|
||||
}
|
||||
|
||||
public void setSpec(String spec) {
|
||||
this.spec = spec;
|
||||
}
|
||||
|
||||
public String getBatchNo() {
|
||||
return batchNo;
|
||||
}
|
||||
|
||||
public void setBatchNo(String batchNo) {
|
||||
this.batchNo = batchNo;
|
||||
}
|
||||
|
||||
public String getExpireDate() {
|
||||
return expireDate;
|
||||
}
|
||||
|
||||
public void setExpireDate(String expireDate) {
|
||||
this.expireDate = expireDate;
|
||||
}
|
||||
|
||||
public String getProductDate() {
|
||||
return productDate;
|
||||
}
|
||||
|
||||
public void setProductDate(String productDate) {
|
||||
this.productDate = productDate;
|
||||
}
|
||||
|
||||
public Integer getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(Integer count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public Integer getReCount() {
|
||||
return reCount;
|
||||
}
|
||||
|
||||
public void setReCount(Integer reCount) {
|
||||
this.reCount = reCount;
|
||||
}
|
||||
|
||||
public String getSweepCount() {
|
||||
return sweepCount;
|
||||
}
|
||||
|
||||
public void setSweepCount(String sweepCount) {
|
||||
this.sweepCount = sweepCount;
|
||||
}
|
||||
|
||||
public String getRelId() {
|
||||
return relId;
|
||||
}
|
||||
|
||||
public void setRelId(String relId) {
|
||||
this.relId = relId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrOrderDetailService {
|
||||
|
||||
|
||||
List<ThrOrderDetailEntity> filterThrOrderDetailDetail(FilterThrOrderDetailRequest filterThrOrderDetailRequest);
|
||||
|
||||
boolean insertThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
|
||||
|
||||
boolean insertThrOrderDetails(List<ThrOrderDetailEntity> thrOrderDetailEntities);
|
||||
|
||||
boolean updateThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByOrderIdFk(String id);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
boolean deleteByTime();
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderExportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrOrderExportLogService {
|
||||
|
||||
ThrOrderExportLogEntity selectByGenKey(String genKey);
|
||||
|
||||
List<ThrOrderExportLogEntity> filterThrOrderExportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity);
|
||||
|
||||
boolean updateThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByTime();
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrOrderImportDetailService {
|
||||
|
||||
List<ThrOrderImportDetailEntity> filterOrderImportDetail(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertOrderImportDetail(ThrOrderImportDetailEntity thrOrderImportDetailEntity);
|
||||
|
||||
boolean updateOrderImportDetail(ThrOrderImportDetailEntity thrOrderImportDetailEntity);
|
||||
|
||||
boolean insertOrderImportDetails(List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByTime();
|
||||
|
||||
boolean deleteByGenkey(String genKey);
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrOrderImportLogService {
|
||||
ThrOrderImportLogEntity selectByGenKey(String genKey);
|
||||
|
||||
List<ThrOrderImportLogEntity> filterThrOrderImportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest);
|
||||
|
||||
boolean insertImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity);
|
||||
|
||||
boolean updateImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteByTime();
|
||||
|
||||
void importThrOrder(String genKey);
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.glxp.api.service.thrsys;
|
||||
|
||||
|
||||
|
||||
import com.glxp.api.entity.thrsys.ThrOrderEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderRequest;
|
||||
import com.glxp.api.res.thrsys.ThrErpOrderResponse;
|
||||
import com.glxp.api.res.thrsys.ThrOrderResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ThrOrderService {
|
||||
|
||||
List<ThrOrderEntity> filterThrOrder(FilterThrOrderRequest filterThrOrderRequest);
|
||||
|
||||
List<ThrOrderEntity> filterReceiveOrder(FilterThrOrderRequest filterThrOrderRequest);
|
||||
|
||||
|
||||
List<ThrErpOrderResponse> filterAllOrders(List<String> billNos, String action);
|
||||
|
||||
List<ThrOrderResponse> filterAllDetail(FilterThrOrderRequest filterThrOrderRequest);
|
||||
|
||||
ThrOrderEntity findByUnique(String billNo, String thirdSysFk);
|
||||
|
||||
ThrOrderEntity findReceiveOrder(String billNo);
|
||||
|
||||
ThrOrderEntity findById(String id);
|
||||
|
||||
boolean insertThrOrder(ThrOrderEntity thrCorpEntity);
|
||||
|
||||
boolean insertThrOrders(List<ThrOrderEntity> thrOrderEntities);
|
||||
|
||||
boolean updateThrOrder(ThrOrderEntity thrOrderEntity);
|
||||
|
||||
boolean deleteById(String id);
|
||||
|
||||
boolean deleteAll();
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package com.glxp.api.service.thrsys.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.thrsys.ThrOrderDetailDao;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest;
|
||||
import com.glxp.api.service.thrsys.ThrOrderDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrOrderDetailServiceImpl implements ThrOrderDetailService {
|
||||
|
||||
@Resource
|
||||
ThrOrderDetailDao thrOrderDetailDao;
|
||||
|
||||
@Override
|
||||
public List<ThrOrderDetailEntity> filterThrOrderDetailDetail(FilterThrOrderDetailRequest filterThrOrderDetailRequest) {
|
||||
if (filterThrOrderDetailRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrOrderDetailRequest.getPage() != null) {
|
||||
int offset = (filterThrOrderDetailRequest.getPage() - 1) * filterThrOrderDetailRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrOrderDetailRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderDetailEntity> data = thrOrderDetailDao.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity) {
|
||||
return thrOrderDetailDao.insertThrOrderDetail(thrOrderDetailEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrOrderDetails(List<ThrOrderDetailEntity> thrOrderDetailEntities) {
|
||||
return thrOrderDetailDao.insertThrOrderDetails(thrOrderDetailEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateThrOrderDetail(ThrOrderDetailEntity thrOrderDetailEntity) {
|
||||
return thrOrderDetailDao.updateThrOrderDetail(thrOrderDetailEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrOrderDetailDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByOrderIdFk(String id) {
|
||||
return thrOrderDetailDao.deleteByOrderIdFk(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAll() {
|
||||
return thrOrderDetailDao.deleteAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByTime() {
|
||||
return thrOrderDetailDao.deleteByTime();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.glxp.api.service.thrsys.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.thrsys.ThrOrderExportLogDao;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderExportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import com.glxp.api.service.thrsys.ThrOrderExportLogService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrOrderExportLogServiceImpl implements ThrOrderExportLogService {
|
||||
|
||||
@Resource
|
||||
ThrOrderExportLogDao thrOrderExportLogDao;
|
||||
|
||||
@Override
|
||||
public ThrOrderExportLogEntity selectByGenKey(String genKey) {
|
||||
FilterThrCorpImportLogRequest filterUdiEpLogRequest = new FilterThrCorpImportLogRequest();
|
||||
filterUdiEpLogRequest.setGenKey(genKey);
|
||||
List<ThrOrderExportLogEntity> thrOrderExportLogEntities = thrOrderExportLogDao.filterThrOrderExportLog(filterUdiEpLogRequest);
|
||||
if (thrOrderExportLogEntities != null) {
|
||||
return thrOrderExportLogEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThrOrderExportLogEntity> filterThrOrderExportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest) {
|
||||
if (filterThrCorpImportLogRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrCorpImportLogRequest.getPage() != null) {
|
||||
int offset = (filterThrCorpImportLogRequest.getPage() - 1) * filterThrCorpImportLogRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrCorpImportLogRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderExportLogEntity> data = thrOrderExportLogDao.filterThrOrderExportLog(filterThrCorpImportLogRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity) {
|
||||
return thrOrderExportLogDao.insertThrOrderExportLog(thrOrderExportLogEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateThrOrderExportLog(ThrOrderExportLogEntity thrOrderExportLogEntity) {
|
||||
return thrOrderExportLogDao.updateThrOrderExportLog(thrOrderExportLogEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrOrderExportLogDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByTime() {
|
||||
return thrOrderExportLogDao.deleteByTime();
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.glxp.api.service.thrsys.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.dao.thrsys.ThrOrderImportDetailDao;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import com.glxp.api.service.thrsys.ThrOrderImportDetailService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrOrderImportDetailServiceImpl implements ThrOrderImportDetailService {
|
||||
|
||||
@Resource
|
||||
ThrOrderImportDetailDao thrOrderImportDetailDao;
|
||||
|
||||
@Override
|
||||
public List<ThrOrderImportDetailEntity> filterOrderImportDetail(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest) {
|
||||
if (filterThrCorpImportLogRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrCorpImportLogRequest.getPage() != null) {
|
||||
int offset = (filterThrCorpImportLogRequest.getPage() - 1) * filterThrCorpImportLogRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrCorpImportLogRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderImportDetailEntity> data = thrOrderImportDetailDao.filterOrderdDetailImport(filterThrCorpImportLogRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertOrderImportDetail(ThrOrderImportDetailEntity thrOrderImportDetailEntity) {
|
||||
return thrOrderImportDetailDao.insertOrderdDetailImport(thrOrderImportDetailEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateOrderImportDetail(ThrOrderImportDetailEntity thrOrderImportDetailEntity) {
|
||||
return thrOrderImportDetailDao.updateOrderdDetailImport(thrOrderImportDetailEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertOrderImportDetails(List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities) {
|
||||
return thrOrderImportDetailDao.insertOrderdDetailImports(thrOrderImportDetailEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrOrderImportDetailDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByTime() {
|
||||
return thrOrderImportDetailDao.deleteByTime();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByGenkey(String genKey) {
|
||||
return thrOrderImportDetailDao.deleteByGenkey(genKey);
|
||||
}
|
||||
}
|
@ -0,0 +1,128 @@
|
||||
package com.glxp.api.service.thrsys.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.glxp.api.constant.BasicProcessStatus;
|
||||
import com.glxp.api.dao.thrsys.ThrOrderImportLogDao;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderEntity;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderImportLogEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest;
|
||||
import com.glxp.api.service.thrsys.ThrOrderDetailService;
|
||||
import com.glxp.api.service.thrsys.ThrOrderImportDetailService;
|
||||
import com.glxp.api.service.thrsys.ThrOrderImportLogService;
|
||||
import com.glxp.api.service.thrsys.ThrOrderService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
public class ThrOrderImportLogServiceImpl implements ThrOrderImportLogService {
|
||||
@Resource
|
||||
ThrOrderImportLogDao thrOrderImportLogDao;
|
||||
|
||||
@Resource
|
||||
ThrOrderImportLogService thrOrderImportLogService;
|
||||
@Resource
|
||||
ThrOrderImportDetailService thrOrderImportDetailService;
|
||||
@Resource
|
||||
ThrOrderService thrOrderService;
|
||||
@Resource
|
||||
ThrOrderDetailService thrOrderDetailService;
|
||||
|
||||
@Override
|
||||
public ThrOrderImportLogEntity selectByGenKey(String genKey) {
|
||||
FilterThrCorpImportLogRequest filterThrCorpImportLogRequest = new FilterThrCorpImportLogRequest();
|
||||
filterThrCorpImportLogRequest.setGenKey(genKey);
|
||||
List<ThrOrderImportLogEntity> data = thrOrderImportLogDao.filterThrOrderImportLog(filterThrCorpImportLogRequest);
|
||||
if (data != null && data.size() > 0) {
|
||||
return data.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThrOrderImportLogEntity> filterThrOrderImportLog(FilterThrCorpImportLogRequest filterThrCorpImportLogRequest) {
|
||||
if (filterThrCorpImportLogRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrCorpImportLogRequest.getPage() != null) {
|
||||
int offset = (filterThrCorpImportLogRequest.getPage() - 1) * filterThrCorpImportLogRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrCorpImportLogRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderImportLogEntity> data = thrOrderImportLogDao.filterThrOrderImportLog(filterThrCorpImportLogRequest);
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity) {
|
||||
return thrOrderImportLogDao.insertImportLog(thrOrderImportLogEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateImportLog(ThrOrderImportLogEntity thrOrderImportLogEntity) {
|
||||
return thrOrderImportLogDao.updateImportLog(thrOrderImportLogEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrOrderImportLogDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteByTime() {
|
||||
return thrOrderImportLogDao.deleteByTime();
|
||||
}
|
||||
|
||||
@Async
|
||||
public void importThrOrder(String genKey) {
|
||||
ThrOrderImportLogEntity thrOrderImportLogEntity = thrOrderImportLogService.selectByGenKey(genKey);
|
||||
if (thrOrderImportLogEntity.getStatus() == BasicProcessStatus.UDIINFO_IMPORT_UNPROCESS) {
|
||||
FilterThrCorpImportLogRequest filterUdiIpLogRequest = new FilterThrCorpImportLogRequest();
|
||||
filterUdiIpLogRequest.setGenKey(genKey);
|
||||
List<ThrOrderImportDetailEntity> thrOrderImportDetailEntities = thrOrderImportDetailService.filterOrderImportDetail(filterUdiIpLogRequest);
|
||||
if (thrOrderImportDetailEntities != null && thrOrderImportDetailEntities.size() > 0) {
|
||||
Map<String, List<ThrOrderImportDetailEntity>> map = thrOrderImportDetailEntities.stream().collect(Collectors.groupingBy(ThrOrderImportDetailEntity::getBillNo));
|
||||
for (List<ThrOrderImportDetailEntity> datas : map.values()) {
|
||||
ThrOrderImportDetailEntity thrOrderImportDetailEntity = datas.get(0);
|
||||
ThrOrderEntity thrOrderEntity = new ThrOrderEntity();
|
||||
BeanUtils.copyProperties(thrOrderImportDetailEntity, thrOrderEntity);
|
||||
thrOrderEntity.setUpdateTime(new Date());
|
||||
// BussinessTypeEntity bussinessTypeEntity = bussinessTypeService.findBTByName(thrOrderEntity.getBillType());
|
||||
// if (bussinessTypeEntity != null) {
|
||||
// thrOrderEntity.setBillType(bussinessTypeEntity.getAction());
|
||||
// }
|
||||
thrOrderService.insertThrOrder(thrOrderEntity);
|
||||
thrOrderEntity = thrOrderService.findByUnique(thrOrderEntity.getBillNo(), thrOrderEntity.getThirdSysFk());
|
||||
ThrOrderEntity finalThrOrderEntity = thrOrderEntity;
|
||||
List<ThrOrderDetailEntity> postDatas = datas.stream().map(item ->
|
||||
{
|
||||
ThrOrderDetailEntity thrOrderDetailEntity = new ThrOrderDetailEntity();
|
||||
thrOrderDetailEntity.setUpdateTime(new Date());
|
||||
BeanUtils.copyProperties(item, thrOrderDetailEntity);
|
||||
|
||||
thrOrderDetailEntity.setOrderIdFk(finalThrOrderEntity.getId() + "");
|
||||
return thrOrderDetailEntity;
|
||||
}).collect(Collectors.toList());
|
||||
thrOrderDetailService.insertThrOrderDetails(postDatas);
|
||||
|
||||
}
|
||||
|
||||
thrOrderImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS);
|
||||
thrOrderImportLogService.updateImportLog(thrOrderImportLogEntity);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
package com.glxp.api.service.thrsys.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
|
||||
import com.glxp.api.dao.thrsys.ThrOrderDao;
|
||||
import com.glxp.api.dao.thrsys.ThrOrderDetailDao;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderDetailEntity;
|
||||
import com.glxp.api.entity.thrsys.ThrOrderEntity;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest;
|
||||
import com.glxp.api.req.thrsys.FilterThrOrderRequest;
|
||||
import com.glxp.api.res.thrsys.ThrErpOrderResponse;
|
||||
import com.glxp.api.res.thrsys.ThrOrderResponse;
|
||||
import com.glxp.api.service.thrsys.ThrOrderService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ThrOrderServiceImpl implements ThrOrderService {
|
||||
@Resource
|
||||
private ThrOrderDao thrOrderDao;
|
||||
@Resource
|
||||
private ThrOrderDetailDao thrOrderDetailDao;
|
||||
|
||||
@Override
|
||||
public List<ThrOrderEntity> filterThrOrder(FilterThrOrderRequest filterThrOrderRequest) {
|
||||
if (filterThrOrderRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrOrderRequest.getPage() != null) {
|
||||
int offset = (filterThrOrderRequest.getPage() - 1) * filterThrOrderRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrOrderRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderEntity> data = thrOrderDao.filterThrOrder(filterThrOrderRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThrOrderEntity> filterReceiveOrder(FilterThrOrderRequest filterThrOrderRequest) {
|
||||
if (filterThrOrderRequest == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
if (filterThrOrderRequest.getPage() != null) {
|
||||
int offset = (filterThrOrderRequest.getPage() - 1) * filterThrOrderRequest.getLimit();
|
||||
PageHelper.offsetPage(offset, filterThrOrderRequest.getLimit());
|
||||
}
|
||||
List<ThrOrderEntity> data = thrOrderDao.filterReceiveOrder(filterThrOrderRequest);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ThrErpOrderResponse> filterAllOrders(List<String> billNos, String thirdSys) {
|
||||
List<ThrErpOrderResponse> erpOrderEntities = new ArrayList<>();
|
||||
for (String billNo : billNos) {
|
||||
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
|
||||
filterThrOrderRequest.setBillNo(billNo);
|
||||
filterThrOrderRequest.setThirdSysFk(thirdSys);
|
||||
List<ThrOrderEntity> data = thrOrderDao.filterThrOrder(filterThrOrderRequest);
|
||||
if (data != null && data.size() > 0) {
|
||||
for (ThrOrderEntity thrOrderEntity : data) {
|
||||
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
|
||||
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
|
||||
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailDao.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
if (thrOrderDetailEntities != null && thrOrderDetailEntities.size() > 0) {
|
||||
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
|
||||
ThrErpOrderResponse thrErpOrderResponse = new ThrErpOrderResponse();
|
||||
BeanUtils.copyProperties(thrOrderEntity, thrErpOrderResponse);
|
||||
BeanUtils.copyProperties(thrOrderDetailEntity, thrErpOrderResponse);
|
||||
thrErpOrderResponse.setCompanyid(thrOrderEntity.getCorpId());
|
||||
thrErpOrderResponse.setCompanyname(thrOrderEntity.getCorpName());
|
||||
thrErpOrderResponse.setErpOrderId(thrOrderEntity.getBillNo());
|
||||
thrErpOrderResponse.setIodtlId(thrOrderEntity.getBillNo());
|
||||
thrErpOrderResponse.setErpCount(Integer.valueOf(thrOrderDetailEntity.getCount()));
|
||||
thrErpOrderResponse.setReCount(Integer.valueOf(thrOrderDetailEntity.getReCount()));
|
||||
thrErpOrderResponse.setBatchNo(thrOrderDetailEntity.getBatchNo());
|
||||
thrErpOrderResponse.setGoodsid(thrOrderDetailEntity.getProductId());
|
||||
thrErpOrderResponse.setGoodsname(thrOrderDetailEntity.getProductName());
|
||||
thrErpOrderResponse.setCredate(thrOrderDetailEntity.getProductDate());
|
||||
thrErpOrderResponse.setExpireDate(thrOrderDetailEntity.getExpireDate());
|
||||
thrErpOrderResponse.setPackSpec(thrOrderDetailEntity.getSpec());
|
||||
erpOrderEntities.add(thrErpOrderResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return erpOrderEntities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ThrOrderResponse> filterAllDetail(FilterThrOrderRequest filterThrOrderRequest) {
|
||||
|
||||
List<ThrOrderResponse> erpOrderResponses = new ArrayList<>();
|
||||
List<ThrOrderEntity> data = filterThrOrder(filterThrOrderRequest);
|
||||
if (data != null && data.size() > 0) {
|
||||
for (ThrOrderEntity thrOrderEntity : data) {
|
||||
FilterThrOrderDetailRequest filterThrOrderDetailRequest = new FilterThrOrderDetailRequest();
|
||||
filterThrOrderDetailRequest.setOrderIdFk(thrOrderEntity.getId() + "");
|
||||
List<ThrOrderDetailEntity> thrOrderDetailEntities = thrOrderDetailDao.filterThrOrderDetailDetail(filterThrOrderDetailRequest);
|
||||
ThrOrderResponse erpOrderResponse = new ThrOrderResponse();
|
||||
BeanUtils.copyProperties(thrOrderEntity, erpOrderResponse);
|
||||
List<ThrOrderResponse.SubErpOrder> subErpOrders = new ArrayList<>();
|
||||
if (thrOrderDetailEntities != null && thrOrderDetailEntities.size() > 0) {
|
||||
for (ThrOrderDetailEntity thrOrderDetailEntity : thrOrderDetailEntities) {
|
||||
ThrOrderResponse.SubErpOrder subErpOrder = new ThrOrderResponse.SubErpOrder();
|
||||
BeanUtils.copyProperties(thrOrderDetailEntity, subErpOrder);
|
||||
subErpOrders.add(subErpOrder);
|
||||
}
|
||||
}
|
||||
erpOrderResponse.setSubErpOrders(subErpOrders);
|
||||
erpOrderResponses.add(erpOrderResponse);
|
||||
}
|
||||
}
|
||||
|
||||
return erpOrderResponses;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrOrderEntity findByUnique(String billNo, String thirdSysFk) {
|
||||
|
||||
if (StrUtil.isEmpty(billNo) || StrUtil.isEmpty(thirdSysFk)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
|
||||
filterThrOrderRequest.setBillNo(billNo);
|
||||
filterThrOrderRequest.setThirdSysFk(thirdSysFk);
|
||||
List<ThrOrderEntity> thrOrderEntities = filterThrOrder(filterThrOrderRequest);
|
||||
if (thrOrderEntities != null && thrOrderEntities.size() > 0) {
|
||||
return thrOrderEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrOrderEntity findReceiveOrder(String billNo) {
|
||||
if (StrUtil.isEmpty(billNo)) {
|
||||
return null;
|
||||
}
|
||||
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
|
||||
filterThrOrderRequest.setBillNo(billNo);
|
||||
filterThrOrderRequest.setType(1);
|
||||
List<ThrOrderEntity> thrOrderEntities = filterThrOrder(filterThrOrderRequest);
|
||||
if (thrOrderEntities != null && thrOrderEntities.size() > 0) {
|
||||
return thrOrderEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThrOrderEntity findById(String id) {
|
||||
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
|
||||
filterThrOrderRequest.setId(id);
|
||||
List<ThrOrderEntity> thrOrderEntities = filterThrOrder(filterThrOrderRequest);
|
||||
if (thrOrderEntities != null && thrOrderEntities.size() > 0) {
|
||||
return thrOrderEntities.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrOrder(ThrOrderEntity thrCorpEntity) {
|
||||
return thrOrderDao.insertThrOrder(thrCorpEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertThrOrders(List<ThrOrderEntity> thrOrderEntities) {
|
||||
return thrOrderDao.insertThrOrders(thrOrderEntities);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateThrOrder(ThrOrderEntity thrOrderEntity) {
|
||||
return thrOrderDao.updateThrOrder(thrOrderEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteById(String id) {
|
||||
return thrOrderDao.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteAll() {
|
||||
return thrOrderDao.deleteAll();
|
||||
}
|
||||
}
|
@ -0,0 +1,257 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrOrderDao">
|
||||
|
||||
<select id="filterThrOrder" parameterType="com.glxp.api.req.thrsys.FilterThrOrderRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderEntity">
|
||||
SELECT thr_order.*,basic_bustype_origin.name billTypeName FROM thr_order
|
||||
left join basic_bustype_origin on thr_order.billType = basic_bustype_origin.action
|
||||
<where>
|
||||
<if test="billNo != '' and billNo != null">
|
||||
AND billNo = #{billNo}
|
||||
</if>
|
||||
<if test="id != '' and id !=null">
|
||||
AND thr_order.id = #{id}
|
||||
</if>
|
||||
<if test="billAction != '' and billAction !=null">
|
||||
AND billType = #{billAction}
|
||||
</if>
|
||||
<if test="originType != '' and originType !=null">
|
||||
AND originType = #{originType}
|
||||
</if>
|
||||
<if test="type !=null">
|
||||
AND thr_order.`type` = #{type}
|
||||
</if>
|
||||
<if test="allocateStatus!= null">
|
||||
AND allocateStatus = #{allocateStatus}
|
||||
</if>
|
||||
<if test="billFlag != '' and billFlag !=null">
|
||||
AND billFlag = #{billFlag}
|
||||
</if>
|
||||
<if test="unitIdFk != '' and unitIdFk !=null">
|
||||
AND unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
<if test="corpName != '' and corpName != null">
|
||||
AND corpName like concat('%',#{corpName},'%')
|
||||
</if>
|
||||
<if test="startDate!=null and startDate!=''">
|
||||
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
<if test="endDate!=null and endDate!=''">
|
||||
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
<if test="editStatus!= null">
|
||||
AND editStatus = #{editStatus}
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(thr_order.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY thr_order.updateTime DESC
|
||||
</select>
|
||||
|
||||
<select id="filterReceiveOrder" parameterType="com.glxp.api.req.thrsys.FilterThrOrderRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderEntity">
|
||||
SELECT thr_order.*,basic_bustype_change.originName billTypeName,s1.name as invWarehouseName,s2.name as fromSubInvName FROM thr_order
|
||||
left join basic_bustype_change on thr_order.billType = basic_bustype_change.originAction
|
||||
LEFT JOIN inv_warehouse_sub s1 ON thr_order.invWarehouseCode=s1.`code`
|
||||
LEFT JOIN inv_warehouse_sub s2 ON thr_order.fromSubInvCode=s2.`code`
|
||||
<where>
|
||||
<if test="billNo != '' and billNo != null">
|
||||
AND billNo = #{billNo}
|
||||
</if>
|
||||
<if test="id != '' and id !=null">
|
||||
AND thr_order.id = #{id}
|
||||
</if>
|
||||
<if test="billAction != '' and billAction !=null">
|
||||
AND billType = #{billAction}
|
||||
</if>
|
||||
<if test="originType != '' and originType !=null">
|
||||
AND originType = #{originType}
|
||||
</if>
|
||||
<if test="type !=null">
|
||||
AND thr_order.`type` = #{type}
|
||||
</if>
|
||||
<if test="billFlag != '' and billFlag !=null">
|
||||
AND billFlag = #{billFlag}
|
||||
</if>
|
||||
<if test="unitIdFk != '' and unitIdFk !=null">
|
||||
AND unitIdFk = #{unitIdFk}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
<if test="corpName != '' and corpName != null">
|
||||
AND corpName like concat('%',#{corpName},'%')
|
||||
</if>
|
||||
<if test="startDate!=null and startDate!=''">
|
||||
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
<if test="endDate!=null and endDate!=''">
|
||||
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
||||
</if>
|
||||
<if test="editStatus!= null">
|
||||
AND editStatus = #{editStatus}
|
||||
</if>
|
||||
<if test="thirdPartyDate!= null">
|
||||
AND thirdPartyDate = #{thirdPartyDate}
|
||||
</if>
|
||||
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
|
||||
<![CDATA[ and DATE_FORMAT(thr_order.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
|
||||
</if>
|
||||
<if test="allocateStatus!= null">
|
||||
AND allocateStatus = #{allocateStatus}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY thr_order.updateTime DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertThrOrder" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrOrderEntity">
|
||||
replace
|
||||
INTO thr_order
|
||||
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
|
||||
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
||||
remark3, locStorageCode,editStatus,invWarehouseCode,thirdPartyDate,fromSubInvCode,`type`,allocateStatus)
|
||||
values (
|
||||
#{id},
|
||||
#{billNo},
|
||||
#{billdate},
|
||||
#{corpId},
|
||||
#{corpName},
|
||||
#{billType},
|
||||
#{billFlag},
|
||||
#{thirdSysFk},
|
||||
#{updateTime},
|
||||
#{originType},
|
||||
#{unitIdFk},
|
||||
#{startDate},
|
||||
#{endDate},
|
||||
#{createUser},
|
||||
#{reviewUser},
|
||||
#{address},
|
||||
#{linkMan},
|
||||
#{linkTel},
|
||||
#{remark},
|
||||
#{remark1},
|
||||
#{remark2},
|
||||
#{remark3},
|
||||
#{locStorageCode},
|
||||
#{editStatus},
|
||||
#{invWarehouseCode},
|
||||
#{thirdPartyDate},
|
||||
#{fromSubInvCode},
|
||||
#{type},
|
||||
#{allocateStatus}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="importThrOrder" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrOrderEntity">
|
||||
replace
|
||||
INTO thr_order
|
||||
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType,
|
||||
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
||||
remark3,invWarehouseCode,fromSubInvCode,`type`,allocateStatus)
|
||||
values (
|
||||
#{id},
|
||||
#{billNo},
|
||||
#{billdate},
|
||||
#{corpId},
|
||||
#{corpName},
|
||||
#{billType},
|
||||
#{billFlag},
|
||||
#{thirdSysFk},
|
||||
#{updateTime},
|
||||
#{originType},
|
||||
#{startDate},
|
||||
#{endDate},
|
||||
#{createUser},
|
||||
#{reviewUser},
|
||||
#{address},
|
||||
#{linkMan},
|
||||
#{linkTel},
|
||||
#{remark},
|
||||
#{remark1},
|
||||
#{remark2},
|
||||
#{remark3},
|
||||
#{invWarehouseCode},
|
||||
#{fromSubInvCode},
|
||||
#{type},
|
||||
#{allocateStatus}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertThrOrders" keyProperty="id" parameterType="java.util.List">
|
||||
replace INTO thr_order
|
||||
(billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
|
||||
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
|
||||
remark3,locStorageCode,editStatus,invWarehouseCode,fromSubInvCode,`type`,allocateStatus)
|
||||
values
|
||||
<foreach collection="thrOrderEntities" item="item" index="index"
|
||||
separator=",">
|
||||
(#{item.billNo},
|
||||
#{item.billdate},
|
||||
#{item.corpId},
|
||||
#{item.corpName},
|
||||
#{item.billType},
|
||||
#{item.billFlag},
|
||||
#{item.thirdSysFk}, #{item.updateTime}, #{item.originType}, #{item.unitIdFk},
|
||||
#{item.startDate}, #{item.endDate}, #{item.createUser}, #{item.reviewUser},
|
||||
#{item.address}, #{item.linkMan}, #{item.linkTel}, #{item.remark}, #{item.remark1},
|
||||
#{item.remark2},
|
||||
#{item.remark3},#{item.locStorageCode},#{item.editStatus},#{item.invWarehouseCode},#{item.fromSubInvCode},#{item.type},#{item.allocateStatus}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM thr_order
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAll">
|
||||
DELETE
|
||||
FROM thr_order
|
||||
</delete>
|
||||
|
||||
<update id="updateThrOrder" parameterType="com.glxp.api.entity.thrsys.ThrOrderEntity">
|
||||
UPDATE thr_order
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="billNo != null">billNo=#{billNo},</if>
|
||||
<if test="billdate != null">billdate=#{billdate},</if>
|
||||
<if test="corpId != null">corpId=#{corpId},</if>
|
||||
<if test="corpName != null">corpName=#{corpName},</if>
|
||||
<if test="billType != null">billType=#{billType},</if>
|
||||
<if test="billFlag != null">billFlag=#{billFlag},</if>
|
||||
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="originType != null">originType=#{originType},</if>
|
||||
<if test="startDate != null">startDate=#{startDate},</if>
|
||||
<if test="endDate != null">endDate=#{endDate},</if>
|
||||
<if test="createUser != null">createUser=#{createUser},</if>
|
||||
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
|
||||
<if test="address != null">address=#{address},</if>
|
||||
<if test="linkMan != null">linkMan=#{linkMan},</if>
|
||||
<if test="linkTel != null">linkTel=#{linkTel},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="remark1 != null">remark1=#{remark1},</if>
|
||||
<if test="remark2 != null">remark2=#{remark2},</if>
|
||||
<if test="remark3 != null">remark3=#{remark3},</if>
|
||||
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
||||
<if test="editStatus != null">editStatus=#{editStatus},</if>
|
||||
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
||||
<if test="fromSubInvCode != null">fromSubInvCode=#{fromSubInvCode},</if>
|
||||
<if test="type != null">`type`=#{type},</if>
|
||||
<if test="allocateStatus != null">`allocateStatus`=#{allocateStatus},</if>
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrOrderDetailDao">
|
||||
|
||||
<select id="filterThrOrderDetailDetail" parameterType="com.glxp.api.req.thrsys.FilterThrOrderDetailRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderDetailEntity">
|
||||
SELECT * FROM thr_order_detail
|
||||
<where>
|
||||
<if test="orderIdFk != '' and orderIdFk != null">
|
||||
AND orderIdFk = #{orderIdFk}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertThrOrderDetail" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.thrsys.ThrOrderDetailEntity">
|
||||
replace
|
||||
INTO thr_order_detail
|
||||
(productId, productName, spec, batchNo, expireDate,
|
||||
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
||||
values (
|
||||
#{productId},
|
||||
#{productName},
|
||||
#{spec},
|
||||
#{batchNo},
|
||||
#{expireDate},
|
||||
#{productDate},
|
||||
#{count},
|
||||
#{reCount},
|
||||
#{orderIdFk},
|
||||
#{thirdSysFk},
|
||||
#{updateTime},
|
||||
#{price},
|
||||
#{corpName},
|
||||
#{ylqxzcrbarmc},
|
||||
#{zczbhhzbapzbh},
|
||||
#{manufactory}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="importThrOrderDetail" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.thrsys.ThrOrderDetailEntity">
|
||||
replace
|
||||
INTO thr_order_detail
|
||||
(id,productId, productName, spec, batchNo, expireDate,
|
||||
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
||||
values (
|
||||
#{id},
|
||||
#{productId},
|
||||
#{productName},
|
||||
#{spec},
|
||||
#{batchNo},
|
||||
#{expireDate},
|
||||
#{productDate},
|
||||
#{count},
|
||||
#{reCount},
|
||||
#{orderIdFk},
|
||||
#{thirdSysFk},
|
||||
#{updateTime},
|
||||
#{price},
|
||||
#{corpName},
|
||||
#{ylqxzcrbarmc},
|
||||
#{zczbhhzbapzbh},
|
||||
#{manufactory}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertThrOrderDetails" keyProperty="id" parameterType="java.util.List" useGeneratedKeys="true">
|
||||
replace INTO thr_order_detail
|
||||
(productId, productName, spec, batchNo, expireDate,
|
||||
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime
|
||||
, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
|
||||
values
|
||||
|
||||
<foreach collection="thrOrderDetailEntities" item="item" index="index"
|
||||
separator=",">
|
||||
(#{item.productId}, #{item.productName}, #{item.spec}, #{item.batchNo}, #{item.expireDate},
|
||||
#{item.productDate}, #{item.count}, #{item.reCount}, #{item.orderIdFk}, #{item.thirdSysFk},
|
||||
#{item.updateTime},
|
||||
#{item.price}, #{item.corpName}, #{item.ylqxzcrbarmc}, #{item.zczbhhzbapzbh}, #{item.manufactory})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE
|
||||
FROM thr_order_detail
|
||||
WHERE id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByOrderIdFk" parameterType="Map">
|
||||
DELETE
|
||||
FROM thr_order_detail
|
||||
WHERE orderIdFk = #{orderIdFk}
|
||||
</delete>
|
||||
|
||||
<update id="updateThrOrderDetail" parameterType="com.glxp.api.entity.thrsys.ThrOrderDetailEntity">
|
||||
UPDATE thr_order_detail
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="productId != null">productId=#{productId},</if>
|
||||
<if test="productName != null">productName=#{productName},</if>
|
||||
<if test="spec != null">spec=#{spec},</if>
|
||||
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
||||
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
||||
<if test="productDate != null">productDate=#{productDate},</if>
|
||||
<if test="count != null">count=#{count},</if>
|
||||
<if test="reCount != null">reCount=#{reCount},</if>
|
||||
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
||||
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="price != null">price=#{price},</if>
|
||||
<if test="corpName != null">corpName=#{corpName},
|
||||
</if>
|
||||
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
|
||||
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
|
||||
<if test="manufactory != null">manufactory=#{manufactory},</if>
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAll">
|
||||
DELETE
|
||||
FROM thr_order_detail
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByTime">
|
||||
Delete From thr_order_detail
|
||||
where date(updateTime) <= date(DATE_SUB(NOW(),INTERVAL 30 day))
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrOrderExportLogDao">
|
||||
|
||||
<select id="filterThrOrderExportLog" parameterType="com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
|
||||
SELECT * FROM thr_order_export_log
|
||||
<where>
|
||||
<if test="genKey != '' and genKey != null">
|
||||
AND genKey = #{genKey}
|
||||
</if>
|
||||
<if test="status != '' and status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="type != '' and type != null">
|
||||
AND `type` = #{type}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY updateTime DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertThrOrderExportLog" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
|
||||
insert INTO thr_order_export_log
|
||||
(genKey,updateTime,dlCount,status,filePath,remark,`type`)
|
||||
values
|
||||
(
|
||||
#{genKey},
|
||||
#{updateTime},
|
||||
#{dlCount},#{status},#{filePath},#{remark},#{type}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE FROM thr_order_export_log WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateThrOrderExportLog" parameterType="com.glxp.api.entity.thrsys.ThrOrderExportLogEntity">
|
||||
UPDATE thr_order_export_log
|
||||
<set>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="dlCount != null">dlCount=#{dlCount},</if>
|
||||
<if test="status != null">status=#{status},</if>
|
||||
<if test="filePath != null">filePath=#{filePath},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
</set>
|
||||
WHERE genKey = #{genKey}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByTime">
|
||||
Delete From thr_order_export_log
|
||||
where date(updateTime) <= date(DATE_SUB(NOW(),INTERVAL 30 day))
|
||||
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrOrderImportDetailDao">
|
||||
|
||||
<select id="filterOrderdDetailImport" parameterType="com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity">
|
||||
SELECT * FROM thr_order_import_detail
|
||||
<where>
|
||||
<if test="genKey != '' and genKey != null">
|
||||
AND genKeyFk = #{genKey}
|
||||
</if>
|
||||
<if test="id != '' and id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="status != '' and status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertOrderdDetailImport" keyProperty="id"
|
||||
parameterType="com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity">
|
||||
insert INTO thr_order_import_detail
|
||||
(
|
||||
billNo,billdate,corpId,corpName,billType,billFlag,productId,productName,spec,batchNo,expireDate,
|
||||
productDate,count,reCount,status,updateTime,remark,genKeyFk,thirdSysFk,originType
|
||||
)
|
||||
values
|
||||
(
|
||||
#{billNo},#{billdate},#{corpId},#{corpName},#{billType},#{billFlag},#{productId},#{productName},#{spec},
|
||||
#{batchNo},#{expireDate},#{productDate},#{count},#{reCount},#{status},#{updateTime},#{remark},#{genKeyFk},#{thirdSysFk},#{originType}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertOrderdDetailImports" keyProperty="id" parameterType="java.util.List">
|
||||
insert INTO thr_order_import_detail
|
||||
(
|
||||
billNo,billdate,corpId,corpName,billType,billFlag,productId,productName,spec,
|
||||
batchNo,expireDate,productDate,count,reCount,status,updateTime,remark,genKeyFk,thirdSysFk,originType
|
||||
)
|
||||
values
|
||||
<foreach collection="orders" item="item" index="index"
|
||||
separator=",">
|
||||
(
|
||||
#{item.billNo},#{item.billdate},#{item.corpId},#{item.corpName},#{item.billType},
|
||||
#{item.billFlag},#{item.productId},#{item.productName},#{item.spec},#{item.batchNo},#{item.expireDate},#{item.productDate},
|
||||
#{item.count},#{item.reCount},#{item.status},#{item.updateTime},#{item.remark},#{item.genKeyFk},#{item.thirdSysFk},#{item.originType}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE FROM thr_order_import_detail WHERE id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteByGenkey" parameterType="Map">
|
||||
DELETE FROM thr_order_import_detail WHERE genKeyFk = #{genKey}
|
||||
</delete>
|
||||
|
||||
<update id="updateOrderdDetailImport" parameterType="com.glxp.api.entity.thrsys.ThrOrderImportDetailEntity">
|
||||
UPDATE thr_order_import_detail
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="billNo != null">billNo=#{billNo},</if>
|
||||
<if test="billdate != null">billdate=#{billdate},</if>
|
||||
<if test="corpId != null">corpId=#{corpId},</if>
|
||||
<if test="corpName != null">corpName=#{corpName},</if>
|
||||
<if test="billType != null">billType=#{billType},</if>
|
||||
<if test="billFlag != null">billFlag=#{billFlag},</if>
|
||||
<if test="productId != null">productId=#{productId},</if>
|
||||
<if test="productName != null">productName=#{productName},</if>
|
||||
<if test="spec != null">spec=#{spec},</if>
|
||||
<if test="expireDate != null">expireDate=#{expireDate},</if>
|
||||
<if test="batchNo != null">batchNo=#{batchNo},</if>
|
||||
<if test="productDate != null">productDate=#{productDate},</if>
|
||||
<if test="count != null">count=#{count},</if>
|
||||
<if test="reCount != null">reCount=#{reCount},</if>
|
||||
<if test="status != null">status=#{status},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="genKeyFk != null">genKeyFk=#{genKeyFk},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||||
<if test="originType != null">originType=#{originType},</if>
|
||||
|
||||
|
||||
</trim>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteByTime">
|
||||
Delete From thr_order_import_detail
|
||||
where date(updateTime) <= date(DATE_SUB(NOW(),INTERVAL 30 day))
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
|
||||
<mapper namespace="com.glxp.api.dao.thrsys.ThrOrderImportLogDao">
|
||||
|
||||
<select id="filterThrOrderImportLog" parameterType="com.glxp.api.req.thrsys.FilterThrCorpImportLogRequest"
|
||||
resultType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
|
||||
SELECT * FROM thr_order_import_log
|
||||
<where>
|
||||
<if test="genKey != '' and genKey != null">
|
||||
AND genKey = #{genKey}
|
||||
</if>
|
||||
<if test="id != '' and id != null">
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="status != '' and status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="thirdSysFk != '' and thirdSysFk != null">
|
||||
AND thirdSysFk = #{thirdSysFk}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY updateTime DESC
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertImportLog" keyProperty="id" parameterType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
|
||||
insert INTO thr_order_import_log
|
||||
(genKey,fromType,updateTime,thirdSysFk,status)
|
||||
values
|
||||
(
|
||||
#{genKey},
|
||||
#{fromType},
|
||||
#{updateTime},
|
||||
#{thirdSysFk},#{status}
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
<delete id="deleteById" parameterType="Map">
|
||||
DELETE FROM thr_order_import_log WHERE id = #{id}
|
||||
</delete>
|
||||
|
||||
<update id="updateImportLog" parameterType="com.glxp.api.entity.thrsys.ThrOrderImportLogEntity">
|
||||
UPDATE thr_order_import_log
|
||||
<set>
|
||||
<if test="genKey != null">genKey=#{genKey},</if>
|
||||
<if test="fromType != null">fromType=#{fromType},</if>
|
||||
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
||||
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
||||
<if test="status != null">status=#{status},</if>
|
||||
<if test="remark != null">remark=#{remark},</if>
|
||||
</set>
|
||||
WHERE genKey = #{genKey}
|
||||
</update>
|
||||
|
||||
<delete id="deleteByTime">
|
||||
Delete From thr_order_import_log
|
||||
where date(updateTime) <= date(DATE_SUB(NOW(),INTERVAL 30 day))
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue