¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.processes.controller; |
| | | |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import com.jcdm.main.bs.processes.domain.BsProcessesInfo; |
| | | import com.jcdm.main.bs.processes.service.IBsProcessesInfoService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.jcdm.common.annotation.Log; |
| | | import com.jcdm.common.core.controller.BaseController; |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | | import com.jcdm.common.enums.BusinessType; |
| | | import com.jcdm.common.utils.poi.ExcelUtil; |
| | | import com.jcdm.common.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * å·¥åºä¿¡æ¯Controller |
| | | * |
| | | * @author ruimin |
| | | * @date 2023-12-09 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/bs/processes") |
| | | public class BsProcessesInfoController extends BaseController |
| | | { |
| | | @Autowired |
| | | private IBsProcessesInfoService bsProcessesInfoService; |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | startPage(); |
| | | List<BsProcessesInfo> list = bsProcessesInfoService.selectBsProcessesInfoList(bsProcessesInfo); |
| | | return getDataTable(list); |
| | | } |
| | | |
| | | /** |
| | | * 导åºå·¥åºä¿¡æ¯å表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:export')") |
| | | @Log(title = "å·¥åºä¿¡æ¯", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | List<BsProcessesInfo> list = bsProcessesInfoService.selectBsProcessesInfoList(bsProcessesInfo); |
| | | ExcelUtil<BsProcessesInfo> util = new ExcelUtil<BsProcessesInfo>(BsProcessesInfo.class); |
| | | util.exportExcel(response, list, "å·¥åºä¿¡æ¯æ°æ®"); |
| | | } |
| | | |
| | | /** |
| | | * è·åå·¥åºä¿¡æ¯è¯¦ç»ä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | return success(bsProcessesInfoService.selectBsProcessesInfoById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥åºä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:add')") |
| | | @Log(title = "å·¥åºä¿¡æ¯", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | return toAjax(bsProcessesInfoService.insertBsProcessesInfo(bsProcessesInfo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åºä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:edit')") |
| | | @Log(title = "å·¥åºä¿¡æ¯", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public AjaxResult edit(@RequestBody BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | return toAjax(bsProcessesInfoService.updateBsProcessesInfo(bsProcessesInfo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å·¥åºä¿¡æ¯ |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('bs:processes:remove')") |
| | | @Log(title = "å·¥åºä¿¡æ¯", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | return toAjax(bsProcessesInfoService.deleteBsProcessesInfoByIds(ids)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.processes.domain; |
| | | |
| | | import org.apache.commons.lang3.builder.ToStringBuilder; |
| | | import org.apache.commons.lang3.builder.ToStringStyle; |
| | | import com.jcdm.common.annotation.Excel; |
| | | import com.jcdm.common.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * å·¥åºä¿¡æ¯å¯¹è±¡ bs_processes_info |
| | | * |
| | | * @author ruimin |
| | | * @date 2023-12-09 |
| | | */ |
| | | public class BsProcessesInfo extends BaseEntity |
| | | { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** 主é®id */ |
| | | private Long id; |
| | | |
| | | /** å·¥åºç¼å· */ |
| | | @Excel(name = "å·¥åºç¼å·") |
| | | private String processesCode; |
| | | |
| | | /** å·¥åºå称 */ |
| | | @Excel(name = "å·¥åºå称") |
| | | private String processesName; |
| | | |
| | | /** å·¥åºç±»å */ |
| | | @Excel(name = "å·¥åºç±»å") |
| | | private String processesType; |
| | | |
| | | /** åå¤æ¶é´ */ |
| | | @Excel(name = "åå¤æ¶é´") |
| | | private String preparationTime; |
| | | |
| | | /** ç产æ¶é´ */ |
| | | @Excel(name = "ç产æ¶é´") |
| | | private String productiveTime; |
| | | |
| | | /** ç¶æ */ |
| | | @Excel(name = "ç¶æ") |
| | | private String status; |
| | | |
| | | /** é¢çå段1 */ |
| | | private String spareField1; |
| | | |
| | | /** é¢çå段2 */ |
| | | private String spareField2; |
| | | |
| | | /** é¢çå段3 */ |
| | | private String spareField3; |
| | | |
| | | /** é¢çå段4 */ |
| | | private String spareField4; |
| | | |
| | | /** å建ç¨æ· */ |
| | | @Excel(name = "å建ç¨æ·") |
| | | private String createUser; |
| | | |
| | | /** æ´æ¹ç¨æ· */ |
| | | @Excel(name = "æ´æ¹ç¨æ·") |
| | | private String updateUser; |
| | | |
| | | /** å¤æ³¨ */ |
| | | @Excel(name = "å¤æ³¨") |
| | | private String remarks; |
| | | |
| | | public void setId(Long id) |
| | | { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Long getId() |
| | | { |
| | | return id; |
| | | } |
| | | public void setProcessesCode(String processesCode) |
| | | { |
| | | this.processesCode = processesCode; |
| | | } |
| | | |
| | | public String getProcessesCode() |
| | | { |
| | | return processesCode; |
| | | } |
| | | public void setProcessesName(String processesName) |
| | | { |
| | | this.processesName = processesName; |
| | | } |
| | | |
| | | public String getProcessesName() |
| | | { |
| | | return processesName; |
| | | } |
| | | public void setProcessesType(String processesType) |
| | | { |
| | | this.processesType = processesType; |
| | | } |
| | | |
| | | public String getProcessesType() |
| | | { |
| | | return processesType; |
| | | } |
| | | public void setPreparationTime(String preparationTime) |
| | | { |
| | | this.preparationTime = preparationTime; |
| | | } |
| | | |
| | | public String getPreparationTime() |
| | | { |
| | | return preparationTime; |
| | | } |
| | | public void setProductiveTime(String productiveTime) |
| | | { |
| | | this.productiveTime = productiveTime; |
| | | } |
| | | |
| | | public String getProductiveTime() |
| | | { |
| | | return productiveTime; |
| | | } |
| | | public void setStatus(String status) |
| | | { |
| | | this.status = status; |
| | | } |
| | | |
| | | public String getStatus() |
| | | { |
| | | return status; |
| | | } |
| | | public void setSpareField1(String spareField1) |
| | | { |
| | | this.spareField1 = spareField1; |
| | | } |
| | | |
| | | public String getSpareField1() |
| | | { |
| | | return spareField1; |
| | | } |
| | | public void setSpareField2(String spareField2) |
| | | { |
| | | this.spareField2 = spareField2; |
| | | } |
| | | |
| | | public String getSpareField2() |
| | | { |
| | | return spareField2; |
| | | } |
| | | public void setSpareField3(String spareField3) |
| | | { |
| | | this.spareField3 = spareField3; |
| | | } |
| | | |
| | | public String getSpareField3() |
| | | { |
| | | return spareField3; |
| | | } |
| | | public void setSpareField4(String spareField4) |
| | | { |
| | | this.spareField4 = spareField4; |
| | | } |
| | | |
| | | public String getSpareField4() |
| | | { |
| | | return spareField4; |
| | | } |
| | | public void setCreateUser(String createUser) |
| | | { |
| | | this.createUser = createUser; |
| | | } |
| | | |
| | | public String getCreateUser() |
| | | { |
| | | return createUser; |
| | | } |
| | | public void setUpdateUser(String updateUser) |
| | | { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | public String getUpdateUser() |
| | | { |
| | | return updateUser; |
| | | } |
| | | public void setRemarks(String remarks) |
| | | { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getRemarks() |
| | | { |
| | | return remarks; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
| | | .append("id", getId()) |
| | | .append("processesCode", getProcessesCode()) |
| | | .append("processesName", getProcessesName()) |
| | | .append("processesType", getProcessesType()) |
| | | .append("preparationTime", getPreparationTime()) |
| | | .append("productiveTime", getProductiveTime()) |
| | | .append("status", getStatus()) |
| | | .append("spareField1", getSpareField1()) |
| | | .append("spareField2", getSpareField2()) |
| | | .append("spareField3", getSpareField3()) |
| | | .append("spareField4", getSpareField4()) |
| | | .append("createUser", getCreateUser()) |
| | | .append("createTime", getCreateTime()) |
| | | .append("updateUser", getUpdateUser()) |
| | | .append("updateTime", getUpdateTime()) |
| | | .append("remarks", getRemarks()) |
| | | .toString(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.processes.mapper; |
| | | |
| | | import com.jcdm.main.bs.processes.domain.BsProcessesInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å·¥åºä¿¡æ¯Mapperæ¥å£ |
| | | * |
| | | * @author ruimin |
| | | * @date 2023-12-09 |
| | | */ |
| | | public interface BsProcessesInfoMapper |
| | | { |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return å·¥åºä¿¡æ¯ |
| | | */ |
| | | public BsProcessesInfo selectBsProcessesInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯å表 |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return å·¥åºä¿¡æ¯éå |
| | | */ |
| | | public List<BsProcessesInfo> selectBsProcessesInfoList(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * æ°å¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertBsProcessesInfo(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateBsProcessesInfo(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * å é¤å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsProcessesInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¹éå é¤å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤çæ°æ®ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsProcessesInfoByIds(Long[] ids); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.processes.service; |
| | | |
| | | import com.jcdm.main.bs.processes.domain.BsProcessesInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å·¥åºä¿¡æ¯Serviceæ¥å£ |
| | | * |
| | | * @author ruimin |
| | | * @date 2023-12-09 |
| | | */ |
| | | public interface IBsProcessesInfoService |
| | | { |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return å·¥åºä¿¡æ¯ |
| | | */ |
| | | public BsProcessesInfo selectBsProcessesInfoById(Long id); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯å表 |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return å·¥åºä¿¡æ¯éå |
| | | */ |
| | | public List<BsProcessesInfo> selectBsProcessesInfoList(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * æ°å¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertBsProcessesInfo(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | public int updateBsProcessesInfo(BsProcessesInfo bsProcessesInfo); |
| | | |
| | | /** |
| | | * æ¹éå é¤å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤çå·¥åºä¿¡æ¯ä¸»é®éå |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsProcessesInfoByIds(Long[] ids); |
| | | |
| | | /** |
| | | * å é¤å·¥åºä¿¡æ¯ä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | public int deleteBsProcessesInfoById(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.jcdm.main.bs.processes.service.impl; |
| | | |
| | | import java.util.List; |
| | | import com.jcdm.common.utils.DateUtils; |
| | | import com.jcdm.main.bs.processes.domain.BsProcessesInfo; |
| | | import com.jcdm.main.bs.processes.mapper.BsProcessesInfoMapper; |
| | | import com.jcdm.main.bs.processes.service.IBsProcessesInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * å·¥åºä¿¡æ¯Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruimin |
| | | * @date 2023-12-09 |
| | | */ |
| | | @Service |
| | | public class BsProcessesInfoServiceImpl implements IBsProcessesInfoService |
| | | { |
| | | @Autowired |
| | | private BsProcessesInfoMapper bsProcessesInfoMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return å·¥åºä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public BsProcessesInfo selectBsProcessesInfoById(Long id) |
| | | { |
| | | return bsProcessesInfoMapper.selectBsProcessesInfoById(id); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºä¿¡æ¯å表 |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return å·¥åºä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<BsProcessesInfo> selectBsProcessesInfoList(BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | return bsProcessesInfoMapper.selectBsProcessesInfoList(bsProcessesInfo); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertBsProcessesInfo(BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | bsProcessesInfo.setCreateTime(DateUtils.getNowDate()); |
| | | return bsProcessesInfoMapper.insertBsProcessesInfo(bsProcessesInfo); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param bsProcessesInfo å·¥åºä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateBsProcessesInfo(BsProcessesInfo bsProcessesInfo) |
| | | { |
| | | bsProcessesInfo.setUpdateTime(DateUtils.getNowDate()); |
| | | return bsProcessesInfoMapper.updateBsProcessesInfo(bsProcessesInfo); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤å·¥åºä¿¡æ¯ |
| | | * |
| | | * @param ids éè¦å é¤çå·¥åºä¿¡æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteBsProcessesInfoByIds(Long[] ids) |
| | | { |
| | | return bsProcessesInfoMapper.deleteBsProcessesInfoByIds(ids); |
| | | } |
| | | |
| | | /** |
| | | * å é¤å·¥åºä¿¡æ¯ä¿¡æ¯ |
| | | * |
| | | * @param id å·¥åºä¿¡æ¯ä¸»é® |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int deleteBsProcessesInfoById(Long id) |
| | | { |
| | | return bsProcessesInfoMapper.deleteBsProcessesInfoById(id); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.jcdm.main.bs.processes.mapper.BsProcessesInfoMapper"> |
| | | |
| | | <resultMap type="BsProcessesInfo" id="BsProcessesInfoResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="processesCode" column="processes_code" /> |
| | | <result property="processesName" column="processes_name" /> |
| | | <result property="processesType" column="processes_type" /> |
| | | <result property="preparationTime" column="preparation_time" /> |
| | | <result property="productiveTime" column="productive_time" /> |
| | | <result property="status" column="status" /> |
| | | <result property="spareField1" column="spare_field_1" /> |
| | | <result property="spareField2" column="spare_field_2" /> |
| | | <result property="spareField3" column="spare_field_3" /> |
| | | <result property="spareField4" column="spare_field_4" /> |
| | | <result property="createUser" column="create_user" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="remarks" column="remarks" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectBsProcessesInfoVo"> |
| | | select id, processes_code, processes_name, processes_type, preparation_time, productive_time, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks from bs_processes_info |
| | | </sql> |
| | | |
| | | <select id="selectBsProcessesInfoList" parameterType="BsProcessesInfo" resultMap="BsProcessesInfoResult"> |
| | | <include refid="selectBsProcessesInfoVo"/> |
| | | <!-- <where> --> |
| | | <!-- <if test="processesCode != null and processesCode != ''"> and processes_code = #{processesCode}</if>--> |
| | | <!-- <if test="processesName != null and processesName != ''"> and processes_name like concat('%', #{processesName}, '%')</if>--> |
| | | <!-- <if test="processesType != null and processesType != ''"> and processes_type like concat('%', #{processesType}, '%')</if>--> |
| | | <!-- <if test="status != null and status != ''"> and status = #{status}</if>--> |
| | | <!-- </where>--> |
| | | </select> |
| | | |
| | | <select id="selectBsProcessesInfoById" parameterType="Long" resultMap="BsProcessesInfoResult"> |
| | | <include refid="selectBsProcessesInfoVo"/> |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertBsProcessesInfo" parameterType="BsProcessesInfo"> |
| | | insert into bs_processes_info |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="processesCode != null and processesCode != ''">processes_code,</if> |
| | | <if test="processesName != null">processes_name,</if> |
| | | <if test="processesType != null and processesType != ''">processes_type,</if> |
| | | <if test="preparationTime != null">preparation_time,</if> |
| | | <if test="productiveTime != null">productive_time,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="spareField1 != null">spare_field_1,</if> |
| | | <if test="spareField2 != null">spare_field_2,</if> |
| | | <if test="spareField3 != null">spare_field_3,</if> |
| | | <if test="spareField4 != null">spare_field_4,</if> |
| | | <if test="createUser != null">create_user,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="remarks != null">remarks,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | | <if test="processesCode != null and processesCode != ''">#{processesCode},</if> |
| | | <if test="processesName != null">#{processesName},</if> |
| | | <if test="processesType != null and processesType != ''">#{processesType},</if> |
| | | <if test="preparationTime != null">#{preparationTime},</if> |
| | | <if test="productiveTime != null">#{productiveTime},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="spareField1 != null">#{spareField1},</if> |
| | | <if test="spareField2 != null">#{spareField2},</if> |
| | | <if test="spareField3 != null">#{spareField3},</if> |
| | | <if test="spareField4 != null">#{spareField4},</if> |
| | | <if test="createUser != null">#{createUser},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="remarks != null">#{remarks},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateBsProcessesInfo" parameterType="BsProcessesInfo"> |
| | | update bs_processes_info |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="processesCode != null and processesCode != ''">processes_code = #{processesCode},</if> |
| | | <if test="processesName != null">processes_name = #{processesName},</if> |
| | | <if test="processesType != null and processesType != ''">processes_type = #{processesType},</if> |
| | | <if test="preparationTime != null">preparation_time = #{preparationTime},</if> |
| | | <if test="productiveTime != null">productive_time = #{productiveTime},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="spareField1 != null">spare_field_1 = #{spareField1},</if> |
| | | <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> |
| | | <if test="spareField3 != null">spare_field_3 = #{spareField3},</if> |
| | | <if test="spareField4 != null">spare_field_4 = #{spareField4},</if> |
| | | <if test="createUser != null">create_user = #{createUser},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="remarks != null">remarks = #{remarks},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteBsProcessesInfoById" parameterType="Long"> |
| | | delete from bs_processes_info where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteBsProcessesInfoByIds" parameterType="String"> |
| | | delete from bs_processes_info where id in |
| | | <foreach item="id" collection="array" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢å·¥åºä¿¡æ¯å表 |
| | | export function listProcesses(query) { |
| | | return request({ |
| | | url: '/bs/processes/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢å·¥åºä¿¡æ¯è¯¦ç» |
| | | export function getProcesses(id) { |
| | | return request({ |
| | | url: '/bs/processes/' + id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°å¢å·¥åºä¿¡æ¯ |
| | | export function addProcesses(data) { |
| | | return request({ |
| | | url: '/bs/processes', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¿®æ¹å·¥åºä¿¡æ¯ |
| | | export function updateProcesses(data) { |
| | | return request({ |
| | | url: '/bs/processes', |
| | | method: 'put', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // å é¤å·¥åºä¿¡æ¯ |
| | | export function delProcesses(id) { |
| | | return request({ |
| | | url: '/bs/processes/' + id, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="å·¥åºç¼å·" prop="processesCode"> |
| | | <el-input |
| | | v-model="queryParams.processesCode" |
| | | placeholder="请è¾å
¥å·¥åºç¼å·" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºå称" prop="processesName"> |
| | | <el-input |
| | | v-model="queryParams.processesName" |
| | | placeholder="请è¾å
¥å·¥åºå称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="å·¥åºç±»å" prop="processesType">--> |
| | | <!-- <el-select v-model="queryParams.processesType" placeholder="请éæ©å·¥åºç±»å" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item label="ç¶æ" prop="status">--> |
| | | <!-- <el-select v-model="queryParams.status" placeholder="请éæ©ç¶æ" clearable>--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['bs:processes:add']" |
| | | >æ°å¢</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['bs:processes:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['bs:processes:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['bs:processes:export']" |
| | | >导åº</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="processesList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="主é®id" align="center" prop="id" /> |
| | | <el-table-column label="å·¥åºç¼å·" align="center" prop="processesCode"> |
| | | </el-table-column> |
| | | <el-table-column label="å·¥åºå称" align="center" prop="processesName"> |
| | | </el-table-column> |
| | | <el-table-column label="å·¥åºç±»å" align="center" prop="processesType"> |
| | | </el-table-column> |
| | | <el-table-column label="åå¤æ¶é´" align="center" prop="preparationTime"> |
| | | </el-table-column> |
| | | <el-table-column label="ç产æ¶é´" align="center" prop="productiveTime"> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | </el-table-column> |
| | | <el-table-column label="å建ç¨æ·" align="center" prop="createUser"> |
| | | </el-table-column> |
| | | <el-table-column label="æ´æ¹ç¨æ·" align="center" prop="updateUser"> |
| | | </el-table-column> |
| | | <el-table-column label="å¤æ³¨" align="center" prop="remarks"> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['bs:processes:edit']" |
| | | >ä¿®æ¹</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['bs:processes:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹å·¥åºä¿¡æ¯å¯¹è¯æ¡ --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="å·¥åºç¼å·" prop="processesCode"> |
| | | <el-input v-model="form.processesCode" placeholder="请è¾å
¥å·¥åºç¼å·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºå称" prop="processesName"> |
| | | <el-input v-model="form.processesName" placeholder="请è¾å
¥å·¥åºå称" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="å·¥åºç±»å" prop="processesType">--> |
| | | <!-- <el-select v-model="form.processesType" placeholder="请éæ©å·¥åºç±»å">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.label"--> |
| | | <!-- :value="dict.value"--> |
| | | <!-- ></el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="åå¤æ¶é´" prop="preparationTime"> |
| | | <el-input v-model="form.preparationTime" placeholder="请è¾å
¥åå¤æ¶é´" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç产æ¶é´" prop="productiveTime"> |
| | | <el-input v-model="form.productiveTime" placeholder="请è¾å
¥ç产æ¶é´" /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç¶æ" prop="status">--> |
| | | <!-- <el-radio-group v-model="form.status">--> |
| | | <!-- <el-radio--> |
| | | <!-- v-for="dict in dict.type.${dictType}"--> |
| | | <!-- :key="dict.value"--> |
| | | <!-- :label="dict.value"--> |
| | | <!-- >{{dict.label}}</el-radio>--> |
| | | <!-- </el-radio-group>--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item label="å建ç¨æ·" prop="createUser"> |
| | | <el-input v-model="form.createUser" placeholder="请è¾å
¥å建ç¨æ·" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ´æ¹ç¨æ·" prop="updateUser"> |
| | | <el-input v-model="form.updateUser" placeholder="请è¾å
¥æ´æ¹ç¨æ·" /> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remarks"> |
| | | <el-input v-model="form.remarks" placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listProcesses, getProcesses, delProcesses, addProcesses, updateProcesses } from "@/api/main/bs/processes/processes"; |
| | | |
| | | export default { |
| | | name: "Processes", |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // éä¸æ°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // å·¥åºä¿¡æ¯è¡¨æ ¼æ°æ® |
| | | processesList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | processesCode: null, |
| | | processesName: null, |
| | | processesType: null, |
| | | status: null, |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // 表åæ ¡éª |
| | | rules: { |
| | | id: [ |
| | | { required: true, message: "主é®idä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | processesCode: [ |
| | | { required: true, message: "å·¥åºç¼å·ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ], |
| | | processesType: [ |
| | | { required: true, message: "å·¥åºç±»åä¸è½ä¸ºç©º", trigger: "change" } |
| | | ], |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢å·¥åºä¿¡æ¯å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listProcesses(this.queryParams).then(response => { |
| | | this.processesList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | id: null, |
| | | processesCode: null, |
| | | processesName: null, |
| | | processesType: null, |
| | | preparationTime: null, |
| | | productiveTime: null, |
| | | status: null, |
| | | spareField1: null, |
| | | spareField2: null, |
| | | spareField3: null, |
| | | spareField4: null, |
| | | createUser: null, |
| | | createTime: null, |
| | | updateUser: null, |
| | | updateTime: null, |
| | | remarks: null |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡éä¸æ°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å å·¥åºä¿¡æ¯"; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id || this.ids |
| | | getProcesses(id).then(response => { |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹å·¥åºä¿¡æ¯"; |
| | | }); |
| | | }, |
| | | /** æ交æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.id != null) { |
| | | updateProcesses(this.form).then(response => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addProcesses(this.form).then(response => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ids = row.id || this.ids; |
| | | this.$modal.confirm('æ¯å¦ç¡®è®¤å é¤å·¥åºä¿¡æ¯ç¼å·ä¸º"' + ids + '"çæ°æ®é¡¹ï¼').then(function() { |
| | | return delProcesses(ids); |
| | | }).then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å é¤æå"); |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download('bs/processes/export', { |
| | | ...this.queryParams |
| | | }, `processes_${new Date().getTime()}.xlsx`) |
| | | } |
| | | } |
| | | }; |
| | | </script> |