Browse Source

[feat] 工程管理

修改物料信息的作废前端按钮,新增作废前提醒和确认后打开作废页面
新增物料信息作废前端页面
新增物料信息作废权限字符
新增 根据物料信息对象作废客户报价后端接口
新增 加载作废物料信息弹窗后端接口
修改 作废物料信息后端接口
调整驳回调整、工程经理审核、工程主管审核、研发总监审核页面:调整页面布局整齐、调整备注字段的数据回显
修改根据id查询物料信息后端接口,加上作废理由字段,修改 修改接口,加上作废理由字段
dev
liuxiaoxu 3 months ago
parent
commit
d7598225c7
  1. 35
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 4
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  3. 33
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  4. 9
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml
  5. 32
      ruoyi-admin/src/main/resources/templates/erp/material/cancel.html
  6. 12
      ruoyi-admin/src/main/resources/templates/erp/material/material.html
  7. 7
      ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html
  8. 6
      ruoyi-admin/src/main/resources/templates/erp/material/taskGczgVerify.html
  9. 6
      ruoyi-admin/src/main/resources/templates/erp/material/taskYfzjVerify.html

35
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -13,6 +13,7 @@ import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper; import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.SysCustomer;
import com.ruoyi.system.domain.SysErpMaterialSysTechnicalTeam; import com.ruoyi.system.domain.SysErpMaterialSysTechnicalTeam;
import com.ruoyi.system.service.ISysErpMaterialSysTechnicalTeamService; import com.ruoyi.system.service.ISysErpMaterialSysTechnicalTeamService;
import com.ruoyi.system.service.ISysTechnicalTeamService; import com.ruoyi.system.service.ISysTechnicalTeamService;
@ -295,14 +296,40 @@ public class ErpMaterialController extends BaseController
* 作废物料信息 * 作废物料信息
*/ */
// @RequiresPermissions("erp:material:cancel") // @RequiresPermissions("erp:material:cancel")
// @Log(title = "物料信息", businessType = BusinessType.CANCEL)
// @GetMapping( "/cancel/{id}")
// @ResponseBody
// public AjaxResult cancel(@PathVariable("id") Long id){
// erpMaterialService.cancelErpMaterialById(id);
// return AjaxResult.success();
// }
/**
* 加载作废物料信息弹窗
*/
@GetMapping("/cancel/{id}")
public String cancel(@PathVariable("id") Long id, ModelMap mmap) {
ErpMaterial erpMaterial = erpMaterialService.selectErpMaterialById(id);
mmap.put("erpMaterial", erpMaterial);
return prefix + "/cancel";
}
/**
* 作废物料信息
*/
//@RequiresPermissions("erp:material:cancel")
@Log(title = "物料信息", businessType = BusinessType.CANCEL) @Log(title = "物料信息", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}") @PostMapping( "/cancel")
@ResponseBody @ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){ public AjaxResult cancel(ErpMaterial erpMaterial){
erpMaterialService.cancelErpMaterialById(id); return toAjax(erpMaterialService.cancelErpMaterialByObject(erpMaterial));
return AjaxResult.success();
} }
/** /**
* 恢复物料信息 * 恢复物料信息
*/ */

4
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -135,4 +135,8 @@ public interface IErpMaterialService
List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo); List<ErpMaterialVo> selectAllErpMaterialListByMaterialVo(ErpMaterialVo erpMaterialVo);
/**
* 通过物料信息作废物料信息
* */
int cancelErpMaterialByObject(ErpMaterial erpMaterial);
} }

