自报跳转异常

master
philip 4 years ago
parent a8ef8d8d88
commit 29b5d3cbd8

@ -9,6 +9,8 @@ package com.foreverwin.mesnac.common.constant;
public interface Constants { public interface Constants {
String STATUS_NEW = "NEW"; String STATUS_NEW = "NEW";
String STATE_CONFIRM ="CONF";
String STATE_REJECT="REJ";
String BOOL_TRUE = "true"; String BOOL_TRUE = "true";
String BOOL_FALSE = "false"; String BOOL_FALSE = "false";

@ -154,8 +154,8 @@ public class MasterObjectDefine {
cvsHeadsMapping.put("paramDescription","参数描述"); cvsHeadsMapping.put("paramDescription","参数描述");
cvsHeadsMapping.put("inspectionMethod","检验方法"); cvsHeadsMapping.put("inspectionMethod","检验方法");
cvsHeadsMapping.put("paramType","数据类型"); cvsHeadsMapping.put("paramType","数据类型");
cvsHeadsMapping.put("decimalNum","单位"); cvsHeadsMapping.put("decimalNum","小数位数");
cvsHeadsMapping.put("paramUnit","小数位数"); cvsHeadsMapping.put("paramUnit","单位");
cvsHeadsMapping.put("maxValue","规格上限"); cvsHeadsMapping.put("maxValue","规格上限");
cvsHeadsMapping.put("standardValue","目标规格"); cvsHeadsMapping.put("standardValue","目标规格");
cvsHeadsMapping.put("minValue","规格下限"); cvsHeadsMapping.put("minValue","规格下限");

@ -669,7 +669,7 @@
LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale} LEFT JOIN ITEM_T IT ON S.ITEM_BO=IT.ITEM_BO AND IT.LOCALE=#{locale}
JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE JOIN Z_SFC_DISPATCH zsd ON S.SFC=zsd.SFC AND S.SITE=zsd.SITE
JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE JOIN Z_PROD_READY_TASK zprt ON ZPRT.SFC_DISPATCH_BO=zsd.HANDLE
WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL' WHERE S.SITE=#{ew.entity.site} AND ZSD.RESRCE=#{ew.entity.resrce} AND ZSD.DISPATCH_STATUS!='CANCEL' AND ZSD.DISPATCH_STATUS!='COMPLETE'
AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403') AND S.STATUS_BO IN ('StatusBO:'||#{ew.entity.site}||',401','StatusBO:'||#{ew.entity.site}||',402','StatusBO:'||#{ew.entity.site}||',403')
AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK' AND zprt.STATUS='FINISH' AND ZPRT."RESULT"='OK'
</select> </select>

@ -2,6 +2,7 @@ package com.foreverwin.mesnac.quality.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.quality.model.SelfReport; import com.foreverwin.mesnac.quality.model.SelfReport;
import com.foreverwin.mesnac.quality.service.SelfReportService; import com.foreverwin.mesnac.quality.service.SelfReportService;
import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.CommonMethods;
@ -66,7 +67,7 @@ public class SelfReportController {
@ResponseBody @ResponseBody
@RequestMapping("/reject") @RequestMapping("/reject")
public R updateById(String handle){ public R updateById(String handle){
return R.ok(selfReportService.reject(handle)); return R.ok(selfReportService.updateState(handle, Constants.STATE_REJECT));
} }
/** /**
* *

@ -20,5 +20,5 @@ import java.util.List;
@Repository @Repository
public interface SelfReportMapper extends BaseMapper<SelfReport> { public interface SelfReportMapper extends BaseMapper<SelfReport> {
List<SelfReport> selectList(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime); List<SelfReport> selectListByCondition(@Param("ew") QueryWrapper<SelfReport> ew, @Param("locale") String locale,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime);
} }

@ -29,7 +29,7 @@ public interface SelfReportService extends IService<SelfReport> {
List<SelfReport> selectList(SelfReport selfReport); List<SelfReport> selectList(SelfReport selfReport);
Object reject(String handle); Object updateState(String handle, String state);
List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime); List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime);

@ -1,5 +1,6 @@
package com.foreverwin.mesnac.quality.service.impl; package com.foreverwin.mesnac.quality.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -54,11 +55,6 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
@Autowired @Autowired
private CommonService commonService; private CommonService commonService;
static final String STATE_NEW="NEW";
static final String STATE_CONFIRM="CONF";
static final String STATE_REJECT="REJ";
@Override @Override
public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) { public IPage<SelfReport> selectPage(FrontPage<SelfReport> frontPage, SelfReport selfReport) {
@ -75,7 +71,7 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
} }
@Override @Override
public List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime) { public List<SelfReport> selectList(QueryWrapper<SelfReport> queryWrapper, String locale, LocalDate startTime, LocalDate endTime) {
return selfReportMapper.selectList(queryWrapper,locale,startTime,endTime); return selfReportMapper.selectListByCondition(queryWrapper,locale,startTime,endTime);
} }
@Override @Override
@ -116,10 +112,10 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
if (otherAbnormalList.size()>0){ if (otherAbnormalList.size()>0){
anomalyService.createAnomalyTask(Constants.ABNORMAL_OTHER,resrce,shopOrder,sfc,"",location,ncQty,comments,userGroup); anomalyService.createAnomalyTask(Constants.ABNORMAL_OTHER,resrce,shopOrder,sfc,"",location,ncQty,comments,userGroup);
} }
QueryWrapper<SelfReport> queryWrapper=new QueryWrapper<>(); LambdaQueryWrapper<SelfReport> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(SelfReport.SFC,sfc); queryWrapper.eq(SelfReport::getSfc,sfc);
queryWrapper.eq(SelfReport.OP_STEP,operationStep); queryWrapper.eq(SelfReport::getOpStep,operationStep);
queryWrapper.eq(SelfReport.STATE,Constants.NEW); queryWrapper.eq(SelfReport::getState,Constants.NEW);
List<SelfReport> selfReports = list(queryWrapper); List<SelfReport> selfReports = list(queryWrapper);
if (selfReports.size()>0){ if (selfReports.size()>0){
throw new BaseException("存在未处理的自报任务"); throw new BaseException("存在未处理的自报任务");
@ -150,7 +146,7 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
selfReport.setNcCode(stringBuilder.toString()); selfReport.setNcCode(stringBuilder.toString());
selfReport.setNcQty(new BigDecimal(ncQty)); selfReport.setNcQty(new BigDecimal(ncQty));
selfReport.setLocation(location); selfReport.setLocation(location);
selfReport.setState(Constants.NEW); selfReport.setState(Constants.STATUS_NEW);
selfReport.setRemark(comments); selfReport.setRemark(comments);
selfReport.setCreateUser(user); selfReport.setCreateUser(user);
selfReport.setCreatedDateTime(LocalDateTime.now()); selfReport.setCreatedDateTime(LocalDateTime.now());
@ -161,16 +157,15 @@ public class SelfReportServiceImpl extends ServiceImpl<SelfReportMapper, SelfRep
} }
@Override @Override
public Object reject(String handle) { public Object updateState(String handle, String state) {
SelfReport selfReport = getById(handle); SelfReport selfReport = getById(handle);
if (!selfReport.getState().equals(STATE_NEW)){ if (!selfReport.getState().equals(Constants.STATUS_NEW)){
throw new BaseException("状态不为新建,请重新检索"); throw new BaseException("状态不为新建,请重新检索");
} }
selfReport.setState(STATE_REJECT); selfReport.setState(state);
selfReport.setModifiedDateTime(LocalDateTime.now()); selfReport.setModifiedDateTime(LocalDateTime.now());
selfReport.setModifyUser(CommonMethods.getUser()); selfReport.setModifyUser(CommonMethods.getUser());
return updateById(selfReport); return updateById(selfReport);
} }
} }

@ -118,6 +118,41 @@
</select> </select>
<select id="selectList" resultMap="BaseResultMap"> <select id="selectList" resultMap="BaseResultMap">
SELECT <choose><when test="ew != null and ew.sqlSelect != null">${ew.sqlSelect}</when><otherwise><include refid="Base_Column_List"></include></otherwise></choose> FROM Z_SELF_REPORT
<where>
<if test="ew!=null">
<if test="ew.entity!=null">
<if test="ew.entity.handle!=null">
HANDLE=#{ew.entity.handle}
</if>
<if test="ew.entity.site!=null"> AND SITE=#{ew.entity.site}</if>
<if test="ew.entity.taskNo!=null"> AND TASK_NO=#{ew.entity.taskNo}</if>
<if test="ew.entity.workCenter!=null"> AND WORK_CENTER=#{ew.entity.workCenter}</if>
<if test="ew.entity.shopOrder!=null"> AND SHOP_ORDER=#{ew.entity.shopOrder}</if>
<if test="ew.entity.item!=null"> AND ITEM=#{ew.entity.item}</if>
<if test="ew.entity.opStep!=null"> AND OP_STEP=#{ew.entity.opStep}</if>
<if test="ew.entity.resrce!=null"> AND RESRCE=#{ew.entity.resrce}</if>
<if test="ew.entity.sfc!=null"> AND SFC=#{ew.entity.sfc}</if>
<if test="ew.entity.ncCode!=null"> AND NC_CODE=#{ew.entity.ncCode}</if>
<if test="ew.entity.ncQty!=null"> AND NC_QTY=#{ew.entity.ncQty}</if>
<if test="ew.entity.location!=null"> AND LOCATION=#{ew.entity.location}</if>
<if test="ew.entity.state!=null"> AND STATE=#{ew.entity.state}</if>
<if test="ew.entity.remark!=null"> AND REMARK=#{ew.entity.remark}</if>
<if test="ew.entity.createUser!=null"> AND CREATE_USER=#{ew.entity.createUser}</if>
<if test="ew.entity.createdDateTime!=null"> AND CREATED_DATE_TIME=#{ew.entity.createdDateTime}</if>
<if test="ew.entity.modifyUser!=null"> AND MODIFY_USER=#{ew.entity.modifyUser}</if>
<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}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
</if>
</select>
<select id="selectListByCondition" resultMap="BaseResultMap">
SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, ZSR.CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR SELECT ZSR.HANDLE, ZSR.SITE, ZSR.TASK_NO, ZSR.WORK_CENTER, ZSR.SHOP_ORDER, ZSR.ITEM, ZSR.OP_STEP, ZSR.RESRCE, ZSR.SFC, ZSR.NC_CODE, ZSR.NC_QTY, ZSR.LOCATION, ZSR.STATE, ZSR.REMARK, ZSR.CREATE_USER,ZSR. CREATED_DATE_TIME,IT.DESCRIPTION FROM Z_SELF_REPORT ZSR
JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true' JOIN ITEM I ON I.ITEM = ZSR.ITEM AND I.CURRENT_REVISION='true'
LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale} LEFT JOIN ITEM_T IT ON I.HANDLE = IT.ITEM_BO AND IT.LOCALE = #{locale}

Loading…
Cancel
Save