|
|
|
@ -13,11 +13,13 @@ import com.glxp.api.dao.basic.CompanyProductRelevanceDao;
|
|
|
|
|
import com.glxp.api.dao.basic.UdiRelevanceDao;
|
|
|
|
|
import com.glxp.api.dao.thrsys.ThrProductsAddDao;
|
|
|
|
|
import com.glxp.api.dao.thrsys.ThrProductsAddDiDao;
|
|
|
|
|
import com.glxp.api.entity.basic.CompanyProductRelevanceEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiProductEntity;
|
|
|
|
|
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrProductsAddDiEntity;
|
|
|
|
|
import com.glxp.api.req.sync.SpsSyncBasicRlRequest;
|
|
|
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
|
|
|
import com.glxp.api.service.basic.CompanyProductRelevanceService;
|
|
|
|
|
import com.glxp.api.service.basic.UdiProductService;
|
|
|
|
|
import com.glxp.api.service.thrsys.ThrProductsAddService;
|
|
|
|
|
import com.glxp.api.util.IntUtil;
|
|
|
|
@ -29,6 +31,8 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
|
|
|
|
@RestController
|
|
|
|
|
@Api(tags = "内网基础信息同步修改")
|
|
|
|
@ -42,6 +46,8 @@ public class SpsSyncBasicController {
|
|
|
|
|
private final UdiProductService udiProductService;
|
|
|
|
|
@Resource
|
|
|
|
|
ThrProductsAddDiDao thrProductsAddDiDao;
|
|
|
|
|
@Resource
|
|
|
|
|
CompanyProductRelevanceService companyProductRelevanceService;
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@PostMapping("/spssync/basic/udirl/update")
|
|
|
|
@ -64,6 +70,18 @@ public class SpsSyncBasicController {
|
|
|
|
|
thrProductsAddDiEntity.setRemark(udiProductEntity.getRemark());
|
|
|
|
|
thrProductsAddDiEntity.setStatus(2);
|
|
|
|
|
thrProductsAddDiDao.update(thrProductsAddDiEntity, new QueryWrapper<ThrProductsAddDiEntity>().eq("code", udiProductEntity.getRemark()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CompanyProductRelevanceEntity companyProductRelevanceEntity = new CompanyProductRelevanceEntity();
|
|
|
|
|
companyProductRelevanceEntity.setCustomerId(thrProductsAddDiEntity.getCustomerId() + "");
|
|
|
|
|
companyProductRelevanceEntity.setUdiRlIdFk(udiRelevanceEntity.getId());
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
if (b > 0)
|
|
|
|
|
return ResultVOUtils.success("更新成功!");
|
|
|
|
|