Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 2 weeks ago
parent
commit
0dd211ad8f
  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. 2
      ruoyi-admin/src/main/resources/templates/erp/material/add.html
  6. 32
      ruoyi-admin/src/main/resources/templates/erp/material/cancel.html
  7. 2
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html
  8. 2
      ruoyi-admin/src/main/resources/templates/erp/material/edit.html
  9. 16
      ruoyi-admin/src/main/resources/templates/erp/material/material.html
  10. 9
      ruoyi-admin/src/main/resources/templates/erp/material/taskGcjlVerify.html
  11. 8
      ruoyi-admin/src/main/resources/templates/erp/material/taskGczgVerify.html
  12. 2
      ruoyi-admin/src/main/resources/templates/erp/material/taskModifyApply.html
  13. 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) // @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}") @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)
@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>

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

@ -32,7 +32,7 @@
<input type="text" id="materialType" name="materialType" hidden /> <input type="text" id="materialType" name="materialType" hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型</label> <label class="col-sm-3 control-label is-required">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required> <select name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>

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>

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

@ -36,7 +36,7 @@
<input type="text" readonly id="materialType" name="materialType" th:field="*{materialType}" hidden /> <input type="text" readonly id="materialType" name="materialType" th:field="*{materialType}" hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">半成品类型</label> <label class="col-sm-3 control-label">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select readonly name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}"> <select readonly name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{processMethod}"></option>

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

@ -33,7 +33,7 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型</label> <label class="col-sm-3 control-label is-required">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select name="processMethod" class="form-control m-b" th:field="*{processMethod}" th:with="type=${@dict.getType('processMethod')}" required> <select name="processMethod" class="form-control m-b" th:field="*{processMethod}" th:with="type=${@dict.getType('processMethod')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>

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

@ -123,8 +123,6 @@
cancelUrl: prefix + "/cancel/{id}", cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}", restoreUrl: prefix + "/restore/{id}",
detailUrl: prefix + "/detail/{id}", detailUrl: prefix + "/detail/{id}",
pageList: [10, 25, 50],
pageSize: 10,
showColumns: true, showColumns: true,
sortable: true, // 是否启用排序 sortable: true, // 是否启用排序
sortStable: true, sortStable: true,
@ -149,7 +147,7 @@
{title: '物料名称',field: 'materialName',}, {title: '物料名称',field: 'materialName',},
{title: '描述',field: 'describe',}, {title: '描述',field: 'describe',},
{title: '品牌',field: 'brand',}, {title: '品牌',field: 'brand',},
{title: '半成品类型',field: 'processMethod', {title: '加工方式',field: 'processMethod',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value); return $.table.selectDictLabel(processMethodDatas, value);
} }
@ -203,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> ');
} }
@ -300,6 +298,16 @@
}); });
}); });
} }
//作废
function cancel(id) {
$.modal.confirm("确定作废该物料信息吗?", function() {
var url = prefix + "/cancel/" + id;
$.modal.open("作废", url);
})
}
</script> </script>
</body> </body>
</html> </html>

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

@ -62,7 +62,7 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型</label> <label class="col-sm-3 control-label is-required">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled> <select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled>
<option value="">请选择</option> <option value="">请选择</option>
@ -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">

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

@ -62,7 +62,7 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" readonly hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型</label> <label class="col-sm-3 control-label is-required">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled> <select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required disabled>
<option value="">请选择</option> <option value="">请选择</option>
@ -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">

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

@ -63,7 +63,7 @@
<input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden /> <input type="text" id="materialType" name="materialType" th:field="*{materialType}" hidden />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">半成品类型</label> <label class="col-sm-3 control-label is-required">加工方式</label>
<div class="col-sm-8"> <div class="col-sm-8">
<select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required> <select id="selectProcessMethod" name="processMethod" class="form-control m-b" th:with="type=${@dict.getType('processMethod')}" required>
<option value="">请选择</option> <option value="">请选择</option>

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