Merge branch 'dev' into test

pro
wj 2 years ago
commit 26473b3658

@ -560,7 +560,9 @@ public class IoOrderDetailBizController extends BaseController {
@Log(title = "发票管理", businessType = BusinessType.DELETE) @Log(title = "发票管理", businessType = BusinessType.DELETE)
public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) { public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) {
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
IoOrderInvoiceResponse ioOrderInvoiceResponse = orderDetailBizService.selectByinvoiceId(ioOrderInvoiceEntity.getId());
//更改 登记状态 //更改 登记状态
IoOrderDetailCodeEntity ioOrderDetailBizEntity = new IoOrderDetailCodeEntity(); IoOrderDetailCodeEntity ioOrderDetailBizEntity = new IoOrderDetailCodeEntity();
@ -570,10 +572,11 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk()); ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk());
ioOrderDetailBizEntity.setId(ioOrderInvoiceEntity.getRegId()); ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().intValue());
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest); List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest);
if(list == null && list.size()==0){ if(list.size()==0){
ioOrderDetailBizEntity.setRegStatus(false); ioOrderDetailBizEntity.setRegStatus(false);
} }
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity); orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);

@ -13,6 +13,7 @@ import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.*; import com.glxp.api.constant.*;
import com.glxp.api.constant.Constant;
import com.glxp.api.dao.auth.*; import com.glxp.api.dao.auth.*;
import com.glxp.api.dao.basic.*; import com.glxp.api.dao.basic.*;
import com.glxp.api.dao.inout.*; import com.glxp.api.dao.inout.*;
@ -26,6 +27,7 @@ import com.glxp.api.entity.inout.*;
import com.glxp.api.entity.purchase.*; import com.glxp.api.entity.purchase.*;
import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity; import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.SyncDataBustypeEntity;
import com.glxp.api.entity.system.*; import com.glxp.api.entity.system.*;
import com.glxp.api.entity.thrsys.*; import com.glxp.api.entity.thrsys.*;
import com.glxp.api.req.sync.SpsSyncDataRequest; import com.glxp.api.req.sync.SpsSyncDataRequest;
@ -42,10 +44,8 @@ import com.glxp.api.service.purchase.PurOrderService;
import com.glxp.api.service.sync.BasicDownloadService; import com.glxp.api.service.sync.BasicDownloadService;
import com.glxp.api.service.sync.BasicExportService; import com.glxp.api.service.sync.BasicExportService;
import com.glxp.api.service.sync.SpsSyncDownloadService; import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.service.sync.SyncDataBustypeService;
import com.glxp.api.util.DateUtil; import com.glxp.api.util.*;
import com.glxp.api.util.FileUtils;
import com.glxp.api.util.JsonUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -606,6 +606,8 @@ public class SpsSyncDownloadController {
IBasicBussinessTypeService basicBussinessTypeService; IBasicBussinessTypeService basicBussinessTypeService;
@Resource @Resource
InvWarehouseService invWarehouseService; InvWarehouseService invWarehouseService;
@Resource
SyncDataBustypeService syncDataBustypeService;
//接收中继服务、UDI管理系统上传单据 //接收中继服务、UDI管理系统上传单据
@AuthRuleAnnotation("sps/sync/order/upload") @AuthRuleAnnotation("sps/sync/order/upload")
@ -624,10 +626,21 @@ public class SpsSyncDownloadController {
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) { if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities(); List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
for (IoOrderEntity orderEntity : orderEntities) { for (IoOrderEntity orderEntity : orderEntities) {
SyncDataBustypeEntity syncDataBustypeEntity = syncDataBustypeService.findByAction(orderEntity.getAction(), 2);
orderEntity.setUpdateTime(null); orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP); orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST); orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS); orderEntity.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
if (syncDataBustypeEntity != null) {
if (IntUtil.value(syncDataBustypeEntity.getSyncStatus()) == 1) {
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_DRAFT);
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);
}
if (syncDataBustypeEntity.isSyncChange()) {
orderEntity.setOutChangeEnable(syncDataBustypeEntity.isSyncChange());
}
}
IoOrderEntity temp = orderService.findById(orderEntity.getBillNo()); IoOrderEntity temp = orderService.findById(orderEntity.getBillNo());
@ -712,10 +725,12 @@ public class SpsSyncDownloadController {
} }
orderEntity = orderService.findByBillNo(orderEntity.getBillNo()); orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
addInoutService.dealProcess(orderEntity); if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_TEMP_SAVE) {
orderEntity = orderService.findByBillNo(orderEntity.getBillNo()); addInoutService.dealProcess(orderEntity);
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATS_ERROR && !ioCheckInoutService.checkManual(orderEntity.getBillNo())) { orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
ioCheckInoutService.check(orderEntity.getBillNo()); if (orderEntity.getStatus() != ConstantStatus.ORDER_STATS_ERROR && !ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
}
} }
} }
} }

