|
|
|
@ -33,6 +33,7 @@ import com.glxp.api.entity.thrsys.*;
|
|
|
|
|
import com.glxp.api.req.sync.SpsSyncDataRequest;
|
|
|
|
|
import com.glxp.api.req.sync.SyncUpLoadRequest;
|
|
|
|
|
import com.glxp.api.res.sync.*;
|
|
|
|
|
import com.glxp.api.service.basic.IBasicBusTypeChangeService;
|
|
|
|
|
import com.glxp.api.service.inout.IoAddInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoCheckInoutService;
|
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
@ -51,6 +52,7 @@ import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
|
import org.apache.ibatis.session.TransactionIsolationLevel;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
@ -324,6 +326,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
|
|
|
|
|
@ApiOperation("上传同步数据")
|
|
|
|
|
@PostMapping("sps/sync/upload/data")
|
|
|
|
|
@Transactional
|
|
|
|
|
public Object uploadData(@RequestBody SyncUpLoadRequest upLoadRequest) {
|
|
|
|
|
try {
|
|
|
|
|
JSONObject obj = JSONUtil.parseObj(upLoadRequest.getData());
|
|
|
|
@ -343,6 +346,9 @@ public class SpsSyncDownloadController {
|
|
|
|
|
case THIRD_DATA:
|
|
|
|
|
saveUploadThrData(JSONUtil.toBean(obj, SpsSyncThrDataResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case SYS_SET_DATA:
|
|
|
|
|
saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class));
|
|
|
|
|
break;
|
|
|
|
|
case COUNTRY_DI_DATA:
|
|
|
|
|
}
|
|
|
|
|
String taskId = obj.getStr("taskId");
|
|
|
|
@ -365,6 +371,54 @@ public class SpsSyncDownloadController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final SystemParamConfigDao systemParamConfigDao;
|
|
|
|
|
private final EntrustReceDao entrustReceDao;
|
|
|
|
|
private final SystemPDFModuleDao systemPDFModuleDao;
|
|
|
|
|
private final SystemPDFTemplateDao systemPDFTemplateDao;
|
|
|
|
|
private final SysPdfTemplateRelevanceCodeDao sysPdfTemplateRelevanceCodeDao;
|
|
|
|
|
private final SysPdfTemplateRelevanceBizDao sysPdfTemplateRelevanceBizDao;
|
|
|
|
|
private final SysPdfTemplateRelevanceLabelDao sysPdfTemplateRelevanceLabelDao;
|
|
|
|
|
private final SysPdfTemplateRelevanceStatemenDao sysPdfTemplateRelevanceStatemenDao;
|
|
|
|
|
private final BasicBusTypePreDao basicBusTypePreDao;
|
|
|
|
|
private final BasicBusTypeChangeDao basicBusTypeChangeDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void saveUploadSysSettingData(SpsSyncSysSettingResponse bean) {
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemParamConfigEntities())) {
|
|
|
|
|
systemParamConfigDao.insertOrUpdateBatch(bean.getSystemParamConfigEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getEntrustReceEntities())) {
|
|
|
|
|
entrustReceDao.insertOrUpdateBatch(bean.getEntrustReceEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemPDFModuleEntities())) {
|
|
|
|
|
systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSystemPDFTemplateEntities())) {
|
|
|
|
|
systemPDFTemplateDao.insertOrUpdateBatch(bean.getSystemPDFTemplateEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceCodeEntities())) {
|
|
|
|
|
sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceBizEntities())) {
|
|
|
|
|
sysPdfTemplateRelevanceBizDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceBizEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceLabelEntities())) {
|
|
|
|
|
sysPdfTemplateRelevanceLabelDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceLabelEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceStatemenEntities())) {
|
|
|
|
|
sysPdfTemplateRelevanceStatemenDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceStatemenEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBasicBusTypePreEntities())) {
|
|
|
|
|
basicBusTypePreDao.insertOrUpdateBatch(bean.getBasicBusTypePreEntities());
|
|
|
|
|
}
|
|
|
|
|
if (CollectionUtil.isNotEmpty(bean.getBasicBusTypeChangeEntities())) {
|
|
|
|
|
basicBusTypeChangeDao.insertOrUpdateBatch(bean.getBasicBusTypeChangeEntities());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final ThrDeptDao thrDeptDao;
|
|
|
|
|
private final ThrInvWarehouseDao thrInvWarehouseDao;
|
|
|
|
|
private final ThrProductsDao thrProductsDao;
|
|
|
|
@ -725,7 +779,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
BasicBusTypeChangeDao mapper = batchSession.getMapper(BasicBusTypeChangeDao.class);
|
|
|
|
|
busTypeChangeEntities.forEach(busTypeChangeEntity ->
|
|
|
|
|
{
|
|
|
|
|
mapper.insertOrUpdate(busTypeChangeEntity);
|
|
|
|
|
mapper.insertOrUpdateEntity(busTypeChangeEntity);
|
|
|
|
|
});
|
|
|
|
|
batchSession.commit();
|
|
|
|
|
remark.append("业务单据类型:").append(syncDataResponse.getBussinessTypeEntities().size()).append("条\n");
|
|
|
|
@ -924,7 +978,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSystemParamConfigEntities())) {
|
|
|
|
|
List<SystemParamConfigEntity> systemParamConfigEntities = spsSyncSysSettingResponse.getSystemParamConfigEntities();
|
|
|
|
|
SystemParamConfigDao mapper = sqlSession.getMapper(SystemParamConfigDao.class);
|
|
|
|
|
systemParamConfigEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
systemParamConfigEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("系统运行参数:").append(spsSyncSysSettingResponse.getSystemParamConfigEntities().size()).append("条\n");
|
|
|
|
@ -933,7 +987,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getEntrustReceEntities())) {
|
|
|
|
|
List<EntrustReceEntity> entrustReceEntities = spsSyncSysSettingResponse.getEntrustReceEntities();
|
|
|
|
|
EntrustReceDao mapper = sqlSession.getMapper(EntrustReceDao.class);
|
|
|
|
|
entrustReceEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
entrustReceEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("委托验收设置:").append(spsSyncSysSettingResponse.getEntrustReceEntities().size()).append("条\n");
|
|
|
|
@ -960,7 +1014,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceCodeEntities())) {
|
|
|
|
|
List<SysPdfTemplateRelevanceCodeEntity> sysPdfTemplateRelevanceCodeEntities = spsSyncSysSettingResponse.getSysPdfTemplateRelevanceCodeEntities();
|
|
|
|
|
SysPdfTemplateRelevanceCodeDao mapper = sqlSession.getMapper(SysPdfTemplateRelevanceCodeDao.class);
|
|
|
|
|
sysPdfTemplateRelevanceCodeEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
sysPdfTemplateRelevanceCodeEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("扫码单据关联表:").append(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceCodeEntities().size()).append("条\n");
|
|
|
|
@ -969,7 +1023,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceBizEntities())) {
|
|
|
|
|
List<SysPdfTemplateRelevanceBizEntity> sysPdfTemplateRelevanceBizEntities = spsSyncSysSettingResponse.getSysPdfTemplateRelevanceBizEntities();
|
|
|
|
|
SysPdfTemplateRelevanceBizDao mapper = sqlSession.getMapper(SysPdfTemplateRelevanceBizDao.class);
|
|
|
|
|
sysPdfTemplateRelevanceBizEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
sysPdfTemplateRelevanceBizEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("业务单据关联表:").append(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceBizEntities().size()).append("条\n");
|
|
|
|
@ -978,7 +1032,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceLabelEntities())) {
|
|
|
|
|
List<SysPdfTemplateRelevanceLabelEntity> sysPdfTemplateRelevanceLabelEntities = spsSyncSysSettingResponse.getSysPdfTemplateRelevanceLabelEntities();
|
|
|
|
|
SysPdfTemplateRelevanceLabelDao mapper = sqlSession.getMapper(SysPdfTemplateRelevanceLabelDao.class);
|
|
|
|
|
sysPdfTemplateRelevanceLabelEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
sysPdfTemplateRelevanceLabelEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("内部码打印关联表:").append(spsSyncSysSettingResponse.getSystemParamConfigEntities().size()).append("条\n");
|
|
|
|
@ -987,7 +1041,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceStatemenEntities())) {
|
|
|
|
|
List<SysPdfTemplateRelevanceStatemenEntity> sysPdfTemplateRelevanceStatemenEntities = spsSyncSysSettingResponse.getSysPdfTemplateRelevanceStatemenEntities();
|
|
|
|
|
SysPdfTemplateRelevanceStatemenDao mapper = sqlSession.getMapper(SysPdfTemplateRelevanceStatemenDao.class);
|
|
|
|
|
sysPdfTemplateRelevanceStatemenEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
sysPdfTemplateRelevanceStatemenEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("资质证书打印关联表:").append(spsSyncSysSettingResponse.getSysPdfTemplateRelevanceStatemenEntities().size()).append("条\n");
|
|
|
|
@ -1005,7 +1059,7 @@ public class SpsSyncDownloadController {
|
|
|
|
|
if (CollUtil.isNotEmpty(spsSyncSysSettingResponse.getBasicBusTypeChangeEntities())) {
|
|
|
|
|
List<BasicBusTypeChangeEntity> basicBusTypeChangeEntities = spsSyncSysSettingResponse.getBasicBusTypeChangeEntities();
|
|
|
|
|
BasicBusTypeChangeDao mapper = sqlSession.getMapper(BasicBusTypeChangeDao.class);
|
|
|
|
|
basicBusTypeChangeEntities.forEach(mapper::insertOrUpdate);
|
|
|
|
|
basicBusTypeChangeEntities.forEach(mapper::insertOrUpdateEntity);
|
|
|
|
|
}
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
remark.append("自动建业务单设置:").append(spsSyncSysSettingResponse.getBasicBusTypeChangeEntities().size()).append("条\n");
|
|
|
|
|