|
|
|
@ -10,6 +10,7 @@ import com.spring.common.utils.PageUtils; |
|
|
|
import com.spring.modules.base.data.PartSubPropertiesValueData; |
|
|
|
import com.spring.modules.base.data.PartSubPropertiesValueHeaderData; |
|
|
|
import com.spring.modules.base.data.PlmPropertiesItemAvailableData; |
|
|
|
import com.spring.modules.base.utils.HttpClientUtil; |
|
|
|
import com.spring.modules.oss.dao.SysOssDao; |
|
|
|
import com.spring.modules.oss.service.SysOssService; |
|
|
|
import com.spring.modules.part.entity.AgentInformationEntity; |
|
|
|
@ -21,18 +22,24 @@ import com.spring.modules.part.vo.PartInformationVo; |
|
|
|
import com.spring.modules.project.data.PlmProjectPartData; |
|
|
|
import com.spring.modules.quotation.entity.QuotationInformationEntity; |
|
|
|
import com.spring.modules.quotation.vo.QuotationInformationVo; |
|
|
|
import com.spring.modules.report.dao.ProcedureDao; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.StringUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class PartInformationServiceImpl extends ServiceImpl<PartInformationMapper, PartInformationEntity> implements PartInformationService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ProcedureDao procedureDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private PartInformationMapper partInformationMapper; |
|
|
|
|
|
|
|
@ -66,11 +73,54 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
* @return: void |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void partInformationSave(PartInformationEntity data) { |
|
|
|
// 获取材料编码 |
|
|
|
// String partNo = partInformationMapper.getPartNo(data); |
|
|
|
// data.setPartNo("P" + partNo); |
|
|
|
// 调用存储过程校验参数 |
|
|
|
Map<String, Object> resultMap = this.checkSavePart(data); |
|
|
|
// 判断是否检验成功 |
|
|
|
String code = String.valueOf(resultMap.get("resultCode")); |
|
|
|
if ("600".equalsIgnoreCase(code)) { |
|
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
|
} |
|
|
|
partInformationMapper.insert(data); |
|
|
|
// 同步 |
|
|
|
//HttpClientUtil.doPostByRawWithPLM(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 物料新增校验参数 |
|
|
|
* @param inData |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Map<String, Object> checkSavePart(PartInformationEntity inData){ |
|
|
|
// 公共参数 |
|
|
|
String site = inData.getSite(); |
|
|
|
String partNo = inData.getPartNo(); |
|
|
|
String codeNo = inData.getCodeNo(); |
|
|
|
String functionType = "B"; |
|
|
|
String umId = inData.getUmId(); |
|
|
|
String familyId = inData.getFamilyId(); |
|
|
|
String groupId = inData.getGroupId(); |
|
|
|
String productGroupId1 = inData.getProductGroupId1() == null ? "" : inData.getProductGroupId1(); |
|
|
|
String productGroupId2 = inData.getProductGroupId2() == null ? "" : inData.getProductGroupId2(); |
|
|
|
String productGroupId3 = inData.getProductGroupId3(); |
|
|
|
String productGroupId4 = inData.getProductGroupId4(); |
|
|
|
List<Object> params = new ArrayList<>(); |
|
|
|
params.add(site); |
|
|
|
params.add(partNo); |
|
|
|
params.add(codeNo); |
|
|
|
params.add(functionType); |
|
|
|
params.add(umId); |
|
|
|
params.add(familyId); |
|
|
|
params.add(groupId); |
|
|
|
params.add(productGroupId1); |
|
|
|
params.add(productGroupId2); |
|
|
|
params.add(productGroupId3); |
|
|
|
params.add(productGroupId4); |
|
|
|
// 执行方法 |
|
|
|
List<Map<String, Object>> resultList = procedureDao.getProcedureData("checkSavePart", params); |
|
|
|
return resultList.get(0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
@ -81,7 +131,16 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
* @return: void |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public void partInformationEdit(PartInformationEntity data) { |
|
|
|
// 调用存储过程校验参数 |
|
|
|
Map<String, Object> resultMap = this.checkUpdatePart(data); |
|
|
|
// 判断是否检验成功 |
|
|
|
String code = String.valueOf(resultMap.get("resultCode")); |
|
|
|
if ("600".equalsIgnoreCase(code)) { |
|
|
|
String msg = String.valueOf(resultMap.get("resultMsg")); |
|
|
|
throw new XJException(msg, Integer.parseInt(code)); |
|
|
|
} |
|
|
|
// 编辑材料信息 |
|
|
|
UpdateWrapper<PartInformationEntity> updateInformationWrapper = new UpdateWrapper<>(); |
|
|
|
updateInformationWrapper.eq("site", data.getSite()); |
|
|
|
@ -89,6 +148,41 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe |
|
|
|
partInformationMapper.update(data, updateInformationWrapper); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 物料编辑校验参数 |
|
|
|
* @param inData |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public Map<String, Object> checkUpdatePart(PartInformationEntity inData){ |
|
|
|
// 公共参数 |
|
|
|
String site = inData.getSite(); |
|
|
|
String partNo = inData.getPartNo(); |
|
|
|
String codeNo = inData.getCodeNo(); |
|
|
|
String functionType = "B"; |
|
|
|
String umId = inData.getUmId(); |
|
|
|
String familyId = inData.getFamilyId(); |
|
|
|
String groupId = inData.getGroupId(); |
|
|
|
String productGroupId1 = inData.getProductGroupId1() == null ? "" : inData.getProductGroupId1(); |
|
|
|
String productGroupId2 = inData.getProductGroupId2() == null ? "" : inData.getProductGroupId2(); |
|
|
|
String productGroupId3 = inData.getProductGroupId3(); |
|
|
|
String productGroupId4 = inData.getProductGroupId4(); |
|
|
|
List<Object> params = new ArrayList<>(); |
|
|
|
params.add(site); |
|
|
|
params.add(partNo); |
|
|
|
params.add(codeNo); |
|
|
|
params.add(functionType); |
|
|
|
params.add(umId); |
|
|
|
params.add(familyId); |
|
|
|
params.add(groupId); |
|
|
|
params.add(productGroupId1); |
|
|
|
params.add(productGroupId2); |
|
|
|
params.add(productGroupId3); |
|
|
|
params.add(productGroupId4); |
|
|
|
// 执行方法 |
|
|
|
List<Map<String, Object>> resultList = procedureDao.getProcedureData("checkUpdatePart", params); |
|
|
|
return resultList.get(0); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @description: 材料信息删除 |
|
|
|
* @author: fengyuan_yang |
|
|
|
|