|
|
|
@ -12,11 +12,8 @@ import com.foreverwin.mesnac.anomaly.service.*;
|
|
|
|
|
import com.foreverwin.mesnac.common.enums.HandleEnum;
|
|
|
|
|
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
|
|
|
|
|
import com.foreverwin.mesnac.common.util.StringUtil;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.mapper.NcGroupMapper;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.mapper.ResrceMapper;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.NcCode;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.NcGroup;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.Resrce;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.mapper.*;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.model.*;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.NcCodeService;
|
|
|
|
|
import com.foreverwin.mesnac.meapi.service.NwaUserService;
|
|
|
|
|
import com.foreverwin.modular.core.exception.BusinessException;
|
|
|
|
@ -29,6 +26,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
@ -79,6 +77,15 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
@Autowired
|
|
|
|
|
private AbnormalBillDisposeMapper abnormalBillDisposeMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private RouterMapper routerMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private ShopOrderMapper shopOrderMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private NwaUserMapper nwaUserMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
|
|
|
|
|
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
|
|
|
|
@ -191,6 +198,68 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void resProcessing(AbnormalBill abnormalBill) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
abnormalBill.setSite(site);
|
|
|
|
|
abnormalBill.setResponseUser(user);
|
|
|
|
|
abnormalBill.setResponseDateTime(now);
|
|
|
|
|
abnormalBill.setStatus("X");
|
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void programConfirm(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
|
|
|
|
|
//判断该返修工艺是否正确
|
|
|
|
|
Router routerBo = routerMapper.selectById(abnormalBillDispose.getRouterBo());
|
|
|
|
|
if(routerBo == null){
|
|
|
|
|
throw BusinessException.build("该返修工艺不存在");
|
|
|
|
|
}
|
|
|
|
|
//判断返修工单是否正确
|
|
|
|
|
ShopOrder shopOrder = shopOrderMapper.selectById(HandleEnum.SHOP_ORDER.getHandle(site, abnormalBillDispose.getResolveShopOrder()));
|
|
|
|
|
if(shopOrder == null){
|
|
|
|
|
throw BusinessException.build("该返修工单不存在");
|
|
|
|
|
}
|
|
|
|
|
//发送用户
|
|
|
|
|
String[] split = abnormalBillDispose.getResolveSendUser().split(",");
|
|
|
|
|
List<String> strings = Arrays.asList(split);
|
|
|
|
|
int length = nwaUserMapper.checkUser(site, strings);
|
|
|
|
|
if(length != strings.size()){
|
|
|
|
|
throw BusinessException.build("发送用户填报错误");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置解决方案的处理时间和处理人
|
|
|
|
|
abnormalBillDispose.setResolveDateTime(now);
|
|
|
|
|
abnormalBillDispose.setResolveUser(user);
|
|
|
|
|
abnormalBill.setStatus("F");
|
|
|
|
|
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
|
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void dutyConfirm(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
|
String user = CommonMethods.getUser();
|
|
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
|
|
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
abnormalBillDispose.setDutyDateTime(now);
|
|
|
|
|
abnormalBillDispose.setDutyUser(user);
|
|
|
|
|
|
|
|
|
|
nwaUserService.checkUserGroup(abnormalBillDispose.getDutySendUserGroup());
|
|
|
|
|
this.saveOrUpdate(abnormalBill);
|
|
|
|
|
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType) {
|
|
|
|
|
String site = CommonMethods.getSite();
|
|
|
|
@ -208,18 +277,24 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
|
|
|
|
|
}
|
|
|
|
|
abnormalBill.setAbnormalNo(abnormalNo);
|
|
|
|
|
}
|
|
|
|
|
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
|
|
|
|
|
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abnormalBill.setHandle(HandleEnum.Z_ABNORMAL_BILL.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
//更新的时候,判断该异常当的状态是否为新建
|
|
|
|
|
AbnormalBill abnormalBill1 = abnormalBillMapper.selectById(abnormalBill.getHandle());
|
|
|
|
|
// if(abnormalBill1 != null){
|
|
|
|
|
// if(!"N".equals(abnormalBill1.getStatus())){
|
|
|
|
|
// throw BusinessException.build("该异常单已经被人处理,不能进行更新");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
|
|
|
|
|
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
|
|
|
|
|
|
|
|
|
|
//设置责任划分填报人和填报时间
|
|
|
|
|
abnormalBillDispose.setDutyUser(user);
|
|
|
|
|
abnormalBillDispose.setDutyDateTime(currentTime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<AbnormalCause> causeTypes = new ArrayList<>();
|
|
|
|
|
//判断原因分类是否为空
|
|
|
|
|
if(dutyCauseType != null && dutyCauseType.size() >= 1){
|
|
|
|
|