Browse Source

[feat] 委外加工

整合新增委外工序表实体类
整合新增委外工序Controller
整合新增委外工序Mapper
整合新增委外工序Mapper.XML
整合新增委外工序Service接口
整合新增委外工序ServiceImpl实现类
整合新增委外工序VO类
整合新增委外工序前端页面
dev
liuxiaoxu 4 months ago
parent
commit
1d0638a298
  1. 121
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceProcessController.java
  2. 46
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceProcess.java
  3. 110
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceProcessVo.java
  4. 50
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/Supplier.java
  5. 95
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceProcessMapper.java
  6. 77
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceProcessService.java
  7. 160
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceProcessServiceImpl.java
  8. 117
      ruoyi-admin/src/main/resources/mapper/system/OutsourceProcessMapper.xml
  9. 69
      ruoyi-admin/src/main/resources/templates/system/outsource_process/add.html
  10. 65
      ruoyi-admin/src/main/resources/templates/system/outsource_process/detail.html
  11. 51
      ruoyi-admin/src/main/resources/templates/system/outsource_process/edit.html
  12. 122
      ruoyi-admin/src/main/resources/templates/system/outsource_process/outsource_process.html

121
ruoyi-admin/src/main/java/com/ruoyi/outsource/controller/OutsourceProcessController.java → ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceProcessController.java