@ -24,6 +24,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus<IoOrderDetailBizDao,
List<IoOrderDetailCodeResponse> getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest); List<IoOrderDetailCodeResponse> getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest);
List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest); List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest);
IoOrderInvoiceResponse selectByinvoiceId(Long id);
/** /**
* *

@ -408,4 +408,8 @@ public class BasicBussinessTypeEntity {
private boolean advancePreIn; private boolean advancePreIn;
@TableField(value = "sortNum") @TableField(value = "sortNum")
private Integer sortNum; private Integer sortNum;
//是否按货位出库 0不按货位出库1:按货位出库
@TableField(value = "spaceOut")
private int spaceOut;
} }

@ -138,13 +138,13 @@ public class IoOrderDetailCodeEntity {
* *
*/ */
@TableField(value = "`count`") @TableField(value = "`count`")
private int count; private Integer count;
/** /**
* *
*/ */
@TableField(value = "reCount") @TableField(value = "reCount")
private int reCount; private Integer reCount;
/** /**
* *

@ -24,4 +24,9 @@ public class SyncDataBustypeEntity {
private Integer orderStatus; //单据状态 private Integer orderStatus; //单据状态
@TableField(value = "`direct`") @TableField(value = "`direct`")
private int direct; //1:UDI管理系统->SPMS 2:SPMS->UDI管理系统 private int direct; //1:UDI管理系统->SPMS 2:SPMS->UDI管理系统
@TableField(value = "`syncStatus`")
private Integer syncStatus; //同步后单据状态
@TableField(value = "`syncChange`")
private boolean syncChange; //同步后是否自动补单
} }

@ -53,18 +53,18 @@ public class IdcController {
@RequestParam("content") String content, @RequestParam("content") String content,
@RequestParam(value = "files", required = false) MultipartFile[] files) { @RequestParam(value = "files", required = false) MultipartFile[] files) {
// //
return idcService.receive( request, content, files); return idcService.receive(request, content, files);
} }
@RequestMapping(value = "/spssync/common/once") @RequestMapping(value = "/spssync/common/once")
@ResponseBody @ResponseBody
public BaseResponse once(HttpServletRequest request,@RequestBody Map<String, Object> params) { public BaseResponse once(HttpServletRequest request, @RequestBody Map<String, Object> params) {
// //
boolean isUpload = params.get("isUpload")!=null && params.get("isUpload").equals("1") ? true : false ; boolean isUpload = params.get("isUpload") != null && params.get("isUpload").equals("1") ? true : false;
return idcService.onceSync( params.get("tableName").toString(), isUpload); return idcService.onceSync(params.get("tableName").toString(), isUpload);
} }
//@Log("数据同步测试") //@Log("数据同步测试")
@RequestMapping(value = "/spssync/common/test") @RequestMapping(value = "/spssync/common/test")
public BaseResponse test(HttpServletRequest request, @RequestBody Map<String, Object> params) { public BaseResponse test(HttpServletRequest request, @RequestBody Map<String, Object> params) {
@ -85,17 +85,19 @@ public class IdcController {
public BaseResponse download(HttpServletRequest request, @RequestBody Map<String, Object> params) { public BaseResponse download(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return idcService.download(request, params); return idcService.download(request, params);
} }
@RequestMapping(value = "/spssync/common/uploadStatus") @RequestMapping(value = "/spssync/common/uploadStatus")
@ResponseBody @ResponseBody
public BaseResponse uploadStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) { public BaseResponse uploadStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return idcService.uploadStatus(request, params); return idcService.uploadStatus(request, params);
} }
@RequestMapping(value = "/spssync/common/downloadStatus") @RequestMapping(value = "/spssync/common/downloadStatus")
@ResponseBody @ResponseBody
public BaseResponse downloadStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) { public BaseResponse downloadStatus(HttpServletRequest request, @RequestBody Map<String, Object> params) {
return idcService.downloadStatus(request, params); return idcService.downloadStatus(request, params);
} }
//@Log("数据同步任务根据任务ID,返回下载成功标记") //@Log("数据同步任务根据任务ID,返回下载成功标记")
@RequestMapping(value = "/spssync/common/success") @RequestMapping(value = "/spssync/common/success")
@ResponseBody @ResponseBody
@ -104,15 +106,15 @@ public class IdcController {
} }
@RequestMapping(value = "/spssync/common/downloadFile") @RequestMapping(value = "/spssync/common/downloadFile")
public void downloadFile(HttpServletResponse response,@RequestParam String fileName) throws UnsupportedEncodingException { public void downloadFile(HttpServletResponse response, @RequestParam String fileName) throws UnsupportedEncodingException {
if (fileName != null) { if (fileName != null) {
response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8")); response.setHeader("Content-disposition", "attachment; filename=" + URLEncoder.encode(fileName, "UTF-8"));
response.setContentType("application/force-download"); response.setContentType("application/force-download");
idcService.downloadFile(fileName, response); idcService.downloadFile(fileName, response);
} }
} }
@RequestMapping("/mapi/**") @RequestMapping("/mapi/**")
public Object mapi(HttpServletRequest request, HttpServletResponse httpServletResponse) { public Object mapi(HttpServletRequest request, HttpServletResponse httpServletResponse) {
String uri = parseUri(request.getRequestURL().toString()); String uri = parseUri(request.getRequestURL().toString());

@ -13,4 +13,5 @@ public class BasicExportStatusRequest extends ListPageRequest {
public Integer createType; public Integer createType;
private String syncTime; private String syncTime;
private String receiveStatus; private String receiveStatus;
private String orderBy;
} }

@ -152,4 +152,7 @@ public class BasicBussinessTypeResponse {
private String checkPreInOrders; private String checkPreInOrders;
private Boolean advancePreIn; private Boolean advancePreIn;
private Integer sortNum; private Integer sortNum;
private int spaceOut;
} }

@ -86,6 +86,7 @@ public class IoOrderInvoiceResponse {
private String ggxh; private String ggxh;
private String licenseUrl; private String licenseUrl;
private Long bizIdFk;
public static final String COL_ID = "id"; public static final String COL_ID = "id";

@ -59,7 +59,7 @@ public class InvSpaceServiceImpl implements InvSpaceService {
//获取当前仓库下的最大货位编码 //获取当前仓库下的最大货位编码
String maxSpaceCode = invSpaceDao.getMaxSpaceCode(null); String maxSpaceCode = invSpaceDao.getMaxSpaceCode(null);
if (StrUtil.isBlank(maxSpaceCode)) { if (StrUtil.isBlank(maxSpaceCode)) {
maxSpaceCode = "0000"; maxSpaceCode = "1000";
} }
String spaceCode = getSpaceCode(maxSpaceCode); String spaceCode = getSpaceCode(maxSpaceCode);
invSpace.setCode(spaceCode); invSpace.setCode(spaceCode);

@ -85,7 +85,9 @@ public class IoChangeInoutService {
//普通出入库单据流转 //普通出入库单据流转
public void genNewOrder(IoOrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities) { public void genNewOrder(IoOrderEntity orderEntity, List<InvProductDetailEntity> invProductDetailEntities) {
if (orderEntity.getFromType() == ConstantStatus.FROM_UDISP && (orderEntity.getOutChangeEnable() != null && !orderEntity.getOutChangeEnable())) {
return;
}
BasicBusTypePreEntity basicBusTypePreEntity = basicBusTypePreService.findByOriginAction(orderEntity.getAction()); BasicBusTypePreEntity basicBusTypePreEntity = basicBusTypePreService.findByOriginAction(orderEntity.getAction());
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderEntity.getBillNo()); List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderEntity.getBillNo());
if (basicBusTypePreEntity.getSupplementAll()) {//全量补单 if (basicBusTypePreEntity.getSupplementAll()) {//全量补单

@ -43,6 +43,7 @@ public interface IoOrderDetailBizService {
List<IoOrderDetailBizEntity> checkOrderList(String orderId); List<IoOrderDetailBizEntity> checkOrderList(String orderId);
List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest); List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest);
IoOrderInvoiceResponse selectByinvoiceId(Long id);
Boolean updateOrderDetailBiz(IoOrderDetailBizEntity ioOrderDetailBizEntity); Boolean updateOrderDetailBiz(IoOrderDetailBizEntity ioOrderDetailBizEntity);

@ -178,6 +178,11 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
return ioOrderDetailBizDao.filterListInv(orderDetailBizRequest); return ioOrderDetailBizDao.filterListInv(orderDetailBizRequest);
} }
@Override
public IoOrderInvoiceResponse selectByinvoiceId(Long id) {
return ioOrderDetailBizDao.selectByinvoiceId(id);
}
@Override @Override
public Boolean updateOrderDetailBiz(IoOrderDetailBizEntity ioOrderDetailBizEntity) { public Boolean updateOrderDetailBiz(IoOrderDetailBizEntity ioOrderDetailBizEntity) {
return ioOrderDetailBizDao.updateById(ioOrderDetailBizEntity) > 0; return ioOrderDetailBizDao.updateById(ioOrderDetailBizEntity) > 0;

@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
@ -140,7 +141,8 @@ public class IoOrderServiceImpl implements IoOrderService {
@Override @Override
public List<IoOrderEntity> findByStatus(String action, Integer status, Date lastUpdateTime) { public List<IoOrderEntity> findByStatus(String action, Integer status, Date lastUpdateTime) {
return orderDao.selectList(new QueryWrapper<IoOrderEntity>().eq("action", action).eq("status", status).gt("updateTime", lastUpdateTime)); return orderDao.selectList(Wrappers.lambdaQuery(IoOrderEntity.class).eq(IoOrderEntity::getAction, action).eq(IoOrderEntity::getStatus, status)
.between(IoOrderEntity::getUpdateTime, lastUpdateTime, cn.hutool.core.date.DateUtil.date()));
} }
@ -721,7 +723,9 @@ public class IoOrderServiceImpl implements IoOrderService {
//查询往来单位名称 //查询往来单位名称
if (StrUtil.isNotBlank(order.getFromCorp())) { if (StrUtil.isNotBlank(order.getFromCorp())) {
BasicCorpEntity corpEntity = basicCorpDao.selectByErpId(order.getFromCorp()); BasicCorpEntity corpEntity = basicCorpDao.selectByErpId(order.getFromCorp());
response.setFromCorpName(corpEntity.getName()); if (corpEntity != null)
response.setFromCorpName(corpEntity.getName());
} else if (StrUtil.isNotBlank(order.getFromInvCode())) { } else if (StrUtil.isNotBlank(order.getFromInvCode())) {
String fromInvName = invWarehouseDao.selectNameByCode(order.getFromInvCode()); String fromInvName = invWarehouseDao.selectNameByCode(order.getFromInvCode());
response.setFromCorpName(fromInvName); response.setFromCorpName(fromInvName);

@ -200,11 +200,11 @@ public class SpsSyncDownloadService {
} }
break; break;
case DOCUMENT_TYPE_DATA: case DOCUMENT_TYPE_DATA:
if (needExec(info.getTypeBus(), info.getTypeScan(), info.getTypeThird())) { // if (needExec(info.getTypeBus(), info.getTypeScan(), info.getTypeThird())) {
basicExportInfoCreate(exportType, now // basicExportInfoCreate(exportType, now
, x -> x.generateDocumentTypeDataFile(info, now, false, syncTime) // , x -> x.generateDocumentTypeDataFile(info, now, false, syncTime)
, x -> x.generateDocumentTypeDataFile(info, now, true, syncTime)); // , x -> x.generateDocumentTypeDataFile(info, now, true, syncTime));
} // }
break; break;
} }
} }
@ -286,20 +286,19 @@ public class SpsSyncDownloadService {
StringBuffer remark = new StringBuffer(); StringBuffer remark = new StringBuffer();
Map<String, Object> syncTimeMap = new WeakHashMap<>(3); Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true); syncTimeMap.put("isNew", true);
boolean ge = false;
if (syncTime != null) {
ge = true;
}
try { try {
//确认有开启物资字典由外向内同步 //确认有开启物资字典由外向内同步
if (needExec(info.getBasicProducts())) { if (needExec(info.getBasicProducts())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_PRODUCTS, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_PRODUCTS, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_PRODUCTS, map); totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_PRODUCTS, map);
List<BasicHospTypeEntity> hospTypeList = hospTypeService.list(Wrappers.lambdaQuery(BasicHospTypeEntity.class) List<BasicHospTypeEntity> hospTypeList = hospTypeService.list(Wrappers.lambdaQuery(BasicHospTypeEntity.class)
.le((boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime .between(ge, BasicHospTypeEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), BasicHospTypeEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(hospTypeList)) { if (CollectionUtil.isNotEmpty(hospTypeList)) {
@ -307,8 +306,9 @@ public class SpsSyncDownloadService {
remark.append("物资字典分类信息:").append(hospTypeList.size()).append("条\n"); remark.append("物资字典分类信息:").append(hospTypeList.size()).append("条\n");
} }
List<UdiRelevanceEntity> udiRelevanceList = udiRelevanceService.list(Wrappers.lambdaQuery(UdiRelevanceEntity.class) List<UdiRelevanceEntity> udiRelevanceList = udiRelevanceService.list(Wrappers.lambdaQuery(UdiRelevanceEntity.class)
.le((boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime .between(ge, UdiRelevanceEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), UdiRelevanceEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(udiRelevanceList)) { if (CollectionUtil.isNotEmpty(udiRelevanceList)) {
@ -316,8 +316,9 @@ public class SpsSyncDownloadService {
remark.append("物资字典主表信息:").append(udiRelevanceList.size()).append("条\n"); remark.append("物资字典主表信息:").append(udiRelevanceList.size()).append("条\n");
} }
List<BasicProductsEntity> productsList = basicProductsDao.selectList(Wrappers.lambdaQuery(BasicProductsEntity.class) List<BasicProductsEntity> productsList = basicProductsDao.selectList(Wrappers.lambdaQuery(BasicProductsEntity.class)
.le((boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime .between(ge, BasicProductsEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), BasicProductsEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(productsList)) { if (CollectionUtil.isNotEmpty(productsList)) {
@ -325,8 +326,9 @@ public class SpsSyncDownloadService {
jsonMap.put(BasicProductsEntity.class.getSimpleName(), productsList); jsonMap.put(BasicProductsEntity.class.getSimpleName(), productsList);
} }
List<CompanyProductRelevanceEntity> relevanceList = relevanceService.list(Wrappers.lambdaQuery(CompanyProductRelevanceEntity.class) List<CompanyProductRelevanceEntity> relevanceList = relevanceService.list(Wrappers.lambdaQuery(CompanyProductRelevanceEntity.class)
.le((boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime .between(ge, CompanyProductRelevanceEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), CompanyProductRelevanceEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(relevanceList)) { if (CollectionUtil.isNotEmpty(relevanceList)) {
@ -336,17 +338,12 @@ public class SpsSyncDownloadService {
} }
//确认有开启往来单位字典同步 //确认有开启往来单位字典同步
if (needExec(info.getBasicCorp())) { if (needExec(info.getBasicCorp())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_CORP, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_CORP, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_CORP, map); totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_CORP, map);
List<BasicCorpEntity> corpList = corpService.list(Wrappers.lambdaQuery(BasicCorpEntity.class) List<BasicCorpEntity> corpList = corpService.list(Wrappers.lambdaQuery(BasicCorpEntity.class)
.le((boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime .between(ge, BasicCorpEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), BasicCorpEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(corpList)) { if (CollectionUtil.isNotEmpty(corpList)) {
@ -357,18 +354,13 @@ public class SpsSyncDownloadService {
//确认有开启首营资质同步 //确认有开启首营资质同步
if (needExec(info.getSupCert())) { if (needExec(info.getSupCert())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.SUP_CERT, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.SUP_CERT, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map); totalTimeMap.put(BasicExportStatusTimeEnum.SUP_CERT, map);
List<SupCertEntity> supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class) List<SupCertEntity> supCertList = supCertService.list(Wrappers.lambdaQuery(SupCertEntity.class)
.le((boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now)
.eq(SupCertEntity::getAuditStatus, ConstantStatus.AUDIT_PASS) .eq(SupCertEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupCertEntity::getUpdateTime .le(!ge && (boolean) map.get("isNew"), SupCertEntity::getUpdateTime, now)
.between(ge, SupCertEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupCertEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(supCertList)) { if (CollectionUtil.isNotEmpty(supCertList)) {
@ -383,8 +375,9 @@ public class SpsSyncDownloadService {
} }
} }
List<SupCertSetEntity> supCertSetList = supCertSetService.list(Wrappers.lambdaQuery(SupCertSetEntity.class) List<SupCertSetEntity> supCertSetList = supCertSetService.list(Wrappers.lambdaQuery(SupCertSetEntity.class)
.le((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime .between(ge, SupCertSetEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(supCertSetList)) { if (CollectionUtil.isNotEmpty(supCertSetList)) {
@ -392,9 +385,10 @@ public class SpsSyncDownloadService {
jsonMap.put(SupCertSetEntity.class.getSimpleName(), supCertSetList); jsonMap.put(SupCertSetEntity.class.getSimpleName(), supCertSetList);
} }
List<SupCompanyEntity> supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class) List<SupCompanyEntity> supCompanyList = supCompanyService.list(Wrappers.lambdaQuery(SupCompanyEntity.class)
.le((boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now)
.eq(SupCompanyEntity::getAuditStatus, ConstantStatus.AUDIT_PASS) .eq(SupCompanyEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime .le(!ge && (boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime, now)
.between(ge, SupCompanyEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupCompanyEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(supCompanyList)) { if (CollectionUtil.isNotEmpty(supCompanyList)) {
@ -403,7 +397,9 @@ public class SpsSyncDownloadService {
} }
List<SupManufacturerEntity> supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class) List<SupManufacturerEntity> supManufacturerList = supManufacturerService.list(Wrappers.lambdaQuery(SupManufacturerEntity.class)
.eq(SupManufacturerEntity::getAuditStatus, ConstantStatus.AUDIT_PASS) .eq(SupManufacturerEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.between(!(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime .le(!ge && (boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime, now)
.between(ge, SupManufacturerEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupManufacturerEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(supManufacturerList)) { if (CollectionUtil.isNotEmpty(supManufacturerList)) {
@ -412,8 +408,9 @@ public class SpsSyncDownloadService {
} }
List<SupProductEntity> supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class) List<SupProductEntity> supProductList = supProductService.list(Wrappers.lambdaQuery(SupProductEntity.class)
.eq(SupProductEntity::getAuditStatus, ConstantStatus.AUDIT_PASS) .eq(SupProductEntity::getAuditStatus, ConstantStatus.AUDIT_PASS)
.le((boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), SupProductEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), SupProductEntity::getUpdateTime .between(ge, SupProductEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), SupProductEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(supProductList)) { if (CollectionUtil.isNotEmpty(supProductList)) {
@ -479,20 +476,19 @@ public class SpsSyncDownloadService {
Map<BasicExportStatusTimeEnum, Map<String, Object>> totalTimeMap = new WeakHashMap<>(10); Map<BasicExportStatusTimeEnum, Map<String, Object>> totalTimeMap = new WeakHashMap<>(10);
Map<String, Object> syncTimeMap = new WeakHashMap<>(3); Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true); syncTimeMap.put("isNew", true);
boolean ge = false;
if (syncTime != null) {
ge = true;
}
try { try {
//确认有开启物资字典由外向内同步 //确认有开启物资字典由外向内同步
if (info.getUdiCodeLost() == 2) { if (info.getUdiCodeLost() == 2) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.IO_CODE_LOST, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.IO_CODE_LOST, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.IO_CODE_LOST, map); totalTimeMap.put(BasicExportStatusTimeEnum.IO_CODE_LOST, map);
List<IoCodeLostEntity> ioCodeLostList = ioCodeLostService.list(Wrappers.lambdaQuery(IoCodeLostEntity.class) List<IoCodeLostEntity> ioCodeLostList = ioCodeLostService.list(Wrappers.lambdaQuery(IoCodeLostEntity.class)
.le((boolean) map.get("isNew"), IoCodeLostEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), IoCodeLostEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), IoCodeLostEntity::getUpdateTime .between(ge, IoCodeLostEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), IoCodeLostEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(ioCodeLostList)) { if (CollectionUtil.isNotEmpty(ioCodeLostList)) {
@ -502,17 +498,12 @@ public class SpsSyncDownloadService {
} }
//确认有开启udi关联关系同步 //确认有开启udi关联关系同步
if (info.getUdiCodeRel() == 2) { if (info.getUdiCodeRel() == 2) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.IO_CODE_REL, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.IO_CODE_REL, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.IO_CODE_REL, map); totalTimeMap.put(BasicExportStatusTimeEnum.IO_CODE_REL, map);
List<IoCodeRelEntity> ioCodeRelList = ioCodeRelService.list(Wrappers.lambdaQuery(IoCodeRelEntity.class) List<IoCodeRelEntity> ioCodeRelList = ioCodeRelService.list(Wrappers.lambdaQuery(IoCodeRelEntity.class)
.le((boolean) map.get("isNew"), IoCodeRelEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), IoCodeRelEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), IoCodeRelEntity::getUpdateTime .between(ge, IoCodeRelEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), IoCodeRelEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(ioCodeRelList)) { if (CollectionUtil.isNotEmpty(ioCodeRelList)) {
@ -525,8 +516,9 @@ public class SpsSyncDownloadService {
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.ORDER_INVOICE, createFile); Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.ORDER_INVOICE, createFile);
totalTimeMap.put(BasicExportStatusTimeEnum.ORDER_INVOICE, map); totalTimeMap.put(BasicExportStatusTimeEnum.ORDER_INVOICE, map);
List<IoOrderInvoiceEntity> orderInvoiceEntities = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class) List<IoOrderInvoiceEntity> orderInvoiceEntities = orderInvoiceService.list(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class)
.le((boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime .between(ge, IoOrderInvoiceEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), IoOrderInvoiceEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(orderInvoiceEntities)) { if (CollectionUtil.isNotEmpty(orderInvoiceEntities)) {
@ -600,20 +592,19 @@ public class SpsSyncDownloadService {
Map<BasicExportStatusTimeEnum, Map<String, Object>> totalTimeMap = new WeakHashMap<>(10); Map<BasicExportStatusTimeEnum, Map<String, Object>> totalTimeMap = new WeakHashMap<>(10);
Map<String, Object> syncTimeMap = new WeakHashMap<>(3); Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true); syncTimeMap.put("isNew", true);
boolean ge = false;
if (syncTime != null) {
ge = true;
}
try { try {
//确认有开启业务单据类型同步 //确认有开启业务单据类型同步
if (needExec(info.getTypeBus())) { if (needExec(info.getTypeBus())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSSINESS_TYPE, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSSINESS_TYPE, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_BUSSINESS_TYPE, map); totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_BUSSINESS_TYPE, map);
List<BasicBussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.list(Wrappers.lambdaQuery(BasicBussinessTypeEntity.class) List<BasicBussinessTypeEntity> bussinessTypeEntities = bussinessTypeService.list(Wrappers.lambdaQuery(BasicBussinessTypeEntity.class)
.le((boolean) map.get("isNew"), BasicBussinessTypeEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), BasicBussinessTypeEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), BasicBussinessTypeEntity::getUpdateTime .between(ge, BasicBussinessTypeEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), BasicBussinessTypeEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(bussinessTypeEntities)) { if (CollectionUtil.isNotEmpty(bussinessTypeEntities)) {
@ -623,17 +614,12 @@ public class SpsSyncDownloadService {
} }
//确认有开启扫码单据类型同步 //确认有开启扫码单据类型同步
if (needExec(info.getTypeScan())) { if (needExec(info.getTypeScan())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSTYPE_CHANGE, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.BASIC_BUSTYPE_CHANGE, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_BUSTYPE_CHANGE, map); totalTimeMap.put(BasicExportStatusTimeEnum.BASIC_BUSTYPE_CHANGE, map);
List<BasicBusTypeChangeEntity> busTypeChangeEntities = busTypeChangeService.list(Wrappers.lambdaQuery(BasicBusTypeChangeEntity.class) List<BasicBusTypeChangeEntity> busTypeChangeEntities = busTypeChangeService.list(Wrappers.lambdaQuery(BasicBusTypeChangeEntity.class)
.le((boolean) map.get("isNew"), BasicBusTypeChangeEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), BasicBusTypeChangeEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), BasicBusTypeChangeEntity::getUpdateTime .between(ge, BasicBusTypeChangeEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), BasicBusTypeChangeEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(busTypeChangeEntities)) { if (CollectionUtil.isNotEmpty(busTypeChangeEntities)) {
@ -643,17 +629,12 @@ public class SpsSyncDownloadService {
} }
//确认有开启第三方单据类型同步 //确认有开启第三方单据类型同步
if (needExec(info.getTypeThird())) { if (needExec(info.getTypeThird())) {
Map<String, Object> map; Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_BUSTYPE_ORIGIN, createFile);
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_BUSTYPE_ORIGIN, createFile);
} else {
map = syncTimeMap;
now = syncTime;
}
totalTimeMap.put(BasicExportStatusTimeEnum.THR_BUSTYPE_ORIGIN, map); totalTimeMap.put(BasicExportStatusTimeEnum.THR_BUSTYPE_ORIGIN, map);
List<ThrBusTypeOriginEntity> thrBusTypeOriginEntities = thrBusTypeOriginService.list(Wrappers.lambdaQuery(ThrBusTypeOriginEntity.class) List<ThrBusTypeOriginEntity> thrBusTypeOriginEntities = thrBusTypeOriginService.list(Wrappers.lambdaQuery(ThrBusTypeOriginEntity.class)
.le((boolean) map.get("isNew"), ThrBusTypeOriginEntity::getUpdateTime, now) .le(!ge && (boolean) map.get("isNew"), ThrBusTypeOriginEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), ThrBusTypeOriginEntity::getUpdateTime .between(ge, ThrBusTypeOriginEntity::getUpdateTime, syncTime, now)
.between(!ge && !(boolean) map.get("isNew"), ThrBusTypeOriginEntity::getUpdateTime
, map.get("oldDate"), now) , map.get("oldDate"), now)
); );
if (CollectionUtil.isNotEmpty(thrBusTypeOriginEntities)) { if (CollectionUtil.isNotEmpty(thrBusTypeOriginEntities)) {
@ -719,12 +700,12 @@ public class SpsSyncDownloadService {
BasicExportStatusTimeEntity timeInfo = basicExportTimeService.getOne(Wrappers.lambdaQuery(BasicExportStatusTimeEntity.class) BasicExportStatusTimeEntity timeInfo = basicExportTimeService.getOne(Wrappers.lambdaQuery(BasicExportStatusTimeEntity.class)
.eq(BasicExportStatusTimeEntity::getKey, exportStatusTimeEnum.getKey())); .eq(BasicExportStatusTimeEntity::getKey, exportStatusTimeEnum.getKey()));
if (timeInfo == null) { if (timeInfo == null) {
timeInfo = BasicExportStatusTimeEntity.builder()
.key(exportStatusTimeEnum.getKey())
.lastUpdateTime(DateUtil.formatDateTime(date))
.remark(exportStatusTimeEnum.getRemark())
.build();
if (createFile) { if (createFile) {
timeInfo = BasicExportStatusTimeEntity.builder()
.key(exportStatusTimeEnum.getKey())
.lastUpdateTime(DateUtil.formatDateTime(date))
.remark(exportStatusTimeEnum.getRemark())
.build();
basicExportTimeService.save(timeInfo); basicExportTimeService.save(timeInfo);
} }
} else { } else {

@ -9,6 +9,9 @@ public interface SyncDataBustypeService {
List<SyncDataBustypeEntity> findAll(Integer direct); List<SyncDataBustypeEntity> findAll(Integer direct);
SyncDataBustypeEntity findByAction(String action, Integer direct);
boolean deleteAll(Integer direct); boolean deleteAll(Integer direct);
void inserts(List<SyncDataBustypeEntity> syncDataBustypeEntities); void inserts(List<SyncDataBustypeEntity> syncDataBustypeEntities);

@ -1,5 +1,6 @@
package com.glxp.api.service.sync.impl; package com.glxp.api.service.sync.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.system.SyncDataBustypeDao; import com.glxp.api.dao.system.SyncDataBustypeDao;
import com.glxp.api.entity.sync.SyncDataBustypeEntity; import com.glxp.api.entity.sync.SyncDataBustypeEntity;
@ -23,6 +24,17 @@ public class SyncDataBustypeServiceImpl implements SyncDataBustypeService {
return syncDataBustypeDao.selectList(new QueryWrapper<SyncDataBustypeEntity>().eq("direct", direct)); return syncDataBustypeDao.selectList(new QueryWrapper<SyncDataBustypeEntity>().eq("direct", direct));
} }
@Override
public SyncDataBustypeEntity findByAction(String action, Integer direct) {
List<SyncDataBustypeEntity> syncDataBustypeEntities = syncDataBustypeDao.selectList(new QueryWrapper<SyncDataBustypeEntity>().eq(direct != null, "direct", direct).eq("action", action));
if (CollUtil.isNotEmpty(syncDataBustypeEntities)) {
return syncDataBustypeEntities.get(0);
}
return null;
}
@Override @Override
public boolean deleteAll(Integer direct) { public boolean deleteAll(Integer direct) {
return syncDataBustypeDao.delete(new QueryWrapper<SyncDataBustypeEntity>().eq("direct", direct)) > 0 ? true : false; return syncDataBustypeDao.delete(new QueryWrapper<SyncDataBustypeEntity>().eq("direct", direct)) > 0 ? true : false;

@ -0,0 +1,18 @@
package com.glxp.api.util;
public class IntUtil {
public static int value(Integer value) {
if (value == null)
return 0;
else return value.intValue();
}
public static long value(Long value) {
if (value == null)
return 0l;
else return value.longValue();
}
}

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glxp.api.dao.auth.InvSpaceDao"> <mapper namespace="com.glxp.api.dao.auth.InvSpaceDao">
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace"> <resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace">
<!-- <id column="id" jdbcType="INTEGER" property="id"/>--> <!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
<result column="code" jdbcType="VARCHAR" property="code"/> <result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/> <result column="name" jdbcType="VARCHAR" property="name"/>
<result column="type" jdbcType="VARCHAR" property="type"/> <result column="type" jdbcType="VARCHAR" property="type"/>
@ -35,9 +35,9 @@
<insert id="insertEntity" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.auth.InvSpace" <insert id="insertEntity" keyColumn="id" keyProperty="id" parameterType="com.glxp.api.entity.auth.InvSpace"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into auth_space (code, `name`, type, invStorageCode, insert into auth_space (code, `name`, type, invStorageCode,
invWarehouseCode, `status`, createTime, invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser, updateTime, `createUser`, updateUser,
remark) remark)
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{invStorageCode,jdbcType=VARCHAR}, #{invStorageCode,jdbcType=VARCHAR},
#{invWarehouseCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{invWarehouseCode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
@ -243,9 +243,9 @@
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true"> <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
insert into auth_space insert into auth_space
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime, (code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark) `createUser`, updateUser, remark)
values values
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, (#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.invStorageCode,jdbcType=VARCHAR}, #{item.invStorageCode,jdbcType=VARCHAR},
@ -257,13 +257,14 @@
</foreach> </foreach>
</insert> </insert>
<select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest" resultType="com.glxp.api.res.auth.InvSpaceResponse"> <select id="filterList" parameterType="com.glxp.api.req.auth.FilterInvSpaceRequest"
resultType="com.glxp.api.res.auth.InvSpaceResponse">
select s.*, select s.*,
w.name invStorageName, w.name invStorageName,
iws.name invSubStorageName iws.name invSubStorageName
from auth_space s from auth_space s
left join auth_dept w on s.invStorageCode = w.code left join auth_dept w on s.invStorageCode = w.code
left join auth_warehouse iws on s.invWarehouseCode = iws.code left join auth_warehouse iws on s.invWarehouseCode = iws.code
<where> <where>
<if test="invStorageCode != null and invStorageCode != ''"> <if test="invStorageCode != null and invStorageCode != ''">
AND s.invStorageCode = #{invStorageCode} AND s.invStorageCode = #{invStorageCode}
@ -306,8 +307,8 @@
<select id="selectSpaceCodeList" resultType="com.glxp.api.res.auth.InvSpaceResponse"> <select id="selectSpaceCodeList" resultType="com.glxp.api.res.auth.InvSpaceResponse">
select auth_space.code, auth_space.name, iws.name invSubStorageName, iw.name invStorageName select auth_space.code, auth_space.name, iws.name invSubStorageName, iw.name invStorageName
from auth_space from auth_space
left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode left join auth_warehouse iws on iws.code = auth_space.invWarehouseCode
left join auth_dept iw on iw.code = auth_space.invStorageCode left join auth_dept iw on iw.code = auth_space.invStorageCode
<where> <where>
<if test="invStorageCode != null and invStorageCode != ''"> <if test="invStorageCode != null and invStorageCode != ''">
AND auth_space.invStorageCode = #{invStorageCode} AND auth_space.invStorageCode = #{invStorageCode}
@ -373,7 +374,7 @@
<select id="selectExistByName" resultMap="BaseResultMap"> <select id="selectExistByName" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List"/>
from auth_space from auth_space
<where> <where>
<if test="invStorageCode != null and invStorageCode != ''"> <if test="invStorageCode != null and invStorageCode != ''">
@ -389,7 +390,7 @@
</select> </select>
<select id="getMaxSpaceCode" resultType="java.lang.String"> <select id="getMaxSpaceCode" resultType="java.lang.String">
select max(code) from auth_space select max(CONVERT(code, signed))
<where> <where>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
and invWarehouseCode = #{invCode} and invWarehouseCode = #{invCode}

@ -73,7 +73,7 @@
thrCheckPdaUn, thrCheckPdaEd, thrCheckUdims, thrCheckPc, thrCheckSp, thrCheckPdaUn, thrCheckPdaEd, thrCheckUdims, thrCheckPc, thrCheckSp,
thrCheckChange, thrCheckBalance, thrCheckCopy, fillCodeRel, checkVailDate, thrCheckChange, thrCheckBalance, thrCheckCopy, fillCodeRel, checkVailDate,
checkExpire, checkCertExpire, preInBackAction, backPreinType, checkPreInOrders, checkExpire, checkCertExpire, preInBackAction, backPreinType, checkPreInOrders,
sortNum) sortNum,spaceOut)
values (#{mainAction}, #{action}, #{name}, #{enable}, #{remark}, #{thirdSysFk}, #{genUnit}, #{innerOrder}, values (#{mainAction}, #{action}, #{name}, #{enable}, #{remark}, #{thirdSysFk}, #{genUnit}, #{innerOrder},
#{secCheckEnable}, #{checkEnable}, #{checkUdims}, #{checkPdaEd}, #{checkPdaUn}, #{checkPc}, #{secCheckEnable}, #{checkEnable}, #{checkUdims}, #{checkPdaEd}, #{checkPdaUn}, #{checkPc},
#{checkWebNew}, #{checkSp}, #{checkChange}, #{secCheckUdims}, #{secCheckPdaEd}, #{secCheckPdaUn}, #{checkWebNew}, #{checkSp}, #{checkChange}, #{secCheckUdims}, #{secCheckPdaEd}, #{secCheckPdaUn},
@ -86,7 +86,7 @@
#{thrCheckPdaUn}, #{thrCheckPdaEd}, #{thrCheckUdims}, #{thrCheckPc}, #{thrCheckSp}, #{thrCheckPdaUn}, #{thrCheckPdaEd}, #{thrCheckUdims}, #{thrCheckPc}, #{thrCheckSp},
#{thrCheckChange}, #{thrCheckBalance}, #{thrCheckCopy}, #{fillCodeRel}, #{checkVailDate}, #{thrCheckChange}, #{thrCheckBalance}, #{thrCheckCopy}, #{fillCodeRel}, #{checkVailDate},
#{checkExpire}, #{checkCertExpire}, #{preInBackAction}, #{backPreinType}, #{checkPreInOrders}, #{checkExpire}, #{checkCertExpire}, #{preInBackAction}, #{backPreinType}, #{checkPreInOrders},
#{sortNum}) #{sortNum},#{spaceOut})
</insert> </insert>
<select id="selectBusList" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity"> <select id="selectBusList" resultType="com.glxp.api.entity.basic.BasicBussinessTypeEntity">

@ -73,6 +73,10 @@
GROUP BY ic.id GROUP BY ic.id
</select> </select>
<select id="selectByinvoiceId" parameterType="java.lang.Long" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select * from io_order_invoice where id= #{id}
</select>
<select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity"> <select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity">
select * select *
from io_order_detail_biz from io_order_detail_biz

@ -11,13 +11,13 @@
<insert id="inserts" parameterType="com.glxp.api.entity.sync.SyncDataBustypeEntity"> <insert id="inserts" parameterType="com.glxp.api.entity.sync.SyncDataBustypeEntity">
replace INTO sync_data_bustypes replace INTO sync_data_bustypes
(id, `action`, `name`, outChange, orderStatus, direct) (id, `action`, `name`, outChange, orderStatus, direct, syncStatus, syncChange)
values values
<foreach collection="syncDataBustypeEntities" item="item" index="index" <foreach collection="syncDataBustypeEntities" item="item" index="index"
separator=","> separator=",">
(#{item.id}, #{item.action}, #{item.name}, (#{item.id}, #{item.action}, #{item.name},
#{item.outChange}, #{item.orderStatus}, #{item.direct}) #{item.outChange}, #{item.orderStatus}, #{item.direct}, #{item.syncStatus}, #{item.syncChange})
</foreach> </foreach>
</insert> </insert>
</mapper> </mapper>

@ -364,7 +364,11 @@ CALL Pro_Temp_ColumnWork('sync_data_set', 'orderInvoice', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2); CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'regStatus', 'varchar(255) ', 1); CALL Pro_Temp_ColumnWork('io_order_detail_code', 'regStatus', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'reviewSp', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'syncStatus', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'syncChange', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('basic_bussiness_type', 'spaceOut', 'tinyint', 1);

Loading…
Cancel
Save