33
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -381,6 +381,39 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return processInstance; return processInstance;
} }
/**
* 通过物料信息作废物料信息
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int cancelErpMaterialByObject(ErpMaterial erpMaterial) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(erpMaterial.getId());
// 审核状态-待审核
erpMaterialVo.setAuditStatus("0");
SysUser user = ShiroUtils.getSysUser();
// 启动流程
String applyTitle = user.getUserName()+"发起了物料信息作废审批-"+DateUtils.dateTimeNow();
String instanceType = "cancel";
ErpMaterial tempErpMaterial = new ErpMaterial();
BeanUtils.copyProperties(erpMaterialVo,tempErpMaterial);
ProcessInstance processInstance = startProcessInstance(applyTitle,instanceType,tempErpMaterial, user);
String processInstanceId = processInstance.getProcessInstanceId();
// 作废实例id
tempErpMaterial.setCancelInstanceId(processInstanceId);
// 存在提交完就流程结束的情况
boolean processIsFinish = processService.judgeProcessIsFinish(processInstanceId);
if(processIsFinish){
// 审核状态-审核通过
tempErpMaterial.setAuditStatus("1");
// 使用状态-已作废
tempErpMaterial.setUseStatus("2");
}
tempErpMaterial.setCancelRemark(erpMaterial.getCancelRemark());
return erpMaterialMapper.updateErpMaterial(tempErpMaterial);
}
@Override @Override
public ProcessInstance restoreErpMaterialById(Long id) { public ProcessInstance restoreErpMaterialById(Long id) {
ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id); ErpMaterialVo erpMaterialVo = erpMaterialMapper.selectErpMaterialById(id);

9
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -41,12 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="supplierId" column="supplier_id" /> <result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" /> <result property="supplierName" column="supplier_name" />
<result property="bomId" column="bom_id" /> <result property="bomId" column="bom_id" />
<result property="cancelRemark" column="cancel_remark"/>
</resultMap> </resultMap>
<sql id="selectErpMaterialVo"> <sql id="selectErpMaterialVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, select id, del_flag, create_by, create_time, update_by, update_time, remark,
bomNo, material_no, material_name, audit_status, use_status, bomNo, material_no, material_name, audit_status, use_status,cancel_remark,
hava_product_tem,product_item,itemName, material_type, process_method, hava_product_tem,product_item,itemName, material_type, process_method,
unit, brand, `describe`, warehouse_dept,business_members,instance_id,instance_type,submit_instance_id, unit, brand, `describe`, warehouse_dept,business_members,instance_id,instance_type,submit_instance_id,
cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_material cancel_instance_id,restore_instance_id,apply_title,apply_user,apply_time from erp_material
@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectErpMaterialById" parameterType="Long" resultMap="ErpMaterialResult"> <select id="selectErpMaterialById" parameterType="Long" resultMap="ErpMaterialResult">
select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bomNo, erp.material_no select erp.id, erp.del_flag, erp.create_by, erp.create_time, erp.update_by, erp.update_time, erp.remark,erp.bomNo, erp.material_no
, erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,erp.product_item,erp.itemName, erp.material_type , erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,erp.product_item,erp.itemName, erp.material_type
, erp.process_method, erp.unit, erp.brand, erp.describe, erp.warehouse_dept,erp.supplier_id,erp.business_members , erp.process_method, erp.unit, erp.brand, erp.describe, erp.warehouse_dept,erp.supplier_id,erp.business_members,erp.cancel_remark
,erp.instance_id,erp.instance_type,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time ,erp.instance_id,erp.instance_type,erp.submit_instance_id,erp.cancel_instance_id,erp.restore_instance_id,erp.apply_title,erp.apply_user,erp.apply_time
,att.id as photo_attach_id ,att.id as photo_attach_id
from erp_material erp from erp_material erp
@ -227,6 +227,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">del_flag,</if> <if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if> <if test="updateTime != null">update_time,</if>
<if test="cancelRemark != null">cancel_remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
@ -260,6 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="delFlag != null">#{del_flag},</if> <if test="delFlag != null">#{del_flag},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="cancelRemark != null">#{cancelRemark},</if>
</trim> </trim>
</insert> </insert>
@ -297,6 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTime != null">apply_time = #{applyTime},</if> <if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if> <if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="updateTime != null">update_time = #{updateTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="cancelRemark != null">cancel_remark = #{cancelRemark},</if>
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>

32
ruoyi-admin/src/main/resources/templates/erp/material/cancel.html

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('作废')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal" id="form-material-cancel" th:object="${erpMaterial}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label is-required">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:field="*{cancelRemark}" class="form-control" required></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "erp/material";
$("#form-material-cancel").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/cancel", $('#form-material-cancel').serialize());
}
}
</script>
</body>
</html>

12
ruoyi-admin/src/main/resources/templates/erp/material/material.html

@ -201,7 +201,7 @@
// 审核状态-审核通过 使用状态-是 未发起作废流程 // 审核状态-审核通过 使用状态-是 未发起作废流程
if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){ if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId){
// 作废 // 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>'); actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 编辑 // 编辑
actions.push('<a class="btn btn-success btn-xs" 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" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
} }
@ -298,6 +298,16 @@
}); });
}); });
} }
//作废
function cancel(id) {
$.modal.confirm("确定作废该物料信息吗?", function() {
var url = prefix + "/cancel/" + id;
$.modal.open("作废", url);
})
}
</script> </script>
</body> </body>
</html> </html>

7
ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html

@ -125,6 +125,13 @@
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> <input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly>
</div> </div>
<hr /> <hr />
<div class="form-group">
<label class="col-sm-3 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" for="gcjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-3 control-label" for="gcjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">

6
ruoyi-admin/src/main/resources/templates/erp/material/taskGczgVerify.html

@ -125,6 +125,12 @@
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> <input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly>
</div> </div>
<hr /> <hr />
<div class="form-group">
<label class="col-sm-3 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" for="gczgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-3 control-label" for="gczgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">

6
ruoyi-admin/src/main/resources/templates/erp/material/taskYfzjVerify.html

@ -125,6 +125,12 @@
<input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly> <input id="removeFileIdStr" type="text" name="removeFileIdStr" hidden readonly>
</div> </div>
<hr /> <hr />
<div class="form-group">
<label class="col-sm-3 control-label">作废理由:</label>
<div class="col-sm-8">
<textarea name="cancelRemark" th:text="*{cancelRemark}" class="form-control" readonly></textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" for="yfzjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-3 control-label" for="yfzjVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
<div class="col-sm-8"> <div class="col-sm-8">

Loading…
Cancel
Save