|
|
@ -10,6 +10,7 @@ import com.glxp.api.common.res.BaseResponse;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
import com.glxp.api.constant.ConstantStatus;
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
import com.glxp.api.entity.auth.AuthAdmin;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupCertEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupCertEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupCertSetEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
|
|
|
import com.glxp.api.entity.purchase.SupManufacturerEntity;
|
|
|
@ -105,14 +106,14 @@ public class SupProductController {
|
|
|
|
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
|
|
|
|
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
|
|
|
|
while (iterable.hasNext()) {
|
|
|
|
while (iterable.hasNext()) {
|
|
|
|
SupCertSetEntity supCertSetEntity = iterable.next();
|
|
|
|
SupCertSetEntity supCertSetEntity = iterable.next();
|
|
|
|
if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !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.getProductType()).equals(supCertSetEntity.getCplx()))
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) && (supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
for (SupCertEntity supCertEntity : supCertEntityList) {
|
|
|
|
for (SupCertEntity supCertEntity : supCertEntityList) {
|
|
|
|
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
|
|
|
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
|
|
@ -188,59 +189,59 @@ public class SupProductController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//判断是不是存在草稿
|
|
|
|
//判断是不是存在草稿
|
|
|
|
List<SupCertEntity> supCertEntityList1 = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId());
|
|
|
|
List<SupCertEntity> supCertEntityList1 = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId());
|
|
|
|
for(SupCertEntity obj:supCertEntityList1){
|
|
|
|
for (SupCertEntity obj : supCertEntityList1) {
|
|
|
|
if(obj.getAuditStatus()==0){
|
|
|
|
if (obj.getAuditStatus() == 0) {
|
|
|
|
return ResultVOUtils.error(999,"证书中存在草稿不允许提交!");
|
|
|
|
return ResultVOUtils.error(999, "证书中存在草稿不允许提交!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//提交审核
|
|
|
|
//提交审核
|
|
|
|
if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
|
|
|
|
if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_CHANGE || supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_UN) {
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否上级供应商是否审核通过
|
|
|
|
//判断是否上级供应商是否审核通过
|
|
|
|
|
|
|
|
|
|
|
|
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supProductEntity.getManufacturerIdFk());
|
|
|
|
SupManufacturerEntity supManufacturerEntity = supManufacturerService.findManufacturer(supProductEntity.getManufacturerIdFk());
|
|
|
|
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN
|
|
|
|
if (supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_UN
|
|
|
|
|| supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) {
|
|
|
|
|| supManufacturerEntity.getAuditStatus() == ConstantStatus.AUDIT_DRAFT) {
|
|
|
|
return ResultVOUtils.error(500, "所属生产企业资质未通过审核,暂时无法提交!");
|
|
|
|
return ResultVOUtils.error(500, "所属生产企业资质未通过审核,暂时无法提交!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//验证证书是否齐全
|
|
|
|
|
|
|
|
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
|
|
|
|
|
|
|
|
filterCertSetsRequest.setType(ConstantStatus.CERT_PRODUCT);
|
|
|
|
|
|
|
|
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()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
//验证证书是否齐全
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
FilterCertSetsRequest filterCertSetsRequest = new FilterCertSetsRequest();
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
filterCertSetsRequest.setType(ConstantStatus.CERT_PRODUCT);
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
List<SupCertSetEntity> supCertSetEntities = supCertSetService.filterCertSets(filterCertSetsRequest);
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
List<SupCertEntity> supCertEntityList = supCertService.findAll(supProductEntity.getCustomerId(), supProductEntity.getManufacturerIdFk(), supProductEntity.getProductId());
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getProductType()).equals(supCertSetEntity.getCplx()))
|
|
|
|
ListIterator<SupCertSetEntity> iterable = supCertSetEntities.listIterator();
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|
|
|
|
while (iterable.hasNext()) {
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
|
|
|
|
SupCertSetEntity supCertSetEntity = iterable.next();
|
|
|
|
) {
|
|
|
|
|
|
|
|
for (SupCertEntity supCertEntity : supCertEntityList) {
|
|
|
|
if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) {
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
iterable.remove();
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
break;
|
|
|
|
|| (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();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
iterable.remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String errMsg = "";
|
|
|
|
}
|
|
|
|
if (supCertSetEntities.size() > 0) {
|
|
|
|
String errMsg = "";
|
|
|
|
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
|
|
|
|
if (supCertSetEntities.size() > 0) {
|
|
|
|
errMsg = errMsg + "," + supCertSetEntity.getName();
|
|
|
|
for (SupCertSetEntity supCertSetEntity : supCertSetEntities) {
|
|
|
|
}
|
|
|
|
errMsg = errMsg + "," + supCertSetEntity.getName();
|
|
|
|
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResultVOUtils.error(500, errMsg.substring(1) + "等证书未上传,无法提交审核!");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
supProductEntity.setUpdateTime(new Date());
|
|
|
|
supProductEntity.setUpdateTime(new Date());
|
|
|
@ -263,7 +264,7 @@ public class SupProductController {
|
|
|
|
if (supProductEntity.getAuditStatus() == null) {
|
|
|
|
if (supProductEntity.getAuditStatus() == null) {
|
|
|
|
return ResultVOUtils.error(500, "参数错误!");
|
|
|
|
return ResultVOUtils.error(500, "参数错误!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(supProductEntity.getAuditStatus()==1){
|
|
|
|
if (supProductEntity.getAuditStatus() == 1) {
|
|
|
|
//查询用户上传的证书
|
|
|
|
//查询用户上传的证书
|
|
|
|
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
|
|
|
FilterSupCertRequest filterSupCertRequest = new FilterSupCertRequest();
|
|
|
|
filterSupCertRequest.setCustomerId(supProductEntity.getCustomerId());
|
|
|
|
filterSupCertRequest.setCustomerId(supProductEntity.getCustomerId());
|
|
|
@ -281,14 +282,14 @@ public class SupProductController {
|
|
|
|
while (iterable.hasNext()) {
|
|
|
|
while (iterable.hasNext()) {
|
|
|
|
SupCertSetEntity supCertSetEntity = iterable.next();
|
|
|
|
SupCertSetEntity supCertSetEntity = iterable.next();
|
|
|
|
|
|
|
|
|
|
|
|
if (supCertSetEntity.getImports()!=null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
if (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 1 || StrUtil.isNotEmpty(supCertSetEntity.getCplx()) && supCertSetEntity.getCplx().equals("全部")
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getHchzsb()) && supCertSetEntity.getHchzsb().equals("全部")
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 2
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
&& StrUtil.trimToEmpty(supProductEntity.getRecordCode()).contains("进"))
|
|
|
|
|| (supCertSetEntity.getImports() != null && supCertSetEntity.getImports() == 3 && !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.getProductType()).equals(supCertSetEntity.getCplx()))
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|
|
|
|
|| (StrUtil.trimToEmpty(supProductEntity.getHchzsb()).equals(supCertSetEntity.getHchzsb()))
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) &&(supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
|
|
|
|
|| StrUtil.isNotEmpty(supCertSetEntity.getFlbm()) && (supCertSetEntity.getFlbm().contains(StrUtil.trimToEmpty(supProductEntity.getProductDirectoryCode())))
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
for (SupCertEntity supCertEntity : supCertEntityList) {
|
|
|
|
for (SupCertEntity supCertEntity : supCertEntityList) {
|
|
|
|
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
|
|
|
if (supCertEntity.getName().equals(supCertSetEntity.getName())) {
|
|
|
@ -334,6 +335,14 @@ public class SupProductController {
|
|
|
|
|
|
|
|
|
|
|
|
supProductEntity.setUpdateTime(new Date());
|
|
|
|
supProductEntity.setUpdateTime(new Date());
|
|
|
|
boolean b = supProductService.modifyRegistration(supProductEntity);
|
|
|
|
boolean b = supProductService.modifyRegistration(supProductEntity);
|
|
|
|
|
|
|
|
if (StrUtil.isNotEmpty(supProductEntity.getRelIdFk())) {
|
|
|
|
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(Long.parseLong(supProductEntity.getRelIdFk()));
|
|
|
|
|
|
|
|
if (udiRelevanceEntity != null) {
|
|
|
|
|
|
|
|
udiRelevanceEntity.setDispatch(true);
|
|
|
|
|
|
|
|
udiRelevanceService.updateUdiRelevance(udiRelevanceEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS) {
|
|
|
|
// if (supProductEntity.getAuditStatus() == ConstantStatus.AUDIT_PASS) {
|
|
|
|
// SupProductResponse supProductResponse = supProductService.findJoinRegistration(supProductEntity.getId());
|
|
|
|
// SupProductResponse supProductResponse = supProductService.findJoinRegistration(supProductEntity.getId());
|
|
|
|