Merge remote-tracking branch 'origin/master'

master
郑明梁 2 years ago
commit 9cce01e788

@ -56,7 +56,7 @@ public enum BasicExportStatusTimeEnum {
/**
*
*/
DEPARTMENT("department","部门数据"),
DEPT_DATA("dept_data","部门数据"),
/**
*
@ -67,6 +67,26 @@ public enum BasicExportStatusTimeEnum {
*
*/
USER_DATA("user_data","用户数据"),
/**
*
*/
THR_DEPT("thr_dept","第三方部门信息"),
/**
*
*/
THR_WAREHOUSE("thr_warehouse","第三方仓库信息"),
/**
*
*/
THR_PRODUCTS("thr_products","第三方产品信息"),
/**
*
*/
THR_CORP("thr_corp","第三方往来单位信息"),
;
@EnumValue
private String key;

@ -31,6 +31,11 @@ public enum BasicExportTypeEnum {
*
*/
USER_DATA("user_data", "用户数据"),
/**
*
*/
THIRD_DATA("third_data", "第三方数据"),
;
private String key;

@ -1,6 +1,7 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.req.thrsys.FilterThrCorpRequest;
@ -14,7 +15,7 @@ import java.util.Date;
import java.util.List;
@Mapper
public interface ThrCorpDao {
public interface ThrCorpDao extends BaseMapperPlus<ThrCorpDao, ThrCorpEntity, ThrCorpEntity> {
List<ThrCorpsResponse> filterThrCorps(FilterThrCorpRequest filterThrCorpRequest);

@ -1,5 +1,6 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.thrsys.ThrDeptEntity;
import com.glxp.api.req.thrsys.FilterThrDeptRequest;
import org.apache.ibatis.annotations.Mapper;
@ -9,7 +10,7 @@ import java.util.Date;
import java.util.List;
@Mapper
public interface ThrDeptDao {
public interface ThrDeptDao extends BaseMapperPlus<ThrDeptDao,ThrDeptEntity,ThrDeptEntity> {
List<ThrDeptEntity> filterThrInvWarehouse(FilterThrDeptRequest filterThrDeptRequest);

@ -1,5 +1,6 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.api.req.thrsys.FilterThrSubInvWarehouseRequest;
import com.glxp.api.res.thrsys.ThrInvWarehouseResponse;
@ -10,7 +11,7 @@ import java.util.Date;
import java.util.List;
@Mapper
public interface ThrInvWarehouseDao {
public interface ThrInvWarehouseDao extends BaseMapperPlus<ThrInvWarehouseDao, ThrInvWarehouseEntity, ThrInvWarehouseEntity> {
List<ThrInvWarehouseEntity> filterThrInvWarehouse(FilterThrSubInvWarehouseRequest filterThrSubInvWarehouseRequest);

@ -1,5 +1,6 @@
package com.glxp.api.dao.thrsys;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.res.thrsys.ThrProductsResponse;
@ -16,7 +17,7 @@ import java.util.List;
* @author ${author}
* @since 2023-01-10
*/
public interface ThrProductsDao {
public interface ThrProductsDao extends BaseMapperPlus<ThrProductsDao, ThrProductsEntity, ThrProductsEntity> {
List<ThrProductsEntity> filterThrProducts(FilterThrProductsRequest filterThrProductsRequest);
@ -44,5 +45,5 @@ public interface ThrProductsDao {
*/
ThrProductsEntity selectByCodeAndThird(@Param("code") String code, @Param("thirdSysFk") String thirdSysFk);
boolean updateById(ThrProductsEntity thrProductsEntity);
boolean updateEntityById(ThrProductsEntity thrProductsEntity);
}

@ -3,6 +3,7 @@ package com.glxp.api.res.sync;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.entity.thrsys.ThrDeptEntity;
import com.glxp.api.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import lombok.Data;
import java.util.List;
@ -23,6 +24,11 @@ public class SpsSyncThrDataResponse extends BaseSyncResponse {
*/
private List<ThrInvWarehouseEntity> invWarehouseEntities;
/**
*
*/
private List<ThrProductsEntity> productsEntityList;
/**
*
*/

@ -25,16 +25,15 @@ import com.glxp.api.entity.sync.BasicDownloadStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusEntity;
import com.glxp.api.entity.sync.BasicExportStatusTimeEntity;
import com.glxp.api.entity.system.SyncDataSetEntity;
import com.glxp.api.entity.thrsys.ThrBusTypeOriginEntity;
import com.glxp.api.entity.thrsys.*;
import com.glxp.api.http.sync.SpGetHttpClient;
import com.glxp.api.req.sync.SpsSyncDataRequest;
import com.glxp.api.res.auth.InvSpaceResponse;
import com.glxp.api.res.sync.*;
import com.glxp.api.service.auth.*;
import com.glxp.api.service.basic.IBasicBusTypeChangeService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
import com.glxp.api.service.thrsys.IThrBusTypeOriginService;
import com.glxp.api.service.thrsys.*;
import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.DateUtil;
import com.glxp.api.util.RedisUtil;
@ -237,6 +236,11 @@ public class HeartService {
uploadData(exportType, taskId, x -> x.getUserData(info, taskId, now, syncTime));
}
break;
case THIRD_DATA:
if (needExec(info.getBasicThirdDept(), info.getBasicThirdInv(), info.getBasicThirdProducts(),info.getBasicThirdCorp())) {
uploadData(exportType, taskId, x -> x.getThirdData(info, taskId, now, syncTime));
}
break;
case COUNTRY_DI_DATA:
}
}
@ -571,7 +575,7 @@ public class HeartService {
if (needExec(info.getDepartment())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEPARTMENT);
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DEPT_DATA);
} else {
map = syncTimeMap;
}
@ -689,6 +693,113 @@ public class HeartService {
return dataResponse;
}
private final ThrDeptService thrDeptService;
private final ThrInvWarehouseService thrInvWarehouseService;
private final ThrProductsService thrProductsService;
private final ThrCorpService thrCorpService;
/**
*
*
* @param info
* @param now
* @param syncTime -- exportTime
* @return
*/
private SpsSyncThrDataResponse getThirdData(SyncDataSetEntity info, String taskId, Date now, Date syncTime) {
SpsSyncThrDataResponse dataResponse = null;
Map<String, Object> syncTimeMap = new WeakHashMap<>(3);
syncTimeMap.put("isNew", true);
syncTimeMap.put("oldDate", syncTime);
//确认有开启第三方部门信息同步
if (needExec(info.getBasicThirdDept())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_DEPT);
} else {
map = syncTimeMap;
}
List<ThrDeptEntity> deptEntityList = thrDeptService.list(Wrappers.lambdaQuery(ThrDeptEntity.class)
.le((boolean) map.get("isNew"), ThrDeptEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), ThrDeptEntity::getUpdateTime
, map.get("oldDate"), now)
);
if (CollectionUtil.isNotEmpty(deptEntityList)) {
dataResponse = new SpsSyncThrDataResponse();
dataResponse.setDeptEntities(deptEntityList);
}
}
//确认有开启第三方仓库信息同步
if(needExec(info.getBasicThirdInv())){
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_WAREHOUSE);
} else {
map = syncTimeMap;
}
List<ThrInvWarehouseEntity> warehouseEntityList = thrInvWarehouseService.list(Wrappers.lambdaQuery(ThrInvWarehouseEntity.class)
.le((boolean) map.get("isNew"), ThrInvWarehouseEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), ThrInvWarehouseEntity::getUpdateTime
, map.get("oldDate"), now)
);
if (CollectionUtil.isNotEmpty(warehouseEntityList)) {
if (dataResponse == null) {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setInvWarehouseEntities(warehouseEntityList);
}
}
//确认有开启仓库字典同步
if (needExec(info.getBasicThirdProducts())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_PRODUCTS);
} else {
map = syncTimeMap;
}
List<ThrProductsEntity> productsEntityList = thrProductsService.list(Wrappers.lambdaQuery(ThrProductsEntity.class)
.le((boolean) map.get("isNew"), ThrProductsEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), ThrProductsEntity::getUpdateTime
, map.get("oldDate"), now)
);
if (CollectionUtil.isNotEmpty(productsEntityList)) {
if (dataResponse == null) {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setProductsEntityList(productsEntityList);
}
}
//确认有开启第三方往来单位信息同步
if (needExec(info.getBasicThirdCorp())) {
Map<String, Object> map;
if (syncTime == null) {
map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.THR_CORP);
} else {
map = syncTimeMap;
}
List<ThrCorpEntity> corpEntities = thrCorpService.list(Wrappers.lambdaQuery(ThrCorpEntity.class)
.le((boolean) map.get("isNew"), ThrCorpEntity::getUpdateTime, now)
.between(!(boolean) map.get("isNew"), ThrCorpEntity::getUpdateTime
, map.get("oldDate"), now)
);
if (CollectionUtil.isNotEmpty(corpEntities)) {
if (dataResponse == null) {
dataResponse = new SpsSyncThrDataResponse();
}
dataResponse.setCorpEntities(corpEntities);
}
}
if (dataResponse != null) {
dataResponse.setTaskId(taskId);
}
return dataResponse;
}
/**
*
*

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrCorpEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
@ -11,7 +12,7 @@ import com.glxp.api.res.thrsys.ThrUnitMaintainResponse;
import java.util.Date;
import java.util.List;
public interface ThrCorpService {
public interface ThrCorpService extends IService<ThrCorpEntity> {
List<ThrCorpsResponse> filterThrCorps(FilterThrCorpRequest filterThrCorpRequest);

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrDeptEntity;
import com.glxp.api.req.thrsys.FilterThrDeptRequest;
@ -8,7 +9,7 @@ import com.glxp.api.req.thrsys.FilterThrDeptRequest;
import java.util.Date;
import java.util.List;
public interface ThrDeptService {
public interface ThrDeptService extends IService<ThrDeptEntity> {
ThrDeptEntity findDefault(Boolean advaceType, Boolean isDefault);

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrInvWarehouseEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
@ -10,7 +11,7 @@ import com.glxp.api.res.thrsys.ThrInvWarehouseResponse;
import java.util.Date;
import java.util.List;
public interface ThrInvWarehouseService {
public interface ThrInvWarehouseService extends IService<ThrInvWarehouseEntity> {
ThrInvWarehouseEntity selectById(String id);

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys;
import com.baomidou.mybatisplus.extension.service.IService;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
@ -20,7 +21,7 @@ import java.util.List;
* @author ${author}
* @since 2023-01-10
*/
public interface ThrProductsService {
public interface ThrProductsService extends IService<ThrProductsEntity> {
ThrProductsEntity selectByCode(String code);

@ -1,6 +1,7 @@
package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -24,7 +25,7 @@ import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrCorpServiceImpl implements ThrCorpService {
public class ThrCorpServiceImpl extends ServiceImpl<ThrCorpDao, ThrCorpEntity> implements ThrCorpService {
@Resource
private ThrCorpDao thrCorpDao;

@ -2,6 +2,7 @@ package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -26,7 +27,7 @@ import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrDeptServiceImpl implements ThrDeptService {
public class ThrDeptServiceImpl extends ServiceImpl<ThrDeptDao,ThrDeptEntity> implements ThrDeptService {
@Resource
private ThrDeptDao thrDeptDao;

@ -3,6 +3,7 @@ package com.glxp.api.service.thrsys.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -28,7 +29,7 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrInvWarehouseServiceImpl implements ThrInvWarehouseService {
public class ThrInvWarehouseServiceImpl extends ServiceImpl<ThrInvWarehouseDao,ThrInvWarehouseEntity> implements ThrInvWarehouseService {
@Resource
private ThrInvWarehouseDao thrInvWarehouseDao;

@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -41,7 +42,7 @@ import java.util.List;
@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class ThrProductsServiceImpl implements ThrProductsService {
public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProductsEntity> implements ThrProductsService {
@Resource
private ThrProductsDao thrProductsDao;
@ -188,7 +189,7 @@ public class ThrProductsServiceImpl implements ThrProductsService {
boolean isChange = verifyDataChange(thrProductsEntity, item);
if (isChange) {
thrProductsEntity.setUpdateTime(new Date());
thrProductsDao.updateById(thrProductsEntity);
thrProductsDao.updateEntityById(thrProductsEntity);
}
}
});

@ -279,7 +279,7 @@
</where>
</select>
<update id="updateById" parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
<update id="updateEntityById" parameterType="com.glxp.api.entity.thrsys.ThrProductsEntity">
update thr_products
<set>
code = #{code,jdbcType=VARCHAR},

Loading…
Cancel
Save