Commit da025101 authored by 李驰骋's avatar 李驰骋

Merge remote-tracking branch 'origin/master'

parents 6a621af0 b638b169
......@@ -55,7 +55,7 @@ public interface IProFeedbackService {
* 验证序列号报工
* @param validateSerialNoParams
*/
void validateSerialNo(FeedbackValidateSerialNoParams validateSerialNoParams);
boolean validateSerialNo(FeedbackValidateSerialNoParams validateSerialNoParams);
/**
* 新增生产报工记录
......
......@@ -300,7 +300,7 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
}
@Override
public void validateSerialNo(FeedbackValidateSerialNoParams validateSerialNoParams) {
public boolean validateSerialNo(FeedbackValidateSerialNoParams validateSerialNoParams) {
QueryWrapper<ProWorkorder> query = new QueryWrapper<>();
query.eq("t4.task_workunit_id", validateSerialNoParams.getTaskWorkunitId());
List<ProWorkorder> listOrder = proWorkorderMapper.selectJoinTaskWorkunitByQw(query);
......@@ -319,8 +319,13 @@ public class ProFeedbackServiceImpl implements IProFeedbackService {
feedbackQuery.eq("task_workunit_id",validateSerialNoParams.getTaskWorkunitId());
List<ProFeedback> feedbackList = proFeedbackService.selectProFeedbackList(feedbackQuery);
if(feedbackList.size()>0){
throw new ServiceException(MessageUtils.message("pro.feedback.error.repeat.serialNo.report"));
if(feedbackList.stream().filter(proFeedback -> proFeedback.getQuantityQualify().compareTo(BigDecimal.ZERO) > 0).count() > 0){
throw new ServiceException(MessageUtils.message("pro.feedback.error.repeat.serialNo.report"));
}else{
return true;
}
}
return false;
}
/**
......
......@@ -779,11 +779,13 @@ public class ProTaskServiceImpl implements IProTaskService {
ExceptionUtil.checkTrueThrowException((feedbackQualifyConst.compareTo(BigDecimal.ZERO) <= 0 && fuantityUnqualify.compareTo(BigDecimal.ZERO) <= 0),
"报工数目合格、不合格数不能都小于等于0");
boolean addOneQuantityWait = false;
//序号报工校验,当addOneQuantityWait为true时说明已经报工过不良,不再增加
if(StringUtils.isNotEmpty(feedback.getQrcode())){
FeedbackValidateSerialNoParams feedbackValidateSerialNoParams = new FeedbackValidateSerialNoParams();
feedbackValidateSerialNoParams.setQrcode(feedback.getQrcode());
feedbackValidateSerialNoParams.setTaskWorkunitId(feedback.getTaskWorkunitId());
proFeedbackService.validateSerialNo(feedbackValidateSerialNoParams);
addOneQuantityWait = proFeedbackService.validateSerialNo(feedbackValidateSerialNoParams);
}
ProTaskWorkunit taskWorkunit = proTaskWorkunitService.selectProTaskWorkunitByTaskWorkunitId(feedback.getTaskWorkunitId());
......@@ -793,6 +795,19 @@ public class ProTaskServiceImpl implements IProTaskService {
double execQuantityQualifySumConst = proFeedbackService.selectQuantityQualifySum(new ProFeedback(null, null, null, taskWorkunit.getTaskWorkunitId()));
ProTask task = this.selectProTaskByTaskId(feedback.getTaskId());
if(addOneQuantityWait){
//addOneQuantityWait为true时说明该条吗已经存在过报工记录且为不良品 此时可能 不良品-》不良品 不良品-》良品
//增加一个可加工数,后续计算中会减1,抵消以后相当于QuantityWait可加工数不变
task.setQuantityWait(task.getQuantity().add(new BigDecimal(1)));
//减少一个不良加工数,后续计算中根据报工是不合格增加1,如果为合格则不再增加
task.setQuantityUnqualify(task.getQuantityUnqualify().subtract(new BigDecimal(1)));
//减少一个已加工数,抵消以后增加一个相当于已加工数不变
task.setQuantityProduced(task.getQuantityProduced().subtract(new BigDecimal(1)));
taskWorkunit.setQuantityUnqualify(task.getQuantityUnqualify().subtract(new BigDecimal(1)));
taskWorkunit.setQuantityProduced(task.getQuantityProduced().subtract(new BigDecimal(1)));
}
BigDecimal taskQuantityWaitConst = task.getQuantityWait();
double feedbackQualityDouConst = feedbackQualifyConst.doubleValue();
......
......@@ -600,7 +600,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
}
}
taskProWorkorderPrintData.setSize(i++);
taskProWorkorderPrintData.setDate(simpleDateFormat.format(new Date()));
taskProWorkorderPrintData.setDate(simpleDateFormat1.format(new Date()));
taskProWorkorderPrintData.setQuantity(taskBatchTasks.get(0).getQuantity());
}
}
......
......@@ -77,7 +77,7 @@
<if test="enableFlag != null and enableFlag != ''">and mw.enable_flag = #{enableFlag}</if>
<if test="workshopId != null ">and mw.workshop_id = #{workshopId}</if>
<if test="factoryCode != null and factoryCode != ''">and mw.factory_code = #{factoryCode}</if>
<if test="workstationCode != null and workstationCode != ''">and mw.workstation_code = #{workstationCode}
<if test="workstationCode != null and workstationCode != ''">and mw.workstation_code like '%${workstationCode}%'
</if>
</where>
</select>
......
......@@ -48,7 +48,7 @@
<select id="selectProProcessList" parameterType="ProProcess" resultMap="ProProcessResult">
<include refid="selectProProcessVo"/>
<where>
<if test="processCode != null and processCode != ''">and process_code = #{processCode}</if>
<if test="processCode != null and processCode != ''">and process_code like concat('%', #{processCode},'%') </if>
<if test="processName != null and processName != ''">and process_name like concat('%', #{processName},'%')
</if>
<if test="attention != null and attention != ''">and attention = #{attention}</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment