|
@@ -11,22 +11,27 @@ import com.platform.common.model.UserInfo;
|
|
import com.platform.common.util.*;
|
|
import com.platform.common.util.*;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.dto.project.ProjectDTO;
|
|
import com.platform.dao.dto.project.ProjectDTO;
|
|
|
|
+import com.platform.dao.dto.sb.SbModelSpareBomDTO;
|
|
import com.platform.dao.dto.store.OutStoreDetailDTO;
|
|
import com.platform.dao.dto.store.OutStoreDetailDTO;
|
|
import com.platform.dao.dto.store.OutStoreFormDTO;
|
|
import com.platform.dao.dto.store.OutStoreFormDTO;
|
|
import com.platform.dao.dto.store.SparePickFormDTO;
|
|
import com.platform.dao.dto.store.SparePickFormDTO;
|
|
import com.platform.dao.entity.project.Project;
|
|
import com.platform.dao.entity.project.Project;
|
|
import com.platform.dao.entity.repair.RepairApplicationForm;
|
|
import com.platform.dao.entity.repair.RepairApplicationForm;
|
|
|
|
+import com.platform.dao.entity.sb.SbInfo;
|
|
|
|
+import com.platform.dao.entity.sb.SbModelSpareBom;
|
|
import com.platform.dao.entity.sb.SbOil;
|
|
import com.platform.dao.entity.sb.SbOil;
|
|
import com.platform.dao.entity.store.*;
|
|
import com.platform.dao.entity.store.*;
|
|
import com.platform.dao.enums.*;
|
|
import com.platform.dao.enums.*;
|
|
import com.platform.dao.mapper.project.ProjectMapper;
|
|
import com.platform.dao.mapper.project.ProjectMapper;
|
|
import com.platform.dao.mapper.repair.RepairApplicationFormMapper;
|
|
import com.platform.dao.mapper.repair.RepairApplicationFormMapper;
|
|
import com.platform.dao.mapper.sb.SbInfoMapper;
|
|
import com.platform.dao.mapper.sb.SbInfoMapper;
|
|
|
|
+import com.platform.dao.mapper.sb.SbModelSpareBomMapper;
|
|
import com.platform.dao.mapper.sb.SbPositionMapper;
|
|
import com.platform.dao.mapper.sb.SbPositionMapper;
|
|
import com.platform.dao.mapper.store.*;
|
|
import com.platform.dao.mapper.store.*;
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
import com.platform.dao.vo.query.project.ProjectVO;
|
|
import com.platform.dao.vo.query.project.ProjectVO;
|
|
import com.platform.dao.vo.query.store.*;
|
|
import com.platform.dao.vo.query.store.*;
|
|
|
|
+import com.platform.dao.vo.sb.SbModelSpareBomVO;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
import com.platform.service.store.OutStoreDetailService;
|
|
import com.platform.service.store.OutStoreDetailService;
|
|
@@ -71,6 +76,7 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
private SysUserRoleService sysUserService;
|
|
private SysUserRoleService sysUserService;
|
|
private OutStoreDetailService outStoreDetailService;
|
|
private OutStoreDetailService outStoreDetailService;
|
|
private ProjectMapper projectMapper;
|
|
private ProjectMapper projectMapper;
|
|
|
|
+ private SbModelSpareBomMapper sbModelSpareBomMapper;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<OutStoreFormVO> selectbyRepairForm(String id) {
|
|
public List<OutStoreFormVO> selectbyRepairForm(String id) {
|
|
@@ -291,7 +297,7 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
// selectCount会有分页参数,偶尔会出现bug,修复
|
|
// selectCount会有分页参数,偶尔会出现bug,修复
|
|
BigDecimal countNum = mapper.getOutStoreFormCount1(new OutStoreFormDTO());
|
|
BigDecimal countNum = mapper.getOutStoreFormCount1(new OutStoreFormDTO());
|
|
Integer count = 0;
|
|
Integer count = 0;
|
|
- if(countNum != null){
|
|
|
|
|
|
+ if (countNum != null) {
|
|
count = countNum.intValue();
|
|
count = countNum.intValue();
|
|
}
|
|
}
|
|
/*Weekend<OutStoreForm> weekend = new Weekend<>(OutStoreForm.class);
|
|
/*Weekend<OutStoreForm> weekend = new Weekend<>(OutStoreForm.class);
|
|
@@ -305,7 +311,7 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
model.setUserInfo(userInfo);
|
|
model.setUserInfo(userInfo);
|
|
// 出库单详情
|
|
// 出库单详情
|
|
List<OutStoreDetailDTO> detailList = model.getDetailList();
|
|
List<OutStoreDetailDTO> detailList = model.getDetailList();
|
|
- if (project!=null) {
|
|
|
|
|
|
+ if (project != null) {
|
|
for (OutStoreDetailDTO detailDTO : detailList) {
|
|
for (OutStoreDetailDTO detailDTO : detailList) {
|
|
detailDTO.setProjectNo(project.getParentNo());
|
|
detailDTO.setProjectNo(project.getParentNo());
|
|
detailDTO.setProjectName(project.getParentName());
|
|
detailDTO.setProjectName(project.getParentName());
|
|
@@ -323,8 +329,8 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
model.setStoreId(detailList.get(0).getStoreId());
|
|
model.setStoreId(detailList.get(0).getStoreId());
|
|
model.setStoreName(detailList.get(0).getStoreName());
|
|
model.setStoreName(detailList.get(0).getStoreName());
|
|
model.setPickId(model.getPickId());
|
|
model.setPickId(model.getPickId());
|
|
- if(project != null){
|
|
|
|
- model.setProjectName(project.getParentName()+"->"+project.getName());
|
|
|
|
|
|
+ if (project != null) {
|
|
|
|
+ model.setProjectName(project.getParentName() + "->" + project.getName());
|
|
}
|
|
}
|
|
OutStoreForm outStoreForm = super.saveModelByDTO(model);
|
|
OutStoreForm outStoreForm = super.saveModelByDTO(model);
|
|
// 插
|
|
// 插
|
|
@@ -340,10 +346,61 @@ public class OutStoreFormServiceImpl extends BaseServiceImpl<OutStoreFormMapper,
|
|
storeDetail.setId(IdGeneratorUtils.getObjectId());
|
|
storeDetail.setId(IdGeneratorUtils.getObjectId());
|
|
detailMapper.insertSelective(storeDetail);
|
|
detailMapper.insertSelective(storeDetail);
|
|
}
|
|
}
|
|
- // mapper.updateByPrimaryKey(outStoreForm);
|
|
|
|
|
|
+
|
|
|
|
+ //需将申领的备件与设备绑定bom关系
|
|
|
|
+ if (model.getPickId() != null) {
|
|
|
|
+ RepairApplicationForm form = new RepairApplicationForm();
|
|
|
|
+ form.setId(model.getPickId());
|
|
|
|
+ form = repairApplicationFormMapper.selectOne(form);
|
|
|
|
+ List<SbModelSpareBom> boms = new ArrayList<>();
|
|
|
|
+ if (form != null && form.getSbId() != null) {
|
|
|
|
+ SbModelSpareBomDTO sbModelSpareBomDTO = new SbModelSpareBomDTO();
|
|
|
|
+ sbModelSpareBomDTO.setSbId(form.getSbId());
|
|
|
|
+ List<SbModelSpareBomVO> bomVOS = sbModelSpareBomMapper.selectVOList(sbModelSpareBomDTO);
|
|
|
|
+ boolean flag = false;
|
|
|
|
+ for (OutStoreDetailDTO detailDTO : detailList) {
|
|
|
|
+ flag = false;
|
|
|
|
+ if (bomVOS != null) {
|
|
|
|
+ for (SbModelSpareBomVO vo : bomVOS) {
|
|
|
|
+ if (vo.getSpareId().equals(detailDTO.getSpareId())) {
|
|
|
|
+ flag = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!flag) {
|
|
|
|
+ packageBom(boms,detailDTO,form.getSbId());
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ packageBom(boms,detailDTO,form.getSbId());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ sbModelSpareBomMapper.insertListforComplex(boms);
|
|
|
|
+// sbModelSpareBomMapper.insertList(boms);
|
|
|
|
+
|
|
|
|
+ // mapper.updateByPrimaryKey(outStoreForm);
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ throw new BusinessException("系统出错,请联系管理员!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return outStoreForm;
|
|
return outStoreForm;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ private void packageBom(List<SbModelSpareBom> boms,OutStoreDetailDTO detailDTO,String sbId){
|
|
|
|
+ SbModelSpareBom sbModelSpareBom = new SbModelSpareBom();
|
|
|
|
+ sbModelSpareBom.setSpareId(detailDTO.getSpareId());
|
|
|
|
+ sbModelSpareBom.setSbId(sbId);
|
|
|
|
+ sbModelSpareBom.setNum(new BigDecimal(1));
|
|
|
|
+ sbModelSpareBom.setId(IdGeneratorUtils.getObjectId());
|
|
|
|
+ sbModelSpareBom.setGgxh(detailDTO.getGgxh());
|
|
|
|
+ sbModelSpareBom.setSpareName(detailDTO.getSpareName());
|
|
|
|
+ sbModelSpareBom.setModelId(sbId);
|
|
|
|
+ sbModelSpareBom.setNo(detailDTO.getSpareNo());
|
|
|
|
+ boms.add(sbModelSpareBom);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public OutStoreForm saveModelByDTOYYBack(OutStoreFormDTO outStoreFormDTO) {
|
|
public OutStoreForm saveModelByDTOYYBack(OutStoreFormDTO outStoreFormDTO) {
|
|
if(StringUtils.isBlank(outStoreFormDTO.getOutStoreFormId())){
|
|
if(StringUtils.isBlank(outStoreFormDTO.getOutStoreFormId())){
|