物资审核代码提交(修复线上问题)

master
郑明梁 2 years ago
parent ccb9fc7085
commit f53a4ab7b0

@ -4,14 +4,18 @@ import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.basic.BasicBusTypeChangeEntity;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceBizEntity;
import com.glxp.api.entity.system.SystemPDFTemplateRelevanceEntity;
import com.glxp.api.entity.thrsys.ThrDeptEntity;
import com.glxp.api.req.basic.FilterBusTypeChangeRequest;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.req.system.FilterPdfTemplateRelevanceRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.BasicBusTypeChangeResponse;
import com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse;
import com.glxp.api.service.basic.IBasicBusTypeChangeService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.system.SystemPDFTemplateRelevanceBizService;
import com.glxp.api.service.system.impl.SystemPDFTemplateRelevanceBizServiceImpl;
@ -32,16 +36,19 @@ public class SystemPDFTemplateRelevanceBizController {
@Resource
IBasicBussinessTypeService basicBussinessTypeService;
@Resource
IBasicBusTypeChangeService basicBusTypeChangeService;
@PostMapping("/system/pdf/templateRelevanceBiz/getListByModelId")
public BaseResponse getListByModelId(@RequestBody FilterPdfTemplateRelevanceRequest filterPdfTemplateRelevanceRequest) {
FilterBussinessTypeRequest filterBussinessTypeRequest = new FilterBussinessTypeRequest();
FilterBusTypeChangeRequest filterBussinessTypeRequest = new FilterBusTypeChangeRequest();
filterBussinessTypeRequest.setEnable(true);
List<BasicBussinessTypeEntity> bussinessLocalTypeEntities = basicBussinessTypeService.findList(filterBussinessTypeRequest);
for (BasicBussinessTypeEntity basicBussinessTypeEntity : bussinessLocalTypeEntities) {
List<BasicBusTypeChangeResponse> bussinessLocalTypeEntities = basicBusTypeChangeService.filterList(filterBussinessTypeRequest);
for (BasicBusTypeChangeResponse basicBussinessTypeEntity : bussinessLocalTypeEntities) {
SysPdfTemplateRelevanceBizEntity systemPDFTemplateRelevanceEntity = new SysPdfTemplateRelevanceBizEntity();
systemPDFTemplateRelevanceEntity.setLocalAction(basicBussinessTypeEntity.getAction());
systemPDFTemplateRelevanceEntity.setLocalAction(basicBussinessTypeEntity.getOriginAction());
systemPDFTemplateRelevanceEntity.setModuleId(filterPdfTemplateRelevanceRequest.getModuleId());
systemPDFTemplateRelevanceEntity.setModelKey(filterPdfTemplateRelevanceRequest.getModelKey());
systemPDFTemplateRelevanceBizService.insert(systemPDFTemplateRelevanceEntity);

@ -345,4 +345,108 @@ public class ThrProductsAddDiController {
return ResultVOUtils.success();
}
/**
* DI
*
* @param
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("udiwms/thrsys/updateThrAddDiProductsList")
@Log(title = "DI产品信息", businessType = BusinessType.UPDATE)
public BaseResponse updateThrAddDiProductsList() {
FilterThrProductsRequest filterThrProductsRequest=new FilterThrProductsRequest();
filterThrProductsRequest.setStatus(2);
List<ThrProductsAddDiEntity> thrProductsAddDiEntityList=thrProductsAddDiService.filterThrProductsDiLists(filterThrProductsRequest);
for (ThrProductsAddDiEntity thrProductsAddDiEntity:thrProductsAddDiEntityList){
thrProductsAddDiEntity.setAuditTime(new Date());
thrProductsAddDiEntity.setAuditUser(customerService.getUserId() + "");
thrProductsAddDiService.updateDiProduct(thrProductsAddDiEntity);
thrProductsAddDiEntity = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId());
//自增的数据就再到第三方产品里面
ThrProductsAddDiResponse thrProductsAddDiResponse = thrProductsAddDiService.selecById(thrProductsAddDiEntity.getId());
if (thrProductsAddDiEntity.getStatus() == 2) { //审核通过
//第三方产品审核通过
if (thrProductsAddDiEntity.getType() == 2) {
ThrProductsEntity thrProductsEntity = new ThrProductsEntity();
BeanUtils.copyProperties(thrProductsAddDiEntity, thrProductsEntity);
thrProductsService.insertThrProducts(thrProductsEntity);
ThrSystemEntity basicThirdSysEntity = thrSystemService.selectMainThrSys();
if (basicThirdSysEntity.getThirdId().equals(thrProductsAddDiEntity.getThirdSysFk()))
if (!udiContrastService.isExit(null, thrProductsAddDiEntity.getCode(), null)) {
udiContrastService.createOnlyMainId(thrProductsAddDiEntity.getCode());
}
} else { //选入DI信息审核通过
//审核通过后追加到耗材字典中
UdiCombineRequest combineRequest = new UdiCombineRequest();
combineRequest.setCustomerId(Long.valueOf(thrProductsAddDiEntity.getCustomerId()));
//插入数据,并获取关联主键
if (udiContrastService.isExit(thrProductsAddDiEntity.getUuid(), null, null)) {
Long udiRelIdFk = udiContrastService.createOnlyUuid(combineRequest, thrProductsAddDiEntity.getUuid());
//回填关联关系到关联表
CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId());
companyProductRelevanceEntity.setUdiRlIdFk(udiRelIdFk);
companyProductRelevanceEntity.setCreateTime(new Date());
companyProductRelevanceEntity.setUpdateTime(new Date());
companyProductRelevanceEntity.setUnitFk(thrProductsAddDiEntity.getCustomerId().toString());
companyProductRelevanceEntity.setAuditStatus("1");
if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getPrice()))
companyProductRelevanceEntity.setPrice(new BigDecimal(thrProductsAddDiEntity.getPrice()));
companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
} else {
// Long udiRelIdFk = udiContrastService.createOnlyUuid(combineRequest, thrProductsAddDiEntity.getUuid());
// //字段更新
// UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(udiRelIdFk);
// //更新产品信息
// UdiProductEntity udiProductEntity = udiProductService.findByUuid(udiRelevanceEntity.getUuid());
// udiProductEntity.setSptm(thrProductsAddDiResponse.getSptm());
// udiProductEntity.setYbbm(thrProductsAddDiResponse.getYbbm());
// udiProductEntity.setMeasname(thrProductsAddDiResponse.getMeasname());
// udiProductEntity.setManufactory(thrProductsAddDiResponse.getManufactory());
// udiProductEntity.setSpmc(thrProductsAddDiResponse.getSpmc());
// udiProductEntity.setCpms(thrProductsAddDiResponse.getCpms());
// udiProductEntity.setPrice(thrProductsAddDiResponse.getPrice());
// udiProductEntity.setBasicPrductRemak1(thrProductsAddDiResponse.getBasicPrductRemak1());
// udiProductEntity.setBasicPrductRemak2(thrProductsAddDiResponse.getBasicPrductRemak2());
// udiProductEntity.setBasicPrductRemak3(thrProductsAddDiResponse.getBasicPrductRemak3());
// udiProductEntity.setBasicPrductRemak4(thrProductsAddDiResponse.getBasicPrductRemak4());
// udiProductEntity.setBasicPrductRemak5(thrProductsAddDiResponse.getBasicPrductRemak5());
// udiProductEntity.setBasicPrductRemak6(thrProductsAddDiResponse.getBasicPrductRemak6());
// udiProductEntity.setBasicPrductRemak7(thrProductsAddDiResponse.getBasicPrductRemak7());
// udiProductEntity.setBasicPrductRemak8(thrProductsAddDiResponse.getBasicPrductRemak8());
// udiProductEntity.setNameCode(null);
// udiProductService.updateUdiInfoByUuid(udiProductEntity);
// UdiRelevanceEntity udiRelevanceEntity1 = new UdiRelevanceEntity();
// BeanUtils.copyProperties(udiRelevanceEntity, udiRelevanceEntity1);
// udiRelevanceService.updateUdiRelevance(udiRelevanceEntity1);
// udiInfoService.updateUdiInfo(udiInfoEntity);
//回填关联关系到关联表
// CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
// companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId());
// companyProductRelevanceEntity.setUdiRlIdFk(udiRelIdFk);
// companyProductRelevanceEntity.setCreateTime(new Date());
// companyProductRelevanceEntity.setUpdateTime(new Date());
// companyProductRelevanceEntity.setUnitFk(thrProductsAddDiEntity.getCustomerId().toString());
// companyProductRelevanceEntity.setAuditStatus("1");
// if (StrUtil.isNotEmpty(thrProductsAddDiEntity.getPrice()))
// companyProductRelevanceEntity.setPrice(new BigDecimal(thrProductsAddDiEntity.getPrice()));
// companyProductRelevanceService.insertCompanyProductRelevance(companyProductRelevanceEntity);
}
}
}
}
return ResultVOUtils.success("更新成功");
}
}

@ -43,4 +43,6 @@ public interface ThrProductsAddDiDao {
boolean insert(ThrProductsAddDiEntity thrProductsAddDiEntity);
List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest);
}

@ -24,6 +24,7 @@ public class FilterThrProductsRequest extends ListPageRequest {
private String lastUpdateTime;
private String companyName;
private Boolean isDownThrSys;
private Integer status;
private List<String> codes;

@ -187,19 +187,27 @@ public class UdiContrastService {
public Long createOnlyUuid(UdiCombineRequest udiCombineRequest, String key) {
List<UdiProductEntity> udiInfoEntities = udiDlHttpClient.getOrUpdateByUuid(key);
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid());
if (StrUtil.isNotBlank(udiCombineRequest.getSupName())) {
udiRelevanceEntity.setSupName(udiCombineRequest.getSupName());
if(udiInfoEntities==null || udiInfoEntities.size()==0){
//为了处理审核时的线上问题
int a=9999;
return Long.valueOf(a);
}else{
UdiRelevanceEntity udiRelevanceEntity = new UdiRelevanceEntity();
udiRelevanceEntity.setUpdateTime(new Date());
udiRelevanceEntity.setModifyTime(new Date());
udiRelevanceEntity.setUuid(udiInfoEntities.get(0).getUuid());
if (StrUtil.isNotBlank(udiCombineRequest.getSupName())) {
udiRelevanceEntity.setSupName(udiCombineRequest.getSupName());
}
Long relId = gennerOrderUtils.getRelId();
udiRelevanceEntity.setId(relId);
udiRelevanceEntity.setIsDisable(false);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
insertUdiInfos(udiInfoEntities);
return relId;
}
Long relId = gennerOrderUtils.getRelId();
udiRelevanceEntity.setId(relId);
udiRelevanceEntity.setIsDisable(false);
udiRelevanceService.insertUdiRelevance(udiRelevanceEntity);
insertUdiInfos(udiInfoEntities);
return relId;
}
public void insertUdiInfos(List<UdiProductEntity> udiInfoEntities) {

@ -36,4 +36,6 @@ public interface ThrProductsAddDiService {
boolean insertThrProducts(ThrProductsAddDiEntity thrProductsAddDiEntity);
List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest);
List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest);
}

@ -137,4 +137,9 @@ public class ThrProductsAddDiServiceImpl implements ThrProductsAddDiService {
public List<ThrProductsAddDiResponse> filterThrProductsDiList(FilterThrProductsRequest filterThrProductsRequest) {
return thrProductsAddDiDao.filterThrProductsDiList(filterThrProductsRequest);
}
@Override
public List<ThrProductsAddDiEntity> filterThrProductsDiLists(FilterThrProductsRequest filterThrProductsRequest) {
return thrProductsAddDiDao.filterThrProductsDiLists(filterThrProductsRequest);
}
}

@ -25,19 +25,21 @@
<select id="filterList" parameterType="com.glxp.api.req.system.FilterPdfTemplateRelevanceRequest"
resultType="com.glxp.api.res.system.SystemPDFTemplateRelevanceResponse">
select basic_bussiness_type.`name` localActionName,
SELECT
basic_bustype_change.`originName` localActionName,
sys_pdf_template_relevance_biz.id,
basic_bussiness_type.action localAction,
basic_bustype_change.originAction localAction,
templateId,
moduleId,
sys_pdf_template.name templateName,
sys_pdf_template.NAME templateName,
sys_pdf_template_relevance_biz.remark1,
sys_pdf_template_relevance_biz.remark2,
sys_pdf_template_relevance_biz.remark3,
printType
from basic_bussiness_type
LEFT JOIN sys_pdf_template_relevance_biz on basic_bussiness_type.action = sys_pdf_template_relevance_biz.localAction
LEFT JOIN sys_pdf_template on sys_pdf_template_relevance_biz.templateId = sys_pdf_template.id
FROM
basic_bustype_change
LEFT JOIN sys_pdf_template_relevance_biz ON basic_bustype_change.originAction = sys_pdf_template_relevance_biz.localAction
LEFT JOIN sys_pdf_template ON sys_pdf_template_relevance_biz.templateId = sys_pdf_template.id
<where>
<if test="moduleId != null">
AND `moduleId` = #{moduleId}

@ -242,6 +242,25 @@
<if test="code != null">
AND tdi.code = #{code}
</if>
<if test="status != null">
AND tdi.status = #{status}
</if>
</where>
</select>
</select><select id="filterThrProductsDiLists" parameterType="com.glxp.api.req.thrsys.FilterThrProductsRequest"
resultType="com.glxp.api.entity.thrsys.ThrProductsAddDiEntity">
SELECT tdi.*
FROM thr_products_add_di tdi
<where>
<if test="thirdSysFk != null">
AND tdi.thirdSysFk = #{thirdSysFk}
</if>
<if test="code != null">
AND tdi.code = #{code}
</if>
<if test="status != null">
AND tdi.status = #{status}
</if>
</where>
</select>
</mapper>

@ -117,7 +117,11 @@ CALL Pro_Temp_ColumnWork('sup_cert_remind_msg', 'remindCount', 'int', 1);
CALL Pro_Temp_ColumnWork('sync_data_bustypes', 'orderStatus', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('sup_manufacturer', 'agentName', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('sys_pdf_module', 'modelKey', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('sys_pdf_template', 'bussinessType', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('sys_pdf_template', 'bussinessStatus', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'filePath', 'varchar(255)', 1);
INSERT ignore INTO `sys_scheduled`(`id`, `cronName`, `cron`, `customerId`, `remark`)
VALUES (100, 'clean_log_task', '0 0 2 1/1 * ? ', NULL, '删除日志数据');

Loading…
Cancel
Save