Browse Source

[fix] 生产管理

修改部门评审前端页面的计划完成时间,如果没有填写值,默认为空,而不是null
新增 根据生产单号查询生产部门集合数据后端接口
修改部门评审后端接口 新增:部门评审的时候需要展开所有物料才能提交,否则:提示:请将所有物料数据展开,进行部门评审!;新增如果部门类型是业务部门加上对开始时间和结束时间的判断,如果为空提示:请将所有物料数据展开,并填所有部门计划完成时间!;新增 除了业务部门对完成天数的判断,如果为空提示:请将所有物料数据展开,并填写所有部门计划完成时间!;
修改部门主管确认的后端接口:新增:部门评审的时候需要展开所有物料才能提交,否则:提示:请将所有物料数据展开,进行部门评审!;新增检查当前部门数据的deptNumber是否与给定的deptNumber匹配,检查deptLeaderConfirmStatus是否为空,如果有未确认的数据,提示:有物料数据未被确认,请进行部门主管确认!;
dev
liuxiaoxu 4 months ago
parent
commit
b6a9d75c0e
  1. 1
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderDeptMapper.java
  3. 30
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderDeptServiceImpl.java
  4. 6
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderDeptMapper.xml
  5. 44
      ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html

1
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -288,6 +288,7 @@ public class SysMakeOrderController extends BaseController
@PostMapping("/deptLeaderConfirm")
@ResponseBody
public AjaxResult deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto){
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts();
if(CollectionUtil.isEmpty(makeorderDeptList)){
return AjaxResult.error("部门主管确认数据不能为空!");

5
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderDeptMapper.java

@ -79,4 +79,9 @@ public interface SysMakeorderDeptMapper
public int restoreSysMakeorderDeptById(Long id);
String selectDeptLeaderConfirmStatusByMakeNoAndDeptNumber(@Param("makeNo") String makeNo,@Param("deptNumber") String deptNumber);
/*
* 根据生产单号查询生产部门集合数据
* */
List<SysMakeorderDept> selectMakeorderDeptListByMakeNo(String makeNo);
}

30
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderDeptServiceImpl.java

@ -140,6 +140,27 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
public int deptReview(SysMakeorderDeptDto makeorderDeptDto) {
String makeNo = makeorderDeptDto.getMakeNo();
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts();
List<SysMakeorderDept> tempMakeorderDeptList = sysMakeorderDeptMapper.selectMakeorderDeptListByMakeNo(makeNo);
if (makeorderDeptList.size() < tempMakeorderDeptList.size()){
throw new BusinessException("请将所有物料数据展开,进行部门评审!");
}
for (SysMakeorderDept sysMakeorderDept : makeorderDeptList) {
if ("GMD".equals(sysMakeorderDept.getDeptNumber())){
if (sysMakeorderDept.getPlanFinishStartDate() == null || sysMakeorderDept.getPlanFinishEndDate() == null){
throw new BusinessException("请将所有物料数据展开,并填所有部门计划完成时间!");
}
}else {
if (sysMakeorderDept.getPlanFinishDays() == null){
throw new BusinessException("请将所有物料数据展开,并填写所有部门计划完成时间!");
}
}
}
// 部门预审数据是一起录入
/*String deptNumber = ShiroUtils.getSysUser().getDept().getDeptNumber();
// 判断其他部门是否都已预审完成,预审完成更新生产订单状态
@ -180,6 +201,13 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
public void deptLeaderConfirm(SysMakeorderDeptDto makeorderDeptDto){
String makeNo = makeorderDeptDto.getMakeNo();
List<SysMakeorderDept> makeorderDeptList = makeorderDeptDto.getOrderDepts();
List<SysMakeorderDept> tempMakeorderDeptList = sysMakeorderDeptMapper.selectMakeorderDeptListByMakeNo(makeNo);
if (makeorderDeptList.size() < tempMakeorderDeptList.size()){
throw new BusinessException("请将所有物料数据展开,进行确认!");
}
String deptNumber = ShiroUtils.getSysUser().getDept().getDeptNumber();
boolean hasUnconfirmedData = false; // 标记是否有未确认的数据
@ -200,7 +228,7 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
// 如果有未确认的数据,抛出异常或给出提示
if (hasUnconfirmedData) {
throw new BusinessException("有数据未被确认,请进行部门主管确认!");
throw new BusinessException("有物料数据未被确认,请进行部门主管确认!");
}
// 工程部门领导确认完,生产状态更新为待工程审核

6
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderDeptMapper.xml

@ -60,6 +60,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where makeNo = #{makeNo} and dept_number = #{deptNumber}
</select>
<select id="selectMakeorderDeptListByMakeNo" parameterType="String" resultMap="SysMakeorderDeptResult">
<include refid="selectSysMakeorderDeptVo"/>
where makeNo = #{makeNo}
</select>
<insert id="insertSysMakeorderDept" parameterType="SysMakeorderDept" useGeneratedKeys="true" keyProperty="id">
insert into sys_makeorder_dept
<trim prefix="(" suffix=")" suffixOverrides=",">

44
ruoyi-admin/src/main/resources/templates/system/makeorder/bmps.html

@ -399,25 +399,33 @@
return '<input readonly class = "form-control" data-id = "deptName_'+curIndex+'" name="orderDepts['+curIndex+'].deptName" value="'+row.deptName+'"><input class = "form-control hidden" data-id = "deptNumber_'+curIndex+'" name="orderDepts['+curIndex+'].deptNumber" value="'+value+'">';
}
},
{
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex*6+index;
var endDateName = 'planFinishEndDate_'+parentRowIndex;
var startDateName = 'planFinishStartDate_'+parentRowIndex;
var html;
// 业务部门
if(row.deptNumber=='GMD'){
html = '<div class="input-daterange input-group"><input type="text" class="form-control" data-id="'+startDateName+'" name ="orderDepts['+curIndex+'].planFinishStartDate" placeholder="开始时间" value="'+row.planFinishStartDate+'"/>\n' +
'<span class="input-group-addon">-</span>\n' +
'<input type="text" class="form-control" data-id="'+endDateName+'" name="orderDepts['+curIndex+'].planFinishEndDate" placeholder="结束时间" value="'+row.planFinishEndDate+'"/></div>'
}else{
html = '<input class = "form-control" data-id = "planFinishDays_'+curIndex+'" name="orderDepts['+curIndex+'].planFinishDays" value="'+row.planFinishDays+'">';
{
field: 'planFinishDate',
title: '计划完成时间',
formatter: function(value, row, index) {
var curIndex = parentRowIndex * 6 + index;
var endDateName = 'planFinishEndDate_' + parentRowIndex;
var startDateName = 'planFinishStartDate_' + parentRowIndex;
var html;
// 使用||运算符确保值至少是空字符串
var planFinishStartDate = row.planFinishStartDate || '';
var planFinishEndDate = row.planFinishEndDate || '';
var planFinishDays = row.planFinishDays || '';
// 业务部门
if (row.deptNumber === 'GMD') {
html = '<div class="input-daterange input-group">' +
'<input type="text" class="form-control" data-id="' + startDateName + '" name="orderDepts[' + curIndex + '].planFinishStartDate" placeholder="开始时间" value="' + planFinishStartDate + '"/>' +
'<span class="input-group-addon">-</span>' +
'<input type="text" class="form-control" data-id="' + endDateName + '" name="orderDepts[' + curIndex + '].planFinishEndDate" placeholder="结束时间" value="' + planFinishEndDate + '"/></div>';
} else {
html = '<input class="form-control" data-id="planFinishDays_' + curIndex + '" name="orderDepts[' + curIndex + '].planFinishDays" value="' + planFinishDays + '">';
}
return html;
}
return html;
}
},
},
{
field : 'deptLeaderConfirmStatus',
title : '部门主管确认',

Loading…
Cancel
Save