产品信息维护问题

dev_unify
yewj 8 months ago
parent 07d2029e96
commit 7204aac90e

@ -293,7 +293,7 @@ public class UdiRlSupController extends BaseController {
udiProductEntity.setUpdateTime(new Date()); udiProductEntity.setUpdateTime(new Date());
UdiRelevanceEntity udiRelevanceEntity1 = udiRelevanceService.selectById(Long.valueOf(rlidStr)); UdiRelevanceEntity udiRelevanceEntity1 = udiRelevanceService.selectById(Long.valueOf(rlidStr));
UdiProductEntity byUuid = udiProductService.findByUuid(udiRelevanceEntity1.getUuid()); UdiProductEntity byUuid = udiProductService.findByUuid(udiRelevanceEntity1.getUuid());
if (byUuid != null){ if (byUuid != null) {
byUuid.setCatalogname1(udiProductEntity.getCatalogname1()); byUuid.setCatalogname1(udiProductEntity.getCatalogname1());
byUuid.setCatalogname2(udiProductEntity.getCatalogname2()); byUuid.setCatalogname2(udiProductEntity.getCatalogname2());
byUuid.setCatalogname3(udiProductEntity.getCatalogname3()); byUuid.setCatalogname3(udiProductEntity.getCatalogname3());
@ -301,7 +301,7 @@ public class UdiRlSupController extends BaseController {
byUuid.setManufactory(udiProductEntity.getManufactory()); byUuid.setManufactory(udiProductEntity.getManufactory());
byUuid.setUpdateTime(new Date()); byUuid.setUpdateTime(new Date());
udiProductService.updateUdiInfo(byUuid); udiProductService.updateUdiInfo(byUuid);
}else { } else {
udiProductEntity.setId(IdUtil.getSnowflakeNextId()); udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity); udiProductService.insertUdiInfo(udiProductEntity);
} }
@ -309,9 +309,9 @@ public class UdiRlSupController extends BaseController {
try { try {
CodeRel codeRel = new CodeRel(); CodeRel codeRel = new CodeRel();
if(udiProductEntity.getProductsType() == null || udiProductEntity.getProductsType() == 1){ if (udiProductEntity.getProductsType() == null || udiProductEntity.getProductsType() == 1) {
codeRel.setDiNameCode(udiProductEntity.getNameCode()); codeRel.setDiNameCode(udiProductEntity.getNameCode());
}else { } else {
codeRel.setDrugCode(udiProductEntity.getNameCode()); codeRel.setDrugCode(udiProductEntity.getNameCode());
} }
codeRel.setYbbm(udiProductEntity.getYbbm()); codeRel.setYbbm(udiProductEntity.getYbbm());
@ -319,8 +319,8 @@ public class UdiRlSupController extends BaseController {
codeRel.setTyshxyh(udiProductEntity.getTyshxydm()); codeRel.setTyshxyh(udiProductEntity.getTyshxydm());
codeRel.setUpdateTime(new Date()); codeRel.setUpdateTime(new Date());
erpBasicClient.updateCodeRelDetail(codeRel); erpBasicClient.updateCodeRelDetail(codeRel);
}catch (Exception e){ } catch (Exception e) {
System.out.println("上传多码融合:"+e); System.out.println("上传多码融合:" + e);
} }
return ResultVOUtils.success("选入成功!"); return ResultVOUtils.success("选入成功!");
@ -365,10 +365,28 @@ public class UdiRlSupController extends BaseController {
BeanUtil.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiProductEntity); BeanUtil.copyProperties(udiInfoExportRequest.getSupplementRequest(), udiProductEntity);
//处理是否需要扫码字段 //处理是否需要扫码字段
classifyCodeService.updateRequireScanCode(udiProductEntity); classifyCodeService.updateRequireScanCode(udiProductEntity);
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity); udiProductEntity.setUpdateTime(new Date());
UdiRelevanceEntity udiRelevanceEntity1 = udiRelevanceService.selectById(Long.valueOf(rlidStr));
UdiProductEntity byUuid = udiProductService.findByUuid(udiRelevanceEntity1.getUuid());
if (byUuid != null) {
byUuid.setCatalogname1(udiProductEntity.getCatalogname1());
byUuid.setCatalogname2(udiProductEntity.getCatalogname2());
byUuid.setCatalogname3(udiProductEntity.getCatalogname3());
byUuid.setDetailSort(udiProductEntity.getDetailSort());
byUuid.setYbbm(udiProductEntity.getYbbm());
byUuid.setManufactory(udiProductEntity.getManufactory());
byUuid.setUpdateTime(new Date());
udiProductService.updateUdiInfo(byUuid);
} else {
udiProductEntity.setId(IdUtil.getSnowflakeNextId());
udiProductService.insertUdiInfo(udiProductEntity);
}
return ResultVOUtils.success("选入成功!"); return ResultVOUtils.success("选入成功!");
} }
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/sale/info/updateCompanyProductRelevance") @PostMapping("/sale/info/updateCompanyProductRelevance")
@Log(title = "单据管理", businessType = BusinessType.UPDATE) @Log(title = "单据管理", businessType = BusinessType.UPDATE)

@ -143,4 +143,26 @@ public class ThirdAliDrug implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
this.approvalNum = approvalNum; this.approvalNum = approvalNum;
} }
@Override
public String toString() {
return "ThirdAliDrug{" +
"id=" + id +
", type='" + type + '\'' +
", manufacturer='" + manufacturer + '\'' +
", cpmctymc='" + cpmctymc + '\'' +
", form='" + form + '\'' +
", formSpec='" + formSpec + '\'' +
", bzgg='" + bzgg + '\'' +
", spmc='" + spmc + '\'' +
", nameCode='" + nameCode + '\'' +
", packRatio='" + packRatio + '\'' +
", packLevel='" + packLevel + '\'' +
", erpId='" + erpId + '\'' +
", approvalNum='" + approvalNum + '\'' +
", createTime=" + createTime +
", updateTime=" + updateTime +
'}';
}
} }