@ -1,10 +1,11 @@
package com.ruoyi.outsource.controller;
package com.ruoyi.system.controller;
import java.text.SimpleDateFormat;
import java.util.List;
import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OutsourceProcess;
import com.ruoyi.system.service.IOutsourceProcessService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -16,39 +17,37 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.outsource.domain.OutsourceProcess;
import com.ruoyi.outsource.service.IOutsourceProcessService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 委外工序列表Controller
* 委外工序Controller
*
* @author zhang
* @date 2024-03-08
* @author ruoyi
* @date 2024-06-30
*/
@Controller
@RequestMapping("/outsource/process")
@RequestMapping("/system/outsource_process")
public class OutsourceProcessController extends BaseController
{
private String prefix = "outsource/process";
private String prefix = "system/outsource_process";
@Autowired
private IOutsourceProcessService outsourceProcessService;
@RequiresPermissions("outsource:process:view")
@RequiresPermissions("system:outsource_process:view")
@GetMapping()
public String process()
public String outsource_process()
{
return prefix + "/process";
return prefix + "/outsource_process";
}
/**
* 查询委外工序列表列表
* 查询委外工序列表
*/
@RequiresPermissions("outsource:process:list")
@RequiresPermissions("system:outsource_process:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OutsourceProcess outsourceProcess)
@ -59,21 +58,30 @@ public class OutsourceProcessController extends BaseController
}
/**
* 导出委外工序列表列表
* 导出委外工序列表
*/
@RequiresPermissions("outsource:process:export")
@Log(title = "委外工序列表", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:outsource_process:export")
@Log(title = "委外工序", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceProcess outsourceProcess)
{
List<OutsourceProcess> list = outsourceProcessService.selectOutsourceProcessList(outsourceProcess);
ExcelUtil<OutsourceProcess> util = new ExcelUtil<OutsourceProcess>(OutsourceProcess.class);
return util.exportExcel(list, "委外工序列表数据");
return util.exportExcel(list, "委外工序数据");
}
/**
* 表格细节视图
*/
@RequiresPermissions("system:outsource_process:detail")
@GetMapping("/detail/{outsourceProcessId}")
public String detail(@PathVariable("outsourceProcessId") long outsourceProcessId, ModelMap mmap)
{
mmap.put("outsourceProcess", outsourceProcessService.selectOutsourceProcessByOutsourceProcessId(outsourceProcessId));
return prefix + "/detail";
}
/**
* 新增委外工序列表
* 新增委外工序
*/
@GetMapping("/add")
public String add()
@ -82,77 +90,64 @@ public class OutsourceProcessController extends BaseController
}
/**
* 新增保存委外工序列表
* 新增保存委外工序
*/
@RequiresPermissions("outsource:process:add")
@Log(title = "委外工序列表", businessType = BusinessType.INSERT)
@RequiresPermissions("system:outsource_process:add")
@Log(title = "委外工序", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OutsourceProcess outsourceProcess)
{
if(!outsourceProcessService.checkoutsourceProcessNoUnique(outsourceProcess)){
return error("添加委外工序'" + outsourceProcess.getOutsourceProcessNo() + "'失败,工序编号已存在");
};
outsourceProcess.setCreateTime(DateUtils.getNowDate());
return toAjax(outsourceProcessService.insertOutsourceProcess(outsourceProcess));
}
/**
* 校验委外工序编号
*/
@PostMapping("/checkoutsourceProcessNoUnique")
@ResponseBody
public boolean checkoutsourceProcessNoUnique(OutsourceProcess outsourceProcess)
{
return outsourceProcessService.checkoutsourceProcessNoUnique(outsourceProcess);
}
/**
* 修改委外工序列表
* 修改委外工序
*/
@RequiresPermissions("system:outsource_process:edit")
@GetMapping("/edit/{outsourceProcessId}")
public String edit(@PathVariable("outsourceProcessId") String outsourceProcessId, ModelMap mmap)
public String edit(@PathVariable("outsourceProcessId") Long outsourceProcessId, ModelMap mmap)
{
OutsourceProcess outsourceProcess = outsourceProcessService.selectOutsourceProcessById(outsourceProcessId);
OutsourceProcess outsourceProcess = outsourceProcessService.selectOutsourceProcessByOutsourceProcessId(outsourceProcessId);
mmap.put("outsourceProcess", outsourceProcess);
return prefix + "/edit";
}
/**
* 修改保存委外工序列表
* 修改保存委外工序
*/
@RequiresPermissions("outsource:process:edit")
@Log(title = "委外工序列表", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:outsource_process:edit")
@Log(title = "委外工序", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OutsourceProcess outsourceProcess)
{
outsourceProcess.setUpdateTime(DateUtils.getNowDate());
return toAjax(outsourceProcessService.updateOutsourceProcess(outsourceProcess));
}
/**
* 删除委外工序列表
* 删除委外工序
*/
@RequiresPermissions("outsource:process:remove")
@Log(title = "委外工序列表", businessType = BusinessType.DELETE)
@RequiresPermissions("system:outsource_process:remove")
@Log(title = "委外工序", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(outsourceProcessService.deleteOutsourceProcessByIds(ids));
}
/**
* 作废委外工序列表
*/
@RequiresPermissions("outsource:process:cancel")
@Log(title = "委外工序列表", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") String id){
return toAjax(outsourceProcessService.cancelOutsourceProcessById(id));
}
/**
* 恢复委外工序列表
*/
@RequiresPermissions("outsource:process:restore")
@Log(title = "委外工序列表", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")String id)
{
return toAjax(outsourceProcessService.restoreOutsourceProcessById(id));
}
@PostMapping("/getId")
@ResponseBody
public Result getId() throws Exception {
return Result.getSuccessResult(outsourceProcessService.getId());
return toAjax(outsourceProcessService.deleteOutsourceProcessByOutsourceProcessIds(ids));
}
}

46
ruoyi-admin/src/main/java/com/ruoyi/outsource/domain/OutsourceProcess.java → ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceProcess.java

@ -1,4 +1,4 @@
package com.ruoyi.outsource.domain;
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@ -6,45 +6,59 @@ import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 委外工序列表对象 outsource_process
* 委外工序对象 outsource_process
*
* @author zhang
* @date 2024-03-08
* @author ruoyi
* @date 2024-06-30
*/
public class OutsourceProcess extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外工序id */
// @Excel(name = "委外工序id")
private Long outsourceProcessId;
/** 委外工序ID */
@Excel(name = "委外工序ID")
private String outsourceProcessId;
private String outsourceProcessCode;
/** 委外工序编号 */
@Excel(name = "委外工序编号")
private String outsourceProcessCode;
private String outsourceProcessNo;
/** 委外工序名称 */
@Excel(name = "委外工序名称")
private String outsourceProcessName;
public void setOutsourceProcessId(String outsourceProcessId)
{
private String remark;
public Long getOutsourceProcessId() {
return outsourceProcessId;
}
public void setOutsourceProcessId(Long outsourceProcessId) {
this.outsourceProcessId = outsourceProcessId;
}
public String getOutsourceProcessId()
{
return outsourceProcessId;
public String getOutsourceProcessCode() {
return outsourceProcessCode;
}
public void setOutsourceProcessCode(String outsourceProcessCode)
{
public void setOutsourceProcessCode(String outsourceProcessCode) {
this.outsourceProcessCode = outsourceProcessCode;
}
public String getOutsourceProcessCode()
public void setOutsourceProcessNo(String outsourceProcessNo)
{
return outsourceProcessCode;
this.outsourceProcessNo = outsourceProcessNo;
}
public String getOutsourceProcessNo()
{
return outsourceProcessNo;
}
public void setOutsourceProcessName(String outsourceProcessName)
{
this.outsourceProcessName = outsourceProcessName;
@ -58,7 +72,7 @@ public class OutsourceProcess extends BaseEntity
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceProcessId", getOutsourceProcessId())
.append("outsourceProcessId", getOutsourceProcessId()).append("outsourceProcessId", getOutsourceProcessId())
.append("outsourceProcessCode", getOutsourceProcessCode())
.append("outsourceProcessName", getOutsourceProcessName())
.append("remark", getRemark())

110
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceProcessVo.java

@ -0,0 +1,110 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.OutsourceProcess;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
public class OutsourceProcessVo extends OutsourceProcess {
private static final long serialVersionUID = 1L;
/** 委外工序id */
// @Excel(name = "委外工序id")
private Long outsourceProcessId;
/** 委外工序ID */
private String outsourceProcessCode;
/** 委外工序编号 */
private String outsourceProcessNo;
/** 委外工序名称 */
private String outsourceProcessName;
private String remark;
private List<Supplier> weightSupplier;
private List<Supplier> quantitySupplier;
private List<Supplier> areaSupplier;
public List<Supplier> getWeightSupplier() {
return weightSupplier;
}
public void setWeightSupplier(List<Supplier> weightSupplier) {
this.weightSupplier = weightSupplier;
}
public List<Supplier> getQuantitySupplier() {
return quantitySupplier;
}
public void setQuantitySupplier(List<Supplier> quantitySupplier) {
this.quantitySupplier = quantitySupplier;
}
public List<Supplier> getAreaSupplier() {
return areaSupplier;
}
public void setAreaSupplier(List<Supplier> areaSupplier) {
this.areaSupplier = areaSupplier;
}
@Override
public Long getOutsourceProcessId() {
return outsourceProcessId;
}
@Override
public void setOutsourceProcessId(Long outsourceProcessId) {
this.outsourceProcessId = outsourceProcessId;
}
public String getOutsourceProcessCode() {
return outsourceProcessCode;
}
public void setOutsourceProcessCode(String outsourceProcessCode) {
this.outsourceProcessCode = outsourceProcessCode;
}
public void setOutsourceProcessNo(String outsourceProcessNo)
{
this.outsourceProcessNo = outsourceProcessNo;
}
public String getOutsourceProcessNo()
{
return outsourceProcessNo;
}
public void setOutsourceProcessName(String outsourceProcessName)
{
this.outsourceProcessName = outsourceProcessName;
}
public String getOutsourceProcessName()
{
return outsourceProcessName;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceProcessId", getOutsourceProcessId()).append("outsourceProcessId", getOutsourceProcessId())
.append("outsourceProcessCode", getOutsourceProcessCode())
.append("outsourceProcessName", getOutsourceProcessName())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

50
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/Supplier.java

@ -0,0 +1,50 @@
package com.ruoyi.system.domain.Vo;
import java.math.BigDecimal;
public class Supplier {
/** 供应商编号 */
private String supplierCode;
/** 供应商名称 */
private String supplierName;
/** 工序的不含税单价(RMB) */
private BigDecimal materialRmb;
/** 工序的含税单价(RMB) */
private BigDecimal materialNormb;
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public BigDecimal getMaterialRmb() {
return materialRmb;
}
public void setMaterialRmb(BigDecimal materialRmb) {
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialNormb() {
return materialNormb;
}
public void setMaterialNormb(BigDecimal materialNormb) {
this.materialNormb = materialNormb;
}
}

95
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceProcessMapper.java

@ -0,0 +1,95 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.OutsourceProcess;
import com.ruoyi.system.domain.Vo.OutsourceProcessVo;
import org.apache.ibatis.annotations.Param;
/**
* 委外工序Mapper接口
*
* @author ruoyi
* @date 2024-06-30
*/
public interface OutsourceProcessMapper
{
/**
* 查询委外工序
*
* @param outsourceProcessId 委外工序主键
* @return 委外工序
*/
public OutsourceProcess selectOutsourceProcessByOutsourceProcessId(long outsourceProcessId);
/**
* 查询委外工序
*
* @param outsourceProcessIds 委外工序主键串
* @return 委外工序
*/
public List<OutsourceProcess> selectOutsourceProcessByOutsourceProcessIds(Long[] outsourceProcessIds);
/**
* 查询委外工序
*
* @param outsourceProcessNo 委外工序编号
* @return 委外工序
*/
public OutsourceProcess selectOutsourceProcessByOutsourceProcessNo(String outsourceProcessNo);
/**
* 查询委外工序列表
*
* @param outsourceProcess 委外工序
* @return 委外工序集合
*/
public List<OutsourceProcess> selectOutsourceProcessList(OutsourceProcess outsourceProcess);
/**
* 按编号查询委外工序列表
*
* @param outsourceProcessNos 委外工序编号
* @return 委外工序集合
*/
public List<OutsourceProcessVo> selectOutsourceProcessListByNos(List<String> outsourceProcessNos);
/**
* 新增委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
public int insertOutsourceProcess(OutsourceProcess outsourceProcess);
/**
* 修改委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
public int updateOutsourceProcess(OutsourceProcess outsourceProcess);
/**
* 删除委外工序
*
* @param outsourceProcessId 委外工序主键
* @return 结果
*/
public int deleteOutsourceProcessByOutsourceProcessId(Integer outsourceProcessId);
/**
* 批量删除委外工序
*
* @param outsourceProcessIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourceProcessByOutsourceProcessIds(String[] outsourceProcessIds);
/**
* 查询数据库中今天已经生产的最大序号
*
* @param prefix 前面的ZCGX年月日
*/
public String findMaxRoundCode(@Param("prefix") String prefix);
}

77
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceProcessService.java

@ -0,0 +1,77 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.OutsourceProcess;
import java.util.List;
/**
* 委外工序Service接口
*
* @author ruoyi
* @date 2024-06-30
*/
public interface IOutsourceProcessService
{
/**
* 查询委外工序
*
* @param outsourceProcessId 委外工序主键
* @return 委外工序
*/
public OutsourceProcess selectOutsourceProcessByOutsourceProcessId(Long outsourceProcessId);
/**
* 查询委外工序列表
*
* @param outsourceProcessIds 委外工序主键列表
* @return 委外工序
*/
public List<OutsourceProcess> selectOutsourceProcessByOutsourceProcessIds(String outsourceProcessIds);
/**
* 查询委外工序列表
*
* @param outsourceProcess 委外工序
* @return 委外工序集合
*/
public List<OutsourceProcess> selectOutsourceProcessList(OutsourceProcess outsourceProcess);
/**
* 新增委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
public int insertOutsourceProcess(OutsourceProcess outsourceProcess);
/**
* 校验委外工序编号是否唯一
*
* @param outsourceProcess 菜单信息
* @return 结果
*/
public boolean checkoutsourceProcessNoUnique(OutsourceProcess outsourceProcess);
/**
* 修改委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
public int updateOutsourceProcess(OutsourceProcess outsourceProcess);
/**
* 批量删除委外工序
*
* @param outsourceProcessIds 需要删除的委外工序主键集合
* @return 结果
*/
public int deleteOutsourceProcessByOutsourceProcessIds(String outsourceProcessIds);
/**
* 删除委外工序信息
*
* @param outsourceProcessId 委外工序主键
* @return 结果
*/
public int deleteOutsourceProcessByOutsourceProcessId(Integer outsourceProcessId);
}

160
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceProcessServiceImpl.java

@ -0,0 +1,160 @@
package com.ruoyi.system.service.impl;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.domain.OutsourceProcess;
import com.ruoyi.system.mapper.OutsourceProcessMapper;
import com.ruoyi.system.service.IOutsourceProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;
/**
* 委外工序Service业务层处理
*
* @author ruoyi
* @date 2024-06-30
*/
@Service
public class OutsourceProcessServiceImpl implements IOutsourceProcessService
{
@Autowired
private OutsourceProcessMapper outsourceProcessMapper;
/**
* 查询委外工序
*
* @param outsourceProcessId 委外工序主键
* @return 委外工序
*/
@Override
public OutsourceProcess selectOutsourceProcessByOutsourceProcessId(Long outsourceProcessId)
{
return outsourceProcessMapper.selectOutsourceProcessByOutsourceProcessId(outsourceProcessId);
}
@Override
public List<OutsourceProcess> selectOutsourceProcessByOutsourceProcessIds(String outsourceProcessIds) {
Long[] ids = Convert.toLongArray(outsourceProcessIds);
return outsourceProcessMapper.selectOutsourceProcessByOutsourceProcessIds(ids);
}
/**
* 查询委外工序列表
*
* @param outsourceProcess 委外工序
* @return 委外工序
*/
@Override
public List<OutsourceProcess> selectOutsourceProcessList(OutsourceProcess outsourceProcess)
{
return outsourceProcessMapper.selectOutsourceProcessList(outsourceProcess);
}
/**
* 新增委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
@Override
public int insertOutsourceProcess(OutsourceProcess outsourceProcess)
{
//更改日期格式,以提高可读性
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
String dataPart = df.format(new Date());
//移除日期中的分隔符以便于后续处理
String prefix = "WWGX"+dataPart.replace("-","");
//查询数据库中最大的编号
String maxCode = outsourceProcessMapper.findMaxRoundCode(prefix);
String newCode = generateNewCode(prefix,maxCode);
// outsourceProcess.setOutsourceProcessId();
outsourceProcess.setOutsourceProcessCode(newCode);
System.out.println(outsourceProcess.toString());
outsourceProcess.setCreateTime(DateUtils.getNowDate());
return outsourceProcessMapper.insertOutsourceProcess(outsourceProcess);
}
/**
*委外工序ID生产规则
*系统自动生成按照特定编码编码暂用ZCGX+年月日+001
*自增长:ZCGX20231111001ZCGX20231111002
*
*/
private String generateNewCode(String prefix, String maxCode) {
if (StringUtils.isEmpty(maxCode)){
return prefix+"001";
}
//解析并递增编号
int sequence = Integer.parseInt(maxCode.substring(4)) + 1 ;
// //检查序列号是否溢出
// if (sequence > 999){
// throw new BusinessException("当日编号已达到最大值999,请检查或调整策略");
// }
//格式化序列号,自动补零至三位
DecimalFormat df = new DecimalFormat("000");
return prefix + df.format(sequence);
}
/**
* 校验委外工序编号是否唯一
*
* @param outsourceProcess 委外工序
* @return 结果
*/
@Override
public boolean checkoutsourceProcessNoUnique(OutsourceProcess outsourceProcess) {
if(outsourceProcessMapper.selectOutsourceProcessByOutsourceProcessNo(outsourceProcess.getOutsourceProcessNo())!=null){
return false;
}
return true;
}
/**
* 修改委外工序
*
* @param outsourceProcess 委外工序
* @return 结果
*/
@Override
public int updateOutsourceProcess(OutsourceProcess outsourceProcess)
{
outsourceProcess.setUpdateTime(DateUtils.getNowDate());
return outsourceProcessMapper.updateOutsourceProcess(outsourceProcess);
}
/**
/**
* 批量删除委外工序
*
* @param outsourceProcessIds 需要删除的委外工序主键
* @return 结果
*/
@Override
public int deleteOutsourceProcessByOutsourceProcessIds(String outsourceProcessIds)
{
return outsourceProcessMapper.deleteOutsourceProcessByOutsourceProcessIds(Convert.toStrArray(outsourceProcessIds));
}
/**
* 删除委外工序信息
*
* @param outsourceProcessId 委外工序主键
* @return 结果
*/
@Override
public int deleteOutsourceProcessByOutsourceProcessId(Integer outsourceProcessId)
{
return outsourceProcessMapper.deleteOutsourceProcessByOutsourceProcessId(outsourceProcessId);
}
}

117
ruoyi-admin/src/main/resources/mapper/system/OutsourceProcessMapper.xml

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.OutsourceProcessMapper">
<resultMap type="OutsourceProcessVo" id="OutsourceProcessResult">
<result property="outsourceProcessId" column="outsource_process_id" />
<result property="outsourceProcessCode" column="outsource_process_code" />
<result property="outsourceProcessNo" column="outsource_process_no" />
<result property="outsourceProcessName" column="outsource_process_name" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectOutsourceProcessVo">
select outsource_process_id,outsource_process_code,outsource_process_no, outsource_process_name, remark, create_by, create_time, update_by, update_time from outsource_process
</sql>
<select id="selectOutsourceProcessList" parameterType="OutsourceProcess" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
<where>
<if test="outsourceProcessId != null and outsourceProcessId != ''"> and outsource_process_id = #{outsourceProcessId}</if>
<if test="outsourceProcessNo != null and outsourceProcessNo != ''"> and outsource_process_no = #{outsourceProcessNo}</if>
<if test="outsourceProcessName != null and outsourceProcessName != ''"> and outsource_process_name like concat('%', #{outsourceProcessName}, '%')</if>
</where>
</select>
<select id="selectOutsourceProcessByOutsourceProcessId" parameterType="Long" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
where outsource_process_id = #{outsourceProcessId}
</select>
<select id="selectOutsourceProcessByOutsourceProcessNo" parameterType="String" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
where outsource_process_no = #{outsourceProcessNo}
</select>
<select id="selectOutsourceProcessByOutsourceProcessIds" parameterType="long" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
where outsource_process_id in
<foreach item="outsourceProcessId" collection="array" open="(" separator="," close=")">
#{outsourceProcessId}
</foreach>
</select>
<select id="selectOutsourceProcessListByNos" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
where outsource_process_no in
<foreach item="item" collection="list" open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="selectOutsourceProcessListByNo" parameterType="String" resultMap="OutsourceProcessResult">
<include refid="selectOutsourceProcessVo"/>
where outsource_process_no = #{outsourceProcessNo}
</select>
<insert id="insertOutsourceProcess" parameterType="OutsourceProcess" useGeneratedKeys="true" keyProperty="outsourceProcessId">
insert into outsource_process
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourceProcessCode != null and outsourceProcessCode != ''">outsource_process_code,</if>
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">outsource_process_no,</if>
<if test="outsourceProcessName != null">outsource_process_name,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourceProcessCode != null and outsourceProcessCode != ''">outsource_process_code,</if>
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">#{outsourceProcessNo},</if>
<if test="outsourceProcessName != null">#{outsourceProcessName},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateOutsourceProcess" parameterType="OutsourceProcess">
update outsource_process
<trim prefix="SET" suffixOverrides=",">
<if test="outsourceProcessNo != null and outsourceProcessNo != ''">outsource_process_no = #{outsourceProcessNo},</if>
<if test="outsourceProcessCode != null and outsourceProcessCode != ''">outsource_process_code = #{outsourceProcessCode},</if>
<if test="outsourceProcessName != null">outsource_process_name = #{outsourceProcessName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where outsource_process_id = #{outsourceProcessId}
</update>
<delete id="deleteOutsourceProcessByOutsourceProcessId" parameterType="long">
delete from outsource_process where outsource_process_id = #{outsourceProcessId}
</delete>
<delete id="deleteOutsourceProcessByOutsourceProcessIds" parameterType="String">
delete from outsource_process where outsource_process_id in
<foreach item="outsourceProcessId" collection="array" open="(" separator="," close=")">
#{outsourceProcessId}
</foreach>
</delete>
<select id="findMaxRoundCode" resultType="String">
select max(substring(outsource_process_code,9)) from outsource_process WHERE outsource_process_code LIKE CONCAT(#{prefix}, '%')
</select>
</mapper>

69
ruoyi-admin/src/main/resources/templates/system/outsource_process/add.html

@ -0,0 +1,69 @@
<!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 m" id="form-outsource_process-add">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外工序编号:</label>
<div class="col-sm-8">
<input name="outsourceProcessNo" class="form-control" id="outsourceProcessNo" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序名称:</label>
<div class="col-sm-8">
<input name="outsourceProcessName" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_process"
$("#form-outsource_process-add").validate({
focusCleanup: true,
rules: {
outsourceProcessNo: {
remote: {
url: prefix + "/checkoutsourceProcessNoUnique",
type: "post",
dataType: "json",
data: {
"outsourceProcessNo": function () {
return $.common.trim($("#outsourceProcessNo").val());
}
}
}
},
},
messages: {
"outsourceProcessNo": {
remote: "该工序编号已经存在"
}
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-outsource_process-add').serialize());
}
}
</script>
</body>
</html>

65
ruoyi-admin/src/main/resources/templates/system/outsource_process/detail.html

@ -0,0 +1,65 @@
<!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 m" id="form-user-edit">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序编号:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.outsourceProcessNo}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">委外工序名称:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.outsourceProcessName}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.remark}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">录入人:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.createBy}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">录入时间:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.createTime}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新人:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.updateBy}"></div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">更新时间:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourceProcess.updateTime}"></div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
var prefix = ctx + "system/outsource_process";
$("#form-user-add").validate({
onkeyup: false,
focusCleanup: true
});
</script>
</body>
</html>

51
ruoyi-admin/src/main/resources/templates/system/outsource_process/edit.html

@ -0,0 +1,51 @@
<!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 m" id="form-outsource_process-edit" th:object="${outsourceProcess}">
<input name="outsourceProcessId" th:field="*{outsourceProcessId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外工序编号:</label>
<div class="col-sm-8">
<input name="outsourceProcessNo" th:field="*{outsourceProcessNo}" id="outsourceProcessNo" class="form-control" type="text" required>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序名称:</label>
<div class="col-sm-8">
<input name="outsourceProcessName" th:field="*{outsourceProcessName}" class="form-control" type="text">
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_process";
$("#form-outsource_process-edit").validate({
focusCleanup: true,
});
var outsourceProcess = [[${outsourceProcess}]];
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-outsource_process-edit').serialize());
}
}
</script>
</body>
</html>

122
ruoyi-admin/src/main/resources/templates/system/outsource_process/outsource_process.html

@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('委外工序列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label class="in">委外工序ID:</label>
<input type="text" name="outsourceProcessCode"/>
</li>
<li>
<label class="in">委外工序编号:</label>
<input type="text" name="outsourceProcessNo"/>
</li>
<li>
<label class="in">委外工序名称:</label>
<input type="text" name="outsourceProcessName"/>
</li>
<li class="select-time">
<label>录入时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:outsource_process:add">
<i class="fa fa-plus"></i> 添加
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<style>
.in{
width: 200px;
}
</style>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:outsource_process:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:outsource_process:remove')}]];
var detailFlag = [[${@permission.hasPermi('system:outsource_process:detail')}]];
var prefix = ctx + "system/outsource_process";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
modalName: "委外工序",
columns: [{
checkbox: true
},
{
field: 'outsourceProcessCode',
title: '委外工序ID',
visible: false
},
{
field: 'outsourceProcessNo',
title: '委外工序编号'
},
{
field: 'outsourceProcessName',
title: '委外工序名称'
},
{
field: 'remark',
title: '备注'
},
{
field: 'createBy',
title: '录入人'
},
{
field: 'createTime',
title: '录入时间'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '上次更新时间'
},
{
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.outsourceProcessId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:;" onclick="$.operate.detail(\'' + row.outsourceProcessId + '\')"><i class="fa fa-search"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>
Loading…
Cancel
Save