物资资质新增--新增配送产品资质信息

dev
黄泽腾 2 years ago
parent 24739fb392
commit 99506e1f40

@ -140,6 +140,9 @@ public class SupProductController {
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
int i = supProductService.findProduct(supProductEntity);
System.out.println(i);
if (i == 0) {
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setId(IdUtil.getSnowflakeNextId());
@ -148,6 +151,8 @@ public class SupProductController {
return ResultVOUtils.success("添加成功");
} else {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}} else {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT);
}
}
@ -158,27 +163,27 @@ public class SupProductController {
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectUdiId(Long.valueOf(selectProductBindRequest.getRelIdFk()));
SupProductEntity supProductEntity = supProductService.findByManufactury(udiRelevanceResponse.getCpmctymc(), udiRelevanceResponse.getManufactory(), selectProductBindRequest.getManufacturerId());
if (supProductEntity != null) {
return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!");
} else {
supProductEntity = new SupProductEntity();
BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity);
supProductEntity.setProductId(selectProductBindRequest.getProductId());
supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh());
supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + "");
supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc());
supProductEntity.setProductType(udiRelevanceResponse.getQxlb());
supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm());
supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc());
supProductEntity.setSpecification(udiRelevanceResponse.getGgxh());
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId());
supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId());
supProductEntity.setHchzsb(udiRelevanceResponse.getCplb());
supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName());
supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus());
}
// if (supProductEntity != null) {
// return ResultVOUtils.error(500, "该产品资质已存在,请勿重复添加!");
// } else {
supProductEntity = new SupProductEntity();
BeanUtils.copyProperties(udiRelevanceResponse, supProductEntity);
supProductEntity.setProductId(selectProductBindRequest.getProductId());
supProductEntity.setRecordCode(udiRelevanceResponse.getZczbhhzbapzbh());
supProductEntity.setRelIdFk(udiRelevanceResponse.getId() + "");
supProductEntity.setRecordProductName(udiRelevanceResponse.getCpmctymc());
supProductEntity.setProductType(udiRelevanceResponse.getQxlb());
supProductEntity.setProductDirectoryCode(udiRelevanceResponse.getFlbm());
supProductEntity.setRecordPeopleName(udiRelevanceResponse.getYlqxzcrbarmc());
supProductEntity.setSpecification(udiRelevanceResponse.getGgxh());
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
supProductEntity.setManufacturerIdFk(selectProductBindRequest.getManufacturerId());
supProductEntity.setCustomerId(selectProductBindRequest.getCustomerId());
supProductEntity.setHchzsb(udiRelevanceResponse.getCplb());
supProductEntity.setCompanyName(selectProductBindRequest.getCompanyName());
supProductEntity.setAuditStatus(selectProductBindRequest.getAuditStatus());
// }
return ResultVOUtils.success(supProductEntity);

@ -16,7 +16,7 @@ import java.util.List;
public interface SupProductDao extends BaseMapperPlus<SupProductDao, SupProductEntity, SupProductEntity> {
SupProductEntity findRegistration(Long id);
int findProduct(SupProductEntity supProductEntity);
SupProductEntity findRegistrationByName(String recordProductName);
List<SupProductResponse> getRegistration(FilterPoductRequest filterPoductRequest);

@ -35,7 +35,7 @@ public interface SupProductService extends IService<SupProductEntity> {
boolean modifyRegistration(SupProductEntity supProductEntity);
boolean insertRegistration(SupProductEntity supProductEntity);
int findProduct(SupProductEntity supProductEntity);
boolean deleteById(@Param("id") String id);
boolean deleteByEnterpriseId(@Param("enterpriseId") String enterpriseId);

@ -147,7 +147,10 @@ public class SupProductServiceImpl extends ServiceImpl<SupProductDao, SupProduct
public boolean insertRegistration(SupProductEntity companyEntity) {
return supProductDao.insert(companyEntity) > 0 ? true : false;
}
@Override
public int findProduct(SupProductEntity supProductEntity) {
return supProductDao.findProduct(supProductEntity);
}
@Override
public boolean deleteById(String id) {
return supProductDao.deleteById(id);

@ -377,7 +377,18 @@
#{hchzsb}, #{relIdFk}, #{manufactory}, #{allowNoBatch}, #{allowNoExpire}, #{allowNoProduct},
#{allowNoSerial})
</insert>
<select id="findProduct" parameterType="com.glxp.api.entity.purchase.SupProductEntity"
resultType="java.lang.Integer" >
SELECT count(*)
FROM sup_product
inner join sup_company
on sup_product.customerId = sup_company.customerId
INNER JOIN sup_manufacturer
on sup_manufacturer.manufacturerId =
sup_product.manufacturerIdFk
WHERE sup_manufacturer.companyName=(SELECT companyName FROM sup_manufacturer WHERE manufacturerId = #{manufacturerIdFk})
and recordCode=#{recordCode} and recordProductName=#{recordProductName}
</select>
<delete id="deleteById" parameterType="Map">
DELETE
FROM sup_product

Loading…
Cancel
Save