Browse Source

[update]:生产订单-部门预审功能更新

dev
youjianchi 8 months ago
parent
commit
e1dfd189bd
  1. 16
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  2. 21
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeOrder.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderDeptMapper.java
  4. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderDeptService.java
  5. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderDeptServiceImpl.java
  6. 4
      ruoyi-admin/src/main/resources/application.yml
  7. 47
      ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml
  8. 4
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderDeptMapper.xml
  9. 24
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

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

@ -5,8 +5,10 @@ import cn.hutool.core.lang.Assert;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept; import com.ruoyi.system.domain.SysMakeorderDept;
@ -64,6 +66,17 @@ public class SysMakeOrderController extends BaseController
return prefix + "/bmps"; return prefix + "/bmps";
} }
/**
* 跳转部门主管确认页面
*/
@GetMapping("/bmzgqr/{id}")
public String bmzgqr(@PathVariable("id") Long id, ModelMap mmap)
{
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/bmzgqr";
}
/** /**
* 部门评审 * 部门评审
@ -123,6 +136,9 @@ public class SysMakeOrderController extends BaseController
@ResponseBody @ResponseBody
public TableDataInfo list(SysMakeOrder sysMakeOrder) public TableDataInfo list(SysMakeOrder sysMakeOrder)
{ {
SysUser sysUser = ShiroUtils.getSysUser();
String deptNumber = sysUser.getDept().getDeptNumber();
sysMakeOrder.setDeptNumber(deptNumber);
startPage(); startPage();
List<SysMakeOrder> list = sysMakeOrderService.selectSysMakeOrderList(sysMakeOrder); List<SysMakeOrder> list = sysMakeOrderService.selectSysMakeOrderList(sysMakeOrder);
return getDataTable(list); return getDataTable(list);

21
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeOrder.java

@ -85,6 +85,11 @@ public class SysMakeOrder extends BaseEntity
/** 使用状态 */ /** 使用状态 */
private String delFlag; private String delFlag;
/** 部门编号 */
private String deptNumber;
/** 部门主管确认状态 */
private String deptLeaderConfirmStatus;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -248,6 +253,22 @@ public class SysMakeOrder extends BaseEntity
return delFlag; return delFlag;
} }
public String getDeptNumber() {
return deptNumber;
}
public void setDeptNumber(String deptNumber) {
this.deptNumber = deptNumber;
}
public String getDeptLeaderConfirmStatus() {
return deptLeaderConfirmStatus;
}
public void setDeptLeaderConfirmStatus(String deptLeaderConfirmStatus) {
this.deptLeaderConfirmStatus = deptLeaderConfirmStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

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

@ -77,4 +77,6 @@ public interface SysMakeorderDeptMapper
* @return 结果 * @return 结果
*/ */
public int restoreSysMakeorderDeptById(Long id); public int restoreSysMakeorderDeptById(Long id);
String selectDeptLeaderConfirmStatusByMakeNoAndDeptNumber(@Param("makeNo") String makeNo,@Param("deptNumber") String deptNumber);
} }

2
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderDeptService.java

