改采购管理bug

zhairh
zhengmingliang 3 years ago
parent 1424110868
commit 748055cf2d

@ -105,6 +105,7 @@ public class PurPlanController {
PurPlanDetailEntity purApplyDetailEntity = new PurPlanDetailEntity();
BeanUtils.copyProperties(stockOrderDetailEntity, purApplyDetailEntity);
purApplyDetailEntity.setOrderIdFk(purApplyEntity.getId() + "");
purApplyDetailEntity.setCount(Integer.valueOf(stockOrderDetailEntity.getCount()));
purPlanDetailService.insert(purApplyDetailEntity);
purPlanDetailEntities.add(purApplyDetailEntity);
}

@ -37,6 +37,7 @@ public class SupCertSetController {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertEntityList
= supCertSetService.filterCertSets(filterCertSetsRequest);
PageInfo<SupCertSetEntity> pageInfo;
@ -54,7 +55,14 @@ public class SupCertSetController {
if (supCertSetEntity == null) {
supCertSetEntity = new SupCertSetEntity();
}
supCertSetEntity.setUpdateTime(new Date());
if(supCertSetEntity.getType()==3){
if(supCertSetEntity.getFlbmList().size()>0){
String flbm = String.join(",", supCertSetEntity.getFlbmList());
supCertSetEntity.setFlbm(flbm);
}
}
boolean b = supCertSetService.insertCertSet(supCertSetEntity);
return ResultVOUtils.success("添加成功!");
}

@ -94,6 +94,73 @@ public class SupManufacturerController {
supManufacturerEntity.setCustomerId(customerId);
}
supManufacturerEntity.setCreateTime(new Date());
supManufacturerEntity.setUpdateTime(new Date());
//提交审核
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
//判断是否上级供应商是否审核通过
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId());
if (supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN
|| supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) {
return ResultVOUtils.error(500, "所属配送企业资质未通过审核,暂时无法提交!");
}
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
if (supCertSetEntity.isNeed()
||
(!supCertSetEntity.isNeed() &&
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(!supCertSetEntity.isNeed() &&
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(!supCertSetEntity.isNeed()
&& supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
(!supCertSetEntity.isNeed()
&& supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supManufacturerEntity.setCreateTime(new Date());
supManufacturerEntity.setUpdateTime(new Date());
boolean b = supManufacturerService.insertCompany(supManufacturerEntity);
@ -112,7 +179,7 @@ public class SupManufacturerController {
return ResultVOUtils.error(500, "参数错误!");
}
//提交审核
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
//判断是否上级供应商是否审核通过
SupCompanyEntity supCompanyEntity = supCompanyService.findCompany(supManufacturerEntity.getCustomerId());
if (supCompanyEntity.getAuditStatus() == ConstantStatus.AUDIT_UN
@ -123,6 +190,7 @@ public class SupManufacturerController {
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_MANUFACTURER);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supManufacturerEntity.getCustomerId(), supManufacturerEntity.getManufacturerId());
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
@ -134,11 +202,19 @@ public class SupManufacturerController {
(!supCertSetEntity.isNeed() &&
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 2
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(!supCertSetEntity.isNeed() &&
supCertSetEntity.getForeign() != null && supCertSetEntity.getForeign() == 1
&& StrUtil.trimToEmpty(supManufacturerEntity.getCompanyType()).equals("2"))
||
(!supCertSetEntity.isNeed()
&& supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 1
&& supManufacturerEntity.getCompanyType().equals("1"))
||
(!supCertSetEntity.isNeed()
&& supCertSetEntity.getForeign() != null
&& supCertSetEntity.getForeign() == 3
&& supManufacturerEntity.getCompanyType().equals("1"))) {
for (SupCertEntity supCertEntity : supCertEntityList) {

@ -97,6 +97,55 @@ public class SupProductController {
@AuthRuleAnnotation("")
@PostMapping("/sup/product/addRegistration")
public BaseResponse addRegistration(@RequestBody SupProductEntity supProductEntity) {
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
//提交审核
if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
//判断是否上级供应商是否审核通过
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supProductEntity.getManufacturerIdFk());
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN
|| supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) {
return ResultVOUtils.error(500, "所属生产企业资质未通过审核,暂时无法提交!");
}
//验证证书是否齐全
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
filterCertSetsRequest.setType(ConstantStatus.CERT_PRODUCT);
filterCertSetsRequest.setNeed(0);
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
List<SupCertEntity> supCertEntityList = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId());
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
while (iterable.hasNext()) {
SupCertSetEntity supCertSetEntity = iterable.next();
if (supCertSetEntity.getImports() == 1|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|| (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx()))
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
) {
for (SupCertEntity supCertEntity : supCertEntityList) {
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
iterable.remove();
break;
}
}
}
} else {
iterable.remove();
}
}
String errMsg = "";
if (supCertSetEntities.size() > 0) {
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
errMsg = errMsg + "," + supCertSetEntity.getName();
}
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
}
}
supProductEntity.setCreateTime(new Date());
supProductEntity.setUpdateTime(new Date());
boolean b = supProductService.insertRegistration(supProductEntity);

@ -19,7 +19,7 @@ public interface PurApplyDetailDao {
Boolean update(PurApplyDetailEntity purApplyRequest);
Boolean deleteByIds(List<Long> ids);
Boolean deleteByIds(@Param("ids") List<Long> ids);
Boolean deleteByOrderId(@Param("orderIdFk") String orderIdFk);

@ -93,6 +93,8 @@ public class PurApplyRequest extends ListPageRequest {
*/
private Date createTime;
private String auditRemark;
private String targetInv;
private String targetSubInv;

@ -24,7 +24,7 @@
and ( pur_apply.status = 3 or pur_apply.status=2 or pur_apply.status=4)
</if>
<if test="status ==11">
and ( pur_apply.status = 1 or pur_apply.status=2)
and ( pur_apply.status = 1 or pur_apply.status=2 or pur_apply.status=4)
</if>
<if test="deptCode != '' and deptCode != null">

@ -25,7 +25,7 @@
and ( pur_plan.status = 3 or pur_plan.status=2 or pur_plan.status=4)
</if>
<if test="status ==11">
and ( pur_plan.status = 1 or pur_plan.status=2)
and ( pur_plan.status = 1 or pur_plan.status=2 or pur_plan.status=4)
</if>
<if test="deptCode != '' and deptCode != null">

@ -10,10 +10,10 @@
<if test="name != '' and name!=null">
and `name` = #{name}
</if>
<if test="type != '' and type!=null">
<if test="type!=null">
and `type` = #{type}
</if>
<if test="need != '' and need!=null">
<if test="need!=null">
and `need` = #{need}
</if>
</where>

@ -23,7 +23,7 @@
and companyName like concat('%',#{companyName},'%')
</if>
<if test="creditNum != null and creditNum != ''">
and creditNum like ('%',#{creditNum},'%')
and creditNum like concat('%',#{creditNum},'%')
</if>
<if test="auditStatus != null and auditStatus !=20 and auditStatus !=21 and auditStatus !=22">
and auditStatus = #{auditStatus}

@ -19,7 +19,7 @@
<select id="getCompany" parameterType="com.glxp.sale.admin.req.purchase.FilterSupManufacturerRequest"
resultType="com.glxp.sale.admin.entity.purchase.SupManufacturerEntity">
SELECT sup_manufacturer.* ,company.companyName supName FROM sup_manufacturer
SELECT sup_manufacturer.* ,company.companyName as supName FROM sup_manufacturer
inner join company on sup_manufacturer.customerId = company.customerId
<where>
<if test="id != null and id != ''">

Loading…
Cancel
Save