|
|
|
@ -13,6 +13,8 @@ import com.glxp.api.constant.*;
|
|
|
|
|
import com.glxp.api.controller.sync.SpsSyncWebSocket;
|
|
|
|
|
import com.glxp.api.constant.Constant;
|
|
|
|
|
import com.glxp.api.dao.basic.BasicProductsDao;
|
|
|
|
|
import com.glxp.api.dao.purchase.PurApplyDao;
|
|
|
|
|
import com.glxp.api.dao.purchase.PurContractMapper;
|
|
|
|
|
import com.glxp.api.entity.basic.*;
|
|
|
|
|
import com.glxp.api.entity.dev.*;
|
|
|
|
|
import com.glxp.api.entity.inout.*;
|
|
|
|
@ -50,6 +52,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.ApplicationContext;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -97,6 +100,10 @@ public class SpsSyncDownloadService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderInvoiceService orderInvoiceService;
|
|
|
|
|
@Autowired
|
|
|
|
|
private PurApplyDao purApplyDao;
|
|
|
|
|
@Autowired
|
|
|
|
|
private PurContractMapper purContractMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 创建单据同步任务
|
|
|
|
@ -810,17 +817,28 @@ public class SpsSyncDownloadService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//todo 合同实体
|
|
|
|
|
// List<DeviceCheckDetailEntity> deviceCheckDetailEntities = deviceCheckDetailService.list(Wrappers.lambdaQuery(DeviceCheckDetailEntity.class)
|
|
|
|
|
// .le(!ge && (boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime, now)
|
|
|
|
|
// .between(ge, DeviceCheckDetailEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
// .between(!ge && !(boolean) map.get("isNew"), DeviceCheckDetailEntity::getUpdateTime
|
|
|
|
|
// , map.get("oldDate"), now)
|
|
|
|
|
// );
|
|
|
|
|
// if (CollectionUtil.isNotEmpty(deviceCheckDetailEntities)) {
|
|
|
|
|
// remark.append("合同:").append(deviceCheckDetailEntities.size()).append("条\n");
|
|
|
|
|
// jsonMap.put(DeviceCheckDetailEntity.class.getSimpleName(), deviceCheckDetailEntities);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
List<PurApplyEntity> purApplyEntities = purApplyDao.selectList(Wrappers.lambdaQuery(PurApplyEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), PurApplyEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, PurApplyEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), PurApplyEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(purApplyEntities)) {
|
|
|
|
|
remark.append("设备申购明细:").append(purApplyEntities.size()).append("条\n");
|
|
|
|
|
jsonMap.put(PurApplyEntity.class.getSimpleName(), purApplyEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<PurContractEntity> purContractEntities = purContractMapper.selectList(Wrappers.lambdaQuery(PurContractEntity.class)
|
|
|
|
|
.le(!ge && (boolean) map.get("isNew"), PurContractEntity::getUpdateTime, now)
|
|
|
|
|
.between(ge, PurContractEntity::getUpdateTime, syncTime, now)
|
|
|
|
|
.between(!ge && !(boolean) map.get("isNew"), PurContractEntity::getUpdateTime
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(purContractEntities)) {
|
|
|
|
|
remark.append("设备合同明细:").append(purContractEntities.size()).append("条\n");
|
|
|
|
|
jsonMap.put(PurContractEntity.class.getSimpleName(), purContractEntities);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (jsonMap.size() > 0) {
|
|
|
|
|
jsonMap.put(SYNC_REMARK, remark.toString());
|
|
|
|
|