其他异常修改提交

赵嘉伟 4 years ago
parent 4ee60c5baa
commit acec9d177d

@ -10,6 +10,7 @@ import com.foreverwin.mesnac.anomaly.service.FileUploadedService;
import com.foreverwin.mesnac.common.dto.SfcDispatchDto;
import com.foreverwin.mesnac.common.service.AnomalyService;
import com.foreverwin.mesnac.common.service.SfcDispatchCommonService;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
@ -79,6 +80,8 @@ public class AbnormalBillController {
public R page(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill){
IPage result;
QueryWrapper<AbnormalBill> queryWrapper = new QueryWrapper<>();
String site = CommonMethods.getSite();
abnormalBill.setSite(site);
queryWrapper.setEntity(abnormalBill);
if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) {
//TODO modify global query

@ -14,7 +14,14 @@ import com.foreverwin.mesnac.anomaly.service.AbnormalBillLogService;
import com.foreverwin.mesnac.anomaly.service.AbnormalBillService;
import com.foreverwin.mesnac.anomaly.service.AbnormalNcCodeService;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.model.Router;
import com.foreverwin.mesnac.meapi.model.ShopOrder;
import com.foreverwin.mesnac.meapi.service.RouterService;
import com.foreverwin.modular.core.exception.BusinessException;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +60,15 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMappe
@Autowired
private AbnormalBillDisposeService abnormalBillDisposeService;
@Autowired
private RouterService routerService;
@Autowired
private NwaUserMapper nwaUserMapper;
@Autowired
private ShopOrderMapper shopOrderMapper;
@Override
public IPage<AbnormalBillLog> selectPage(FrontPage<AbnormalBillLog> frontPage, AbnormalBillLog abnormalBillLog) {
QueryWrapper<AbnormalBillLog> queryWrapper = new QueryWrapper<>();
@ -71,6 +87,7 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMappe
public void saveAndUpdate(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose, List<String> ncGroupAndNcCodes, List<String> dutyCauseType, List<String> dutyType) {
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
String site = CommonMethods.getSite();
AbnormalBillLog abnormalBillLog = abnormalBillLogMapper.findAllByAbnormalNo(abnormalBill);
if(abnormalBillLogMapper.selectById(abnormalBillLog.getHandle()) == null){
@ -118,11 +135,41 @@ public class AbnormalBillLogServiceImpl extends ServiceImpl<AbnormalBillLogMappe
abnormalBillLog.setModifiedDateTime(now);
this.save(abnormalBillLog);;
}
// abnormalBillService.generateAbnormalBill(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
// abnormalBillService.saveOrUpdate(abnormalBill);
// abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
if(!StringUtil.isBlank(abnormalBillDispose.getRouterBo())){
//分割该工艺路线
String[] routerSplit = abnormalBillDispose.getRouterBo().split(",");
//判断该返修工艺是否正确
Router router = new Router();
router.setSite(site);
router.setRouter(routerSplit[1]);
router.setRouterType(routerSplit[2]);
router.setCurrentRevision("true");
List<Router> routers = routerService.selectList(router);
if(routers == null || routers.size() == 0){
throw BusinessException.build("该返修工艺不存在");
}
}
//判断返修工单是否正确
if(!StringUtil.isBlank(abnormalBillDispose.getResolveShopOrder())){
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("发送用户填报错误");
}
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
abnormalBillService.anomalyReport(abnormalBill,abnormalBillDispose,ncGroupAndNcCodes,dutyCauseType,dutyType);
}else if(Constants.ABNORMAL_OTHER.equals(abnormalBill.getType())){
abnormalBillService.anomalyReportOther(abnormalBill,abnormalBillDispose,dutyCauseType,dutyType);
}
}
}

@ -186,10 +186,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Override
public String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose) {
String message = this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
if(!StringUtil.isBlank(abnormalBill.getSfc()) ){
@ -412,6 +408,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}else{
message = "保存成功";
}
abnormalBillDispose.setClosedUser(null);
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
abnormalBillDispose.setHandle(HandleEnum.Z_ABNORMAL_BILL_DISPOSE.getHandle(site,abnormalBill.getAbnormalNo()));
@ -711,7 +708,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBillDispose.setSite(site);
abnormalBillDispose.setAbnormalBillBo(abnormalBill.getHandle());
this.generateAbnormalBill(abnormalBill, abnormalBillDispose, null, null);
//判断工单sfc资源是否传递正确
Sfc sfc1 = sfcMapper.selectById(HandleEnum.SFC.getHandle(site, sfc));
@ -726,8 +723,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
// throw new BaseException("资源传递有误");
// }
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
this.anomalyReportDevice(abnormalBill,abnormalBillDispose);
}
}

@ -391,12 +391,12 @@
<if test="ew.entity.modifiedDateTime!=null"> AND MODIFIED_DATE_TIME=#{ew.entity.modifiedDateTime}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

Loading…
Cancel
Save