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. 45
      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.core.controller.BaseController;
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.enums.BusinessType;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderDept;
@ -64,6 +66,17 @@ public class SysMakeOrderController extends BaseController
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
public TableDataInfo list(SysMakeOrder sysMakeOrder)
{
SysUser sysUser = ShiroUtils.getSysUser();
String deptNumber = sysUser.getDept().getDeptNumber();
sysMakeOrder.setDeptNumber(deptNumber);
startPage();
List<SysMakeOrder> list = sysMakeOrderService.selectSysMakeOrderList(sysMakeOrder);
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 deptNumber;
/** 部门主管确认状态 */
private String deptLeaderConfirmStatus;
public void setId(Long id)
{
this.id = id;
@ -248,6 +253,22 @@ public class SysMakeOrder extends BaseEntity
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
public String toString() {
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 结果
*/
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);
makeorderDeptList.forEach(dept->{
// 业务部门 无需部门领导确认
if("SED".equals(dept.getDeptNumber())){
if("GMD".equals(dept.getDeptNumber())){
// 已确认
dept.setDeptLeaderConfirmStatus("1");
}else{
// 待确认
dept.setDeptLeaderConfirmStatus("0");
}
sysMakeorderDeptMapper.updateSysMakeorderDept(dept);
@ -192,11 +193,13 @@ public class SysMakeorderDeptServiceImpl implements ISysMakeorderDeptService
@Override
public void generateYsDataByMakeNoAndMaterialNo(String makeNo, String materialNo) {
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();
makeorderDept.setMakeNo(makeNo);
makeorderDept.setMaterialNo(materialNo);
makeorderDept.setDeptNumber(ysDeptNumber);
makeorderDept.setDeptNumber(ysDeptNumberArray[0]);
makeorderDept.setDeptName(ysDeptNumberArray[1]);
insertSysMakeorderDept(makeorderDept);
}
}

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

@ -9,9 +9,9 @@ ruoyi:
# 实例演示开关
demoEnabled: false
# 文件路径 示例( 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: D:/ruoyi/uploadPath
# profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false

45
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="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="deptNumber" column="dept_number" />
<result property="deptLeaderConfirmStatus" column="dept_leader_confirm_status" />
</resultMap>
<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>
<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
, 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
, b.dept_leader_confirm_status
from sys_makeorder a
left join(
select makeNo,dept_leader_confirm_status
from sys_makeorder_dept
where dept_number = #{deptNumber}
group by makeNo
)b
on a.makeNo = b.makeNo
<where>
<if test="makeStatus != null and makeStatus != ''"> and make_status = #{makeStatus}</if>
<if test="eceiptStatus != null and eceiptStatus != ''"> and eceipt_status = #{eceiptStatus}</if>
<if test="qualityStatus != null and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
<if test="makeNo != null and makeNo != ''"> and makeNo = #{makeNo}</if>
<if test="saleNo != null and saleNo != ''"> and saleNo = #{saleNo}</if>
<if test="Salesman != null and Salesman != ''"> and Salesman = #{Salesman}</if>
<if test="customerId != null and customerId != ''"> and customerId = #{customerId}</if>
<if test="customerName != null and customerName != ''"> and customerName like concat('%', #{customerName}, '%')</if>
<if test="customerOderCode != null and customerOderCode != ''"> and customerOderCode = #{customerOderCode}</if>
<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>
<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>
</select>
<select id="selectSysMakeOrderById" parameterType="Long" resultMap="SysMakeOrderResult">
<include refid="selectSysMakeOrderVo"/>
where id = #{id}
where a.id = #{id}
</select>
<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}
and dept_number != #{deptNumber}
</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 into sys_makeorder_dept

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

@ -208,23 +208,33 @@
field: 'remark',
title: '备注'
},
{
field: 'deptLeaderConfirmStatus',
title: '部门主管确认状态',
visible: false
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
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-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-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> ');
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> ');
}
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> ');
if(row.deptLeaderConfirmStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</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('');
}
}]

Loading…
Cancel
Save