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)
public BaseResponse deleteById(@RequestBody IoOrderInvoiceEntity ioOrderInvoiceEntity) {
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
IoOrderInvoiceResponse ioOrderInvoiceResponse = orderDetailBizService.selectByinvoiceId(ioOrderInvoiceEntity.getId());
//更改 登记状态
IoOrderDetailCodeEntity ioOrderDetailBizEntity = new IoOrderDetailCodeEntity();
@ -570,10 +572,11 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderDetailBizEntity.setOrderIdFk(ioOrderInvoiceEntity.getOrderIdFk());
ioOrderDetailBizEntity.setId(ioOrderInvoiceEntity.getRegId());
ioOrderDetailBizEntity.setId(ioOrderInvoiceResponse.getBizIdFk().intValue());
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
List<IoOrderInvoiceResponse> list = orderDetailBizService.filterListInv(filterOrderDetailBizRequest);
if(list == null && list.size()==0){
if(list.size()==0){
ioOrderDetailBizEntity.setRegStatus(false);
}
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.util.ResultVOUtils;
import com.glxp.api.constant.*;
import com.glxp.api.constant.Constant;
import com.glxp.api.dao.auth.*;
import com.glxp.api.dao.basic.*;
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.sync.BasicDownloadStatusEntity;
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.thrsys.*;
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.BasicExportService;
import com.glxp.api.service.sync.SpsSyncDownloadService;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.FileUtils;
import com.glxp.api.util.JsonUtils;
import com.glxp.api.service.sync.SyncDataBustypeService;
import com.glxp.api.util.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@ -606,6 +606,8 @@ public class SpsSyncDownloadController {
IBasicBussinessTypeService basicBussinessTypeService;
@Resource
InvWarehouseService invWarehouseService;
@Resource
SyncDataBustypeService syncDataBustypeService;
//接收中继服务、UDI管理系统上传单据
@AuthRuleAnnotation("sps/sync/order/upload")
@ -624,10 +626,21 @@ public class SpsSyncDownloadController {
if (CollUtil.isNotEmpty(syncDataResponse.getOrderEntities())) {
List<IoOrderEntity> orderEntities = syncDataResponse.getOrderEntities();
for (IoOrderEntity orderEntity : orderEntities) {
SyncDataBustypeEntity syncDataBustypeEntity = syncDataBustypeService.findByAction(orderEntity.getAction(), 2);
orderEntity.setUpdateTime(null);
orderEntity.setFromType(ConstantStatus.FROM_UDISP);
orderEntity.setProcessStatus(ConstantStatus.ORDER_DEAL_POST);
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());
@ -712,10 +725,12 @@ public class SpsSyncDownloadController {
}
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
addInoutService.dealProcess(orderEntity);
orderEntity = orderService.findByBillNo(orderEntity.getBillNo());
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATS_ERROR && !ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
if (orderEntity.getStatus() != ConstantStatus.ORDER_STATUS_TEMP_SAVE) {
addInoutService.dealProcess(orderEntity);
orderEntity = orderService.findByBillNo(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<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest);
IoOrderInvoiceResponse selectByinvoiceId(Long id);
/**
*

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

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

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

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

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

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

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

@ -85,7 +85,9 @@ public class IoChangeInoutService {
//普通出入库单据流转
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());
List<IoCodeEntity> codeEnttities = codeService.findByOrderId(orderEntity.getBillNo());
if (basicBusTypePreEntity.getSupplementAll()) {//全量补单

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

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

@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -140,7 +141,8 @@ public class IoOrderServiceImpl implements IoOrderService {
@Override
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())) {
BasicCorpEntity corpEntity = basicCorpDao.selectByErpId(order.getFromCorp());
response.setFromCorpName(corpEntity.getName());
if (corpEntity != null)
response.setFromCorpName(corpEntity.getName());
} else if (StrUtil.isNotBlank(order.getFromInvCode())) {
String fromInvName = invWarehouseDao.selectNameByCode(order.getFromInvCode());
response.setFromCorpName(fromInvName);

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

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

@ -1,5 +1,6 @@
package com.glxp.api.service.sync.impl;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.glxp.api.dao.system.SyncDataBustypeDao;
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));
}
@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
public boolean deleteAll(Integer direct) {
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"?>
<!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">
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace">
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.auth.InvSpace">
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
<result column="code" jdbcType="VARCHAR" property="code"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<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"
useGeneratedKeys="true">
insert into auth_space (code, `name`, type, invStorageCode,
invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser,
remark)
invWarehouseCode, `status`, createTime,
updateTime, `createUser`, updateUser,
remark)
values (#{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{invStorageCode,jdbcType=VARCHAR},
#{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 into auth_space
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark)
values
(code, `name`, type, invStorageCode, invWarehouseCode, `status`, createTime, updateTime,
`createUser`, updateUser, remark)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR},
#{item.invStorageCode,jdbcType=VARCHAR},
@ -257,13 +257,14 @@
</foreach>
</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.*,
w.name invStorageName,
iws.name invSubStorageName
from auth_space s
left join auth_dept w on s.invStorageCode = w.code
left join auth_warehouse iws on s.invWarehouseCode = iws.code
left join auth_dept w on s.invStorageCode = w.code
left join auth_warehouse iws on s.invWarehouseCode = iws.code
<where>
<if test="invStorageCode != null and invStorageCode != ''">
AND s.invStorageCode = #{invStorageCode}
@ -306,8 +307,8 @@
<select id="selectSpaceCodeList" resultType="com.glxp.api.res.auth.InvSpaceResponse">
select auth_space.code, auth_space.name, iws.name invSubStorageName, iw.name invStorageName
from auth_space
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_warehouse iws on iws.code = auth_space.invWarehouseCode
left join auth_dept iw on iw.code = auth_space.invStorageCode
<where>
<if test="invStorageCode != null and invStorageCode != ''">
AND auth_space.invStorageCode = #{invStorageCode}
@ -373,7 +374,7 @@
<select id="selectExistByName" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from auth_space
<where>
<if test="invStorageCode != null and invStorageCode != ''">
@ -389,7 +390,7 @@
</select>
<select id="getMaxSpaceCode" resultType="java.lang.String">
select max(code) from auth_space
select max(CONVERT(code, signed))
<where>
<if test="invCode != null and invCode != ''">
and invWarehouseCode = #{invCode}

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

@ -73,6 +73,10 @@
GROUP BY ic.id
</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 *
from io_order_detail_biz

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