@ -15,7 +15,7 @@ public interface ISysMakeorderDeptService
{ {
// 预审部门 业务部、工程部、采购部、品质部(来料、生产)、生产部 // 预审部门 业务部、工程部、采购部、品质部(来料、生产)、生产部
List<String> YS_DEPT_NUMBER_LIST = Arrays.asList("GMD","END","PUD","QAD","PD"); List<String> YS_DEPT_NUMBER_LIST = Arrays.asList("GMD-业务部","END-工程部","PUD-采购部","QAD-品质部(来料)","PD-生产部","QAD-品质部(生产)");
/** /**
* 查询生产订单部门 * 查询生产订单部门

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

@ -160,10 +160,11 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
makeOrderService.updateByMakeNo(makeOrder); makeOrderService.updateByMakeNo(makeOrder);
makeorderDeptList.forEach(dept->{ makeorderDeptList.forEach(dept->{
// 业务部门 无需部门领导确认 // 业务部门 无需部门领导确认
if("SED".equals(dept.getDeptNumber())){ if("GMD".equals(dept.getDeptNumber())){
// 已确认 // 已确认
dept.setDeptLeaderConfirmStatus("1"); dept.setDeptLeaderConfirmStatus("1");
}else{ }else{
// 待确认
dept.setDeptLeaderConfirmStatus("0"); dept.setDeptLeaderConfirmStatus("0");
} }
sysMakeorderDeptMapper.updateSysMakeorderDept(dept); sysMakeorderDeptMapper.updateSysMakeorderDept(dept);
@ -192,11 +193,13 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
@Override @Override
public void generateYsDataByMakeNoAndMaterialNo(String makeNo, String materialNo) { public void generateYsDataByMakeNoAndMaterialNo(String makeNo, String materialNo) {
for (int i = 0; i < YS_DEPT_NUMBER_LIST.size(); i++) { for (int i = 0; i < YS_DEPT_NUMBER_LIST.size(); i++) {
String ysDeptNumber = YS_DEPT_NUMBER_LIST.get(i); String ysDeptNumberStr = YS_DEPT_NUMBER_LIST.get(i);
String[] ysDeptNumberArray = ysDeptNumberStr.split("-");
SysMakeorderDept makeorderDept = new SysMakeorderDept(); SysMakeorderDept makeorderDept = new SysMakeorderDept();
makeorderDept.setMakeNo(makeNo); makeorderDept.setMakeNo(makeNo);
makeorderDept.setMaterialNo(materialNo); makeorderDept.setMaterialNo(materialNo);
makeorderDept.setDeptNumber(ysDeptNumber); makeorderDept.setDeptNumber(ysDeptNumberArray[0]);
makeorderDept.setDeptName(ysDeptNumberArray[1]);
insertSysMakeorderDept(makeorderDept); insertSysMakeorderDept(makeorderDept);
} }
} }

4
ruoyi-admin/src/main/resources/application.yml

@ -9,9 +9,9 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: false demoEnabled: false
# 文件路径 示例( Windows配置c:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) # 文件路径 示例( Windows配置c:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
# profile: /Users/xiguniang/Documents/ruoyi/uploadPath profile: /Users/xiguniang/Documents/ruoyi/uploadPath
# profile: /home/ruoyi/uploadPath # profile: /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath # profile: D:/ruoyi/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false

47
ruoyi-admin/src/main/resources/mapper/system/SysMakeOrderMapper.xml

@ -28,32 +28,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="deptNumber" column="dept_number" />
<result property="deptLeaderConfirmStatus" column="dept_leader_confirm_status" />
</resultMap> </resultMap>
<sql id="selectSysMakeOrderVo"> <sql id="selectSysMakeOrderVo">
select id, make_status, eceipt_status, quality_status, use_status, makeNo, saleNo, Salesman, customerId, customerName, customerOderCode, material, materialSum, finishNum, eceiptNum, noRate, rate, create_by, create_time, update_by, update_time, remark, del_flag from sys_makeorder select a.id, a.make_status, a.eceipt_status, a.quality_status, a.use_status, a.makeNo, a.saleNo, a.Salesman, a.customerId, a.customerName, a.customerOderCode, a.material
, a.materialSum, a.finishNum, a.eceiptNum, a.noRate, a.rate
, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.del_flag
from sys_makeorder a
</sql> </sql>
<select id="selectSysMakeOrderList" parameterType="SysMakeOrder" resultMap="SysMakeOrderResult"> <select id="selectSysMakeOrderList" parameterType="SysMakeOrder" resultMap="SysMakeOrderResult">
<include refid="selectSysMakeOrderVo"/> select a.id, a.make_status, a.eceipt_status, a.quality_status, a.use_status, a.makeNo, a.saleNo, a.Salesman, a.customerId, a.customerName, a.customerOderCode, a.material
<where> , a.materialSum, a.finishNum, a.eceiptNum, a.noRate, a.rate
<if test="makeStatus != null and makeStatus != ''"> and make_status = #{makeStatus}</if> , a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.del_flag
<if test="eceiptStatus != null and eceiptStatus != ''"> and eceipt_status = #{eceiptStatus}</if> , b.dept_leader_confirm_status
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if> from sys_makeorder a
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if> left join(
<if test="makeNo != null and makeNo != ''"> and makeNo = #{makeNo}</if> select makeNo,dept_leader_confirm_status
<if test="saleNo != null and saleNo != ''"> and saleNo = #{saleNo}</if> from sys_makeorder_dept
<if test="Salesman != null and Salesman != ''"> and Salesman = #{Salesman}</if> where dept_number = #{deptNumber}
<if test="customerId != null and customerId != ''"> and customerId = #{customerId}</if> group by makeNo
<if test="customerName != null and customerName != ''"> and customerName like concat('%', #{customerName}, '%')</if> )b
<if test="customerOderCode != null and customerOderCode != ''"> and customerOderCode = #{customerOderCode}</if> on a.makeNo = b.makeNo
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if> <where>
<if test="makeStatus != null and makeStatus != ''"> and a.make_status = #{makeStatus}</if>
<if test="eceiptStatus != null and eceiptStatus != ''"> and a.eceipt_status = #{eceiptStatus}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and a.quality_status = #{qualityStatus}</if>
<if test="useStatus != null and useStatus != ''"> and a.use_status = #{useStatus}</if>
<if test="makeNo != null and makeNo != ''"> and a.makeNo = #{makeNo}</if>
<if test="saleNo != null and saleNo != ''"> and a.saleNo = #{saleNo}</if>
<if test="Salesman != null and Salesman != ''"> and a.Salesman = #{Salesman}</if>
<if test="customerId != null and customerId != ''"> and a.customerId = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and a.customerName like concat('%', #{customerName}, '%')</if>
<if test="customerOderCode != null and customerOderCode != ''"> and a.customerOderCode = #{customerOderCode}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and a.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
</where> </where>
</select> </select>
<select id="selectSysMakeOrderById" parameterType="Long" resultMap="SysMakeOrderResult"> <select id="selectSysMakeOrderById" parameterType="Long" resultMap="SysMakeOrderResult">
<include refid="selectSysMakeOrderVo"/> <include refid="selectSysMakeOrderVo"/>
where id = #{id} where a.id = #{id}
</select> </select>
<insert id="insertSysMakeOrder" parameterType="SysMakeOrder" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSysMakeOrder" parameterType="SysMakeOrder" useGeneratedKeys="true" keyProperty="id">

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

@ -55,6 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where makeNo = #{makeNo} where makeNo = #{makeNo}
and dept_number != #{deptNumber} and dept_number != #{deptNumber}
</select> </select>
<select id="selectDeptLeaderConfirmStatusByMakeNoAndDeptNumber" resultType="java.lang.String">
select distinct dept_leader_confirm_status from sys_makeorder_dept
where makeNo = #{makeNo} and dept_number = #{deptNumber}
</select>
<insert id="insertSysMakeorderDept" parameterType="SysMakeorderDept" useGeneratedKeys="true" keyProperty="id"> <insert id="insertSysMakeorderDept" parameterType="SysMakeorderDept" useGeneratedKeys="true" keyProperty="id">
insert into sys_makeorder_dept insert into sys_makeorder_dept

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

@ -208,23 +208,33 @@
field: 'remark', field: 'remark',
title: '备注' title: '备注'
}, },
{
field: 'deptLeaderConfirmStatus',
title: '部门主管确认状态',
visible: false
},
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.makeStatus == '0'){ if(row.makeStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
} }
if(row.deptLeaderConfirmStatus == '0'){
if(row.delFlag == '0'){ actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
} }
// if(row.delFlag == '0'){
// actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
// }else{
// actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
// }
return actions.join(''); return actions.join('');
} }
}] }]

Loading…
Cancel
Save