@ -23,10 +23,12 @@ import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.service.thrsys.YbDrugService; import com.glxp.api.service.thrsys.YbDrugService;
import com.glxp.api.util.*; import com.glxp.api.util.*;
import com.glxp.api.util.udi.UdiInfoUtil; import com.glxp.api.util.udi.UdiInfoUtil;
import org.jfree.util.Log;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -277,9 +279,18 @@ public class UdiContrastService {
if (CollUtil.isNotEmpty(thirdAliDrugList)) { if (CollUtil.isNotEmpty(thirdAliDrugList)) {
for (int i = 0; i < thirdAliDrugList.size(); i++) { for (int i = 0; i < thirdAliDrugList.size(); i++) {
ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i); ThirdAliDrug thirdAliDrug = thirdAliDrugList.get(i);
List<Integer> integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio()); List<Integer> integers = new ArrayList<>();
if (StrUtil.isNotEmpty(thirdAliDrug.getPackRatio())) {
integers = DimaUtil.calculateLevels(thirdAliDrug.getPackRatio());
}
udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel()); udiProductEntity.setPackLevel(thirdAliDrug.getPackLevel());
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1)); try {
udiProductEntity.setBhxjsl(integers.get(IntUtil.value(thirdAliDrug.getPackLevel()) - 1));
} catch (IndexOutOfBoundsException e) {
e.printStackTrace();
Log.error("计算包装级别出错" + thirdAliDrug.getPackLevel() + "---" + integers + "-----" + thirdAliDrug.toString());
}
udiProductEntity.setNameCode(thirdAliDrug.getNameCode()); udiProductEntity.setNameCode(thirdAliDrug.getNameCode());
if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) { if (IntUtil.value(thirdAliDrug.getPackLevel()) == 1) {
udiProductEntity.setXjdw(ybDrug.getMinUnit()); udiProductEntity.setXjdw(ybDrug.getMinUnit());

@ -418,12 +418,12 @@ public class UdiRelevanceServiceImpl extends ServiceImpl<UdiRelevanceDao, UdiRel
@Override @Override
public UdiRelevanceEntity insertDefaultLevel(UdiRelevanceEntity udiRelevanceEntity, UdiProductEntity udiProductEntity) { public UdiRelevanceEntity insertDefaultLevel(UdiRelevanceEntity udiRelevanceEntity, UdiProductEntity udiProductEntity) {
if (udiProductEntity != null) { if (udiProductEntity != null) {
udiRelevanceEntity.setDistributeLevel(IntUtil.value(udiProductEntity.getPackLevel())); udiRelevanceEntity.setDistributeLevel(1);
// udiRelevanceEntity.setDistributeLevelDi(udiProductEntity.getNameCode()); // udiRelevanceEntity.setDistributeLevelDi(udiProductEntity.getNameCode());
// udiRelevanceEntity.setDistributeLevelUnit(udiProductEntity.getPackUnit()); // udiRelevanceEntity.setDistributeLevelUnit(udiProductEntity.getPackUnit());
// udiRelevanceEntity.setDistributeLevelCount(IntUtil.value(udiProductEntity.getBhxjsl())); // udiRelevanceEntity.setDistributeLevelCount(IntUtil.value(udiProductEntity.getBhxjsl()));
udiRelevanceEntity.setUseLevel(IntUtil.value(udiProductEntity.getPackLevel())); udiRelevanceEntity.setUseLevel(0);
// udiRelevanceEntity.setUseLevelDi(udiProductEntity.getNameCode()); // udiRelevanceEntity.setUseLevelDi(udiProductEntity.getNameCode());
// udiRelevanceEntity.setUseLevelUnit(udiProductEntity.getPackUnit()); // udiRelevanceEntity.setUseLevelUnit(udiProductEntity.getPackUnit());
// udiRelevanceEntity.setUseLeverCount(IntUtil.value(udiProductEntity.getBhxjsl())); // udiRelevanceEntity.setUseLeverCount(IntUtil.value(udiProductEntity.getBhxjsl()));

@ -524,7 +524,6 @@
<if test="basicPrductRemak8 != null"> <if test="basicPrductRemak8 != null">
basicPrductRemak8=#{basicPrductRemak8}, basicPrductRemak8=#{basicPrductRemak8},
</if> </if>
<if test="sfwblztlcp != null"> <if test="sfwblztlcp != null">
sfwblztlcp=#{sfwblztlcp}, sfwblztlcp=#{sfwblztlcp},
</if> </if>
@ -591,6 +590,18 @@
<if test="packMatrial != null"> <if test="packMatrial != null">
packMatrial=#{packMatrial}, packMatrial=#{packMatrial},
</if> </if>
<if test="catalogname3 != null">
catalogname3=#{catalogname3},
</if>
<if test="catalogname1 != null">
catalogname1=#{catalogname1},
</if>
<if test="catalogname2 != null">
catalogname2=#{catalogname2},
</if>
<if test="detailSort != null">
detailSort=#{detailSort},
</if>
</trim> </trim>
WHERE nameCode = #{nameCode} WHERE nameCode = #{nameCode}
and uuid = #{uuid} and uuid = #{uuid}

@ -270,6 +270,7 @@
</foreach> </foreach>
</if> </if>
</where> </where>
GROUP BY basic_udirel.id
ORDER BY company_product_relevance.updateTime DESC ORDER BY company_product_relevance.updateTime DESC
</select> </select>

Loading…
Cancel
Save