Browse Source

[feat] 工程管理

开发修改单前端页面新增导出按钮,新增全部导出和可选择部分导出前端js方法;
开发修改单后端Controller层新增导出接口;新增根据开发修改单号数组查询开发修改单集合后端接口和方法
开发修改单实体类新增@Excel注解,字典类型的导出加上dictType关键词
dev
liuxiaoxu 2 months ago
parent
commit
10cd258d2d
  1. 23
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java
  2. 71
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorder.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderMapper.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderService.java
  5. 9
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java
  6. 10
      ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml
  7. 58
      ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html

23
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java

@ -113,19 +113,36 @@ public class ErpDevelopModifyorderController extends BaseController
}
/**
* 导出开发修改单列表
* 导出全部开发修改单列表
*/
@RequiresPermissions("erp:developModifyOrder:export")
@Log(title = "开发修改单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@PostMapping("/exportAll")
@ResponseBody
public AjaxResult export(ErpDevelopModifyorderVo erpDevelopModifyorderVo)
public AjaxResult exportAll(ErpDevelopModifyorderVo erpDevelopModifyorderVo)
{
List<ErpDevelopModifyorderVo> list = erpDevelopModifyorderService.selectErpDevelopModifyorderList(erpDevelopModifyorderVo);
ExcelUtil<ErpDevelopModifyorderVo> util = new ExcelUtil<ErpDevelopModifyorderVo>(ErpDevelopModifyorderVo.class);
return util.exportExcel(list, "开发修改单数据");
}
/**
* 导出选择的开发修改单列表
*/
@RequiresPermissions("erp:developModifyOrder:export")
@Log(title = "开发修改单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(@RequestBody String[] developOrderCodes)
{
List<ErpDevelopModifyorderVo> list = erpDevelopModifyorderService.selectErpDevelopModifyorderListByCodes(developOrderCodes);
ExcelUtil<ErpDevelopModifyorderVo> util = new ExcelUtil<ErpDevelopModifyorderVo>(ErpDevelopModifyorderVo.class);
return util.exportExcel(list, "开发修改单数据");
}
/**
* 新增开发修改单
*/

71
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpDevelopModifyorder.java

@ -35,33 +35,6 @@ public class ErpDevelopModifyorder extends BaseEntity
@Excel(name = "料号")
private String materialNo;
/** 采购入库状态(0待采购、1采购中、2待暂收、3部分暂收、4全部暂收、5已暂收、6待入库、7部分入库、8全部入库、9已入库) */
@Excel(name = "采购入库状态")
private String purchaseStorageStatus;
/** 品质状态 (0待品质、1部分品质、2全部品质)*/
@Excel(name = "品质状态")
private String qualityStatus;
/** 审核状态 (0待审核、1审核通过、2审核拒绝)*/
@Excel(name = "审核状态")
private String auditStatus;
/** 确认状态 (0待确认、1部分确认、2已确认)*/
@Excel(name = "确认状态")
private String completeStatus;
/** 完成状态 (0待完成、1已完成)*/
@Excel(name = "完成状态")
private String finshStatus;
/** 使用状态 (0否、1是、2已作废)*/
@Excel(name = "使用状态")
private String useStatus;
/** 订单类型(0客户订单、1研发订单、2其他订单)*/
private String orderType;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
@ -71,11 +44,9 @@ public class ErpDevelopModifyorder extends BaseEntity
private String materialType;
/** 图片 */
@Excel(name = "图片")
private String materialPhotoUrl;
/** 单位 */
@Excel(name = "单位")
private String materialUnit;
/** 品牌 */
@ -87,44 +58,70 @@ public class ErpDevelopModifyorder extends BaseEntity
private String materialDescribe;
/** 加工方式 */
@Excel(name = "加工方式")
@Excel(name = "加工方式",dictType = "processMethod")
private String materialProcessMethod;
/** 工程员 */
@Excel(name = "工程员")
private Long userId;
/** 工程员姓名 */
@Excel(name = "工程员姓名")
@Excel(name = "工程员")
private String userName;
/** 采购入库状态(0待采购、1采购中、2待暂收、3部分暂收、4全部暂收、5已暂收、6待入库、7部分入库、8全部入库、9已入库) */
@Excel(name = "采购入库状态",dictType = "eceiptStatus")
private String purchaseStorageStatus;
/** 品质状态 (0待品质、1部分品质、2全部品质)*/
@Excel(name = "品质状态",dictType = "qualityStatus")
private String qualityStatus;
/** 审核状态 (0待审核、1审核通过、2审核拒绝)*/
@Excel(name = "审核状态",dictType = "auditStatus")
private String auditStatus;
/** 确认状态 (0待确认、1部分确认、2已确认)*/
@Excel(name = "确认状态",dictType = "completeStatus")
private String completeStatus;
/** 完成状态 (0待完成、1已完成)*/
@Excel(name = "完成状态",dictType = "finshStatus")
private String finshStatus;
/** 使用状态 (0否、1是、2已作废)*/
@Excel(name = "使用状态",dictType = "useStatus")
private String useStatus;
/** 订单类型(0客户订单、1研发订单、2其他订单)*/
private String orderType;
/** 领料员 */
private String pickingUser;
/** 修改完成时间 */
@Excel(name = "修改完成时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date updateFinishTime;
/** 修改前说明 */
@Excel(name = "修改前说明")
private String beforeUpdateRemark;
@Excel(name = "修改后说明")
/** 修改后说明 */
private String afterUpdateRemark;
/** 流程实例ID */
@Excel(name = "流程实例ID")
private String instanceId;
/** 流程实例类型 */
@Excel(name = "流程实例类型")
private String instanceType;
/** 流程提交实例ID */
@Excel(name = "流程提交实例ID")
private String submitInstanceId;
/** 申请标题 */
@Excel(name = "申请标题")
private String applyTitle;
/** 申请时间 */
@ -137,11 +134,9 @@ public class ErpDevelopModifyorder extends BaseEntity
private String applyUser;
/** 流程作废实例ID */
@Excel(name = "流程作废实例ID")
private String cancelInstanceId;
/** 流程恢复实例ID */
@Excel(name = "流程恢复实例ID")
private String restoreInstanceId;

5
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpDevelopModifyorderMapper.java

@ -86,4 +86,9 @@ public interface ErpDevelopModifyorderMapper
* 根据开发修改单号查询开发修改单
* */
ErpDevelopModifyorder selectErpDevelopModifyorderByCode(String relatedOrderCode);
/**
* 根据开发修改单号数组查询开发修改单集合
* */
List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderListByCodes(String[] developOrderCodes);
}

5
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpDevelopModifyorderService.java

@ -99,4 +99,9 @@ public interface IErpDevelopModifyorderService
* 修改保存开发修改单详情
* */
int detailErpDevelopModifyorder(ErpDevelopModifyorder erpDevelopModifyorder);
/**
* 根据开发修改单号数组查询开发修改单列表集合
* */
List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderListByCodes(String[] developOrderCodes);
}

9
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpDevelopModifyorderServiceImpl.java

@ -91,6 +91,15 @@ public class ErpDevelopModifyorderServiceImpl implements IErpDevelopModifyorderS
return erpDevelopModifyorderMapper.selectErpDevelopModifyorderById(developOrderId);
}
/**
* 根据开发修改单号数组查询开发修改单列表集合
* */
@Override
public List<ErpDevelopModifyorderVo> selectErpDevelopModifyorderListByCodes(String[] developOrderCodes) {
return erpDevelopModifyorderMapper.selectErpDevelopModifyorderListByCodes(developOrderCodes);
}
/**
* 查询开发修改单列表
*

10
ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml

@ -79,6 +79,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where develop_order_code = #{developOrderCode}
</select>
<select id="selectErpDevelopModifyorderListByCodes" parameterType="String" resultMap="ErpDevelopModifyorderResult">
<include refid="selectErpDevelopModifyorderVo"/>
where develop_order_code in
<foreach collection="array" item="developOrderCode" open="(" separator="," close=")">
#{developOrderCode}
</foreach>
</select>
<insert id="insertErpDevelopModifyorder" parameterType="ErpDevelopModifyorderVo" useGeneratedKeys="true" keyProperty="developOrderId">
insert into erp_develop_modifyorder
<trim prefix="(" suffix=")" suffixOverrides=",">

58
ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html

@ -65,6 +65,9 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:developModifyOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="erp:developModifyOrder:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space:nowrap"></table>
@ -297,6 +300,61 @@
$.modal.open("添加领料单",url);
}
//开发修改单导出
function exportExcel(formId) {
// $.table.set();
var developOrderCodeData = [];
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.confirm("确定导出所有开发修改单吗?", function() {
var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
var params = $("#bootstrap-table").bootstrapTable('getOptions');
var dataParam = $("#" + currentId).serializeArray();
dataParam.push({ "name": "orderByColumn", "value": params.sortName });
dataParam.push({ "name": "isAsc", "value": params.sortOrder });
$.modal.loading("正在导出数据,请稍后...");
$.post(prefix + '/exportAll', dataParam, function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg)
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}else {
$.modal.confirm("确定导出选中的所有开发修改单吗?", function () {
//·拼接单号
for(let i=0;i<selections.length;i++){
developOrderCodeData.push(selections[i].developOrderCode);
}
var developOrderCodes = JSON.stringify(developOrderCodeData);
// console.log(bomNos);
$.modal.loading("正在导出数据,请稍后...");
var config = {
url: prefix + '/export',
type: "post",
dataType: "json",
contentType: "application/json;charset=utf-8",
data: developOrderCodes,
success: function(result) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
$.modal.alertSuccess("导出成功!")
$.modal.closeLoading();
},
error: function (result){
$.modal.alertError(result.msg);
}
};
$.ajax(config)
});
}
};
//查询工程员
function engineer(){
$.ajax({

Loading…
Cancel
Save