aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWorkEventController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsWorkEvent.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsWorkEventMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsWorkEventService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsWorkEventServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkEventMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsWorkEventController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,98 @@ package com.aps.core.controller.basicData; import com.aps.common.core.utils.poi.ExcelUtil; import com.aps.common.core.web.controller.BaseController; import com.aps.common.core.web.domain.AjaxResult; import com.aps.common.core.web.page.TableDataInfo; import com.aps.common.log.annotation.Log; import com.aps.common.log.enums.BusinessType; import com.aps.common.security.annotation.RequiresPermissions; import com.aps.core.domain.ApsWorkEvent; import com.aps.core.service.IApsWorkEventService; import jakarta.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; /** * äºä»¶ç®¡çController * * @author hjy * @date 2025-04-21 */ @RestController @RequestMapping("/event") public class ApsWorkEventController extends BaseController { @Autowired private IApsWorkEventService apsWorkEventService; /** * æ¥è¯¢äºä»¶ç®¡çå表 */ @RequiresPermissions("basicData:event:list") @GetMapping("/list") public TableDataInfo list(ApsWorkEvent apsWorkEvent) { startPage(); List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent); return getDataTable(list); } /** * 导åºäºä»¶ç®¡çå表 */ @RequiresPermissions("basicData:event:export") @Log(title = "äºä»¶ç®¡ç", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ApsWorkEvent apsWorkEvent) { List<ApsWorkEvent> list = apsWorkEventService.selectApsWorkEventList(apsWorkEvent); ExcelUtil<ApsWorkEvent> util = new ExcelUtil<ApsWorkEvent>(ApsWorkEvent.class); util.exportExcel(response, list, "äºä»¶ç®¡çæ°æ®"); } /** * è·åäºä»¶ç®¡ç详ç»ä¿¡æ¯ */ @RequiresPermissions("basicData:event:query") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(apsWorkEventService.selectApsWorkEventById(id)); } /** * æ°å¢äºä»¶ç®¡ç */ @RequiresPermissions("basicData:event:add") @Log(title = "äºä»¶ç®¡ç", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ApsWorkEvent apsWorkEvent) { return toAjax(apsWorkEventService.insertApsWorkEvent(apsWorkEvent)); } /** * ä¿®æ¹äºä»¶ç®¡ç */ @RequiresPermissions("basicData:event:edit") @Log(title = "äºä»¶ç®¡ç", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ApsWorkEvent apsWorkEvent) { return toAjax(apsWorkEventService.updateApsWorkEvent(apsWorkEvent)); } /** * å é¤äºä»¶ç®¡ç */ @RequiresPermissions("basicData:event:remove") @Log(title = "äºä»¶ç®¡ç", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(apsWorkEventService.deleteApsWorkEventByIds(ids)); } } aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsWorkEvent.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,196 @@ package com.aps.core.domain; import com.aps.common.core.annotation.Excel; import com.aps.common.core.web.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.util.Date; /** * äºä»¶ç®¡ç对象 aps_work_event * * @author hjy * @date 2025-04-21 */ public class ApsWorkEvent extends BaseEntity { private static final long serialVersionUID = 1L; /** $column.columnComment */ private Long id; /** äºä»¶æè¿° */ @Excel(name = "äºä»¶æè¿°") private String description; /** æç»æ¶é¿ */ @Excel(name = "æç»æ¶é¿") private String duration; /** äºä»¶å¼å§æ¥æ */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "äºä»¶å¼å§æ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private Date startDate; /** äºä»¶ç»ææ¥æ */ @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "äºä»¶ç»ææ¥æ", width = 30, dateFormat = "yyyy-MM-dd") private Date endDate; /** äºä»¶å¼å§æ¶é´ */ @Excel(name = "äºä»¶å¼å§æ¶é´") private String startTime; /** äºä»¶ç»æäºä»¶ */ @Excel(name = "äºä»¶ç»æäºä»¶") private String endTime; /** éç¨å·¥å */ @Excel(name = "éç¨å·¥å") private String applicableFactory; /** éç¨è½¦é´ */ @Excel(name = "éç¨è½¦é´") private String applicableWorkshop; /** éç¨å·¥åº */ @Excel(name = "éç¨å·¥åº") private String applicableProcess; /** éç¨æ¥å */ @Excel(name = "éç¨æ¥å") private String applicableCalendar; public void setId(Long id) { this.id = id; } public Long getId() { return id; } public void setDescription(String description) { this.description = description; } public String getDescription() { return description; } public void setDuration(String duration) { this.duration = duration; } public String getDuration() { return duration; } public void setStartDate(Date startDate) { this.startDate = startDate; } public Date getStartDate() { return startDate; } public void setEndDate(Date endDate) { this.endDate = endDate; } public Date getEndDate() { return endDate; } public void setStartTime(String startTime) { this.startTime = startTime; } public String getStartTime() { return startTime; } public void setEndTime(String endTime) { this.endTime = endTime; } public String getEndTime() { return endTime; } public void setApplicableFactory(String applicableFactory) { this.applicableFactory = applicableFactory; } public String getApplicableFactory() { return applicableFactory; } public void setApplicableWorkshop(String applicableWorkshop) { this.applicableWorkshop = applicableWorkshop; } public String getApplicableWorkshop() { return applicableWorkshop; } public void setApplicableProcess(String applicableProcess) { this.applicableProcess = applicableProcess; } public String getApplicableProcess() { return applicableProcess; } public void setApplicableCalendar(String applicableCalendar) { this.applicableCalendar = applicableCalendar; } public String getApplicableCalendar() { return applicableCalendar; } @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) .append("description", getDescription()) .append("duration", getDuration()) .append("startDate", getStartDate()) .append("endDate", getEndDate()) .append("startTime", getStartTime()) .append("endTime", getEndTime()) .append("applicableFactory", getApplicableFactory()) .append("applicableWorkshop", getApplicableWorkshop()) .append("applicableProcess", getApplicableProcess()) .append("applicableCalendar", getApplicableCalendar()) .append("createBy", getCreateBy()) .append("createTime", getCreateTime()) .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .toString(); } } aps-modules/aps-core/src/main/java/com/aps/core/mapper/ApsWorkEventMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,62 @@ package com.aps.core.mapper; import com.aps.core.domain.ApsWorkEvent; import java.util.List; /** * äºä»¶ç®¡çMapperæ¥å£ * * @author hjy * @date 2025-04-21 */ public interface ApsWorkEventMapper { /** * æ¥è¯¢äºä»¶ç®¡ç * * @param id äºä»¶ç®¡çä¸»é® * @return äºä»¶ç®¡ç */ public ApsWorkEvent selectApsWorkEventById(Long id); /** * æ¥è¯¢äºä»¶ç®¡çå表 * * @param apsWorkEvent äºä»¶ç®¡ç * @return äºä»¶ç®¡çéå */ public List<ApsWorkEvent> selectApsWorkEventList(ApsWorkEvent apsWorkEvent); /** * æ°å¢äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ public int insertApsWorkEvent(ApsWorkEvent apsWorkEvent); /** * ä¿®æ¹äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ public int updateApsWorkEvent(ApsWorkEvent apsWorkEvent); /** * å é¤äºä»¶ç®¡ç * * @param id äºä»¶ç®¡çä¸»é® * @return ç»æ */ public int deleteApsWorkEventById(Long id); /** * æ¹éå é¤äºä»¶ç®¡ç * * @param ids éè¦å é¤çæ°æ®ä¸»é®éå * @return ç»æ */ public int deleteApsWorkEventByIds(Long[] ids); } aps-modules/aps-core/src/main/java/com/aps/core/service/IApsWorkEventService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,62 @@ package com.aps.core.service; import com.aps.core.domain.ApsWorkEvent; import java.util.List; /** * äºä»¶ç®¡çServiceæ¥å£ * * @author hjy * @date 2025-04-21 */ public interface IApsWorkEventService { /** * æ¥è¯¢äºä»¶ç®¡ç * * @param id äºä»¶ç®¡çä¸»é® * @return äºä»¶ç®¡ç */ public ApsWorkEvent selectApsWorkEventById(Long id); /** * æ¥è¯¢äºä»¶ç®¡çå表 * * @param apsWorkEvent äºä»¶ç®¡ç * @return äºä»¶ç®¡çéå */ public List<ApsWorkEvent> selectApsWorkEventList(ApsWorkEvent apsWorkEvent); /** * æ°å¢äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ public int insertApsWorkEvent(ApsWorkEvent apsWorkEvent); /** * ä¿®æ¹äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ public int updateApsWorkEvent(ApsWorkEvent apsWorkEvent); /** * æ¹éå é¤äºä»¶ç®¡ç * * @param ids éè¦å é¤çäºä»¶ç®¡ç主é®éå * @return ç»æ */ public int deleteApsWorkEventByIds(Long[] ids); /** * å é¤äºä»¶ç®¡çä¿¡æ¯ * * @param id äºä»¶ç®¡çä¸»é® * @return ç»æ */ public int deleteApsWorkEventById(Long id); } aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsWorkEventServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,100 @@ package com.aps.core.service.impl; import com.aps.common.core.utils.DateUtils; import com.aps.common.security.utils.SecurityUtils; import com.aps.core.domain.ApsWorkEvent; import com.aps.core.mapper.ApsWorkEventMapper; import com.aps.core.service.IApsWorkEventService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * äºä»¶ç®¡çServiceä¸å¡å±å¤ç * * @author hjy * @date 2025-04-21 */ @Service public class ApsWorkEventServiceImpl implements IApsWorkEventService { @Autowired private ApsWorkEventMapper apsWorkEventMapper; /** * æ¥è¯¢äºä»¶ç®¡ç * * @param id äºä»¶ç®¡çä¸»é® * @return äºä»¶ç®¡ç */ @Override public ApsWorkEvent selectApsWorkEventById(Long id) { return apsWorkEventMapper.selectApsWorkEventById(id); } /** * æ¥è¯¢äºä»¶ç®¡çå表 * * @param apsWorkEvent äºä»¶ç®¡ç * @return äºä»¶ç®¡ç */ @Override public List<ApsWorkEvent> selectApsWorkEventList(ApsWorkEvent apsWorkEvent) { return apsWorkEventMapper.selectApsWorkEventList(apsWorkEvent); } /** * æ°å¢äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ @Override public int insertApsWorkEvent(ApsWorkEvent apsWorkEvent) { apsWorkEvent.setCreateTime(DateUtils.getNowDate()); apsWorkEvent.setCreateBy(SecurityUtils.getUsername()); return apsWorkEventMapper.insertApsWorkEvent(apsWorkEvent); } /** * ä¿®æ¹äºä»¶ç®¡ç * * @param apsWorkEvent äºä»¶ç®¡ç * @return ç»æ */ @Override public int updateApsWorkEvent(ApsWorkEvent apsWorkEvent) { apsWorkEvent.setUpdateTime(DateUtils.getNowDate()); apsWorkEvent.setUpdateBy(SecurityUtils.getUsername()); return apsWorkEventMapper.updateApsWorkEvent(apsWorkEvent); } /** * æ¹éå é¤äºä»¶ç®¡ç * * @param ids éè¦å é¤çäºä»¶ç®¡çä¸»é® * @return ç»æ */ @Override public int deleteApsWorkEventByIds(Long[] ids) { return apsWorkEventMapper.deleteApsWorkEventByIds(ids); } /** * å é¤äºä»¶ç®¡çä¿¡æ¯ * * @param id äºä»¶ç®¡çä¸»é® * @return ç»æ */ @Override public int deleteApsWorkEventById(Long id) { return apsWorkEventMapper.deleteApsWorkEventById(id); } } aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkEventMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,119 @@ <?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.aps.core.mapper.ApsWorkEventMapper"> <resultMap type="ApsWorkEvent" id="ApsWorkEventResult"> <result property="id" column="id" /> <result property="description" column="description" /> <result property="duration" column="duration" /> <result property="startDate" column="start_date" /> <result property="endDate" column="end_date" /> <result property="startTime" column="start_time" /> <result property="endTime" column="end_time" /> <result property="applicableFactory" column="applicable_factory" /> <result property="applicableWorkshop" column="applicable_workshop" /> <result property="applicableProcess" column="applicable_process" /> <result property="applicableCalendar" column="applicable_calendar" /> <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="selectApsWorkEventVo"> select id, description, duration, start_date, end_date, start_time, end_time, applicable_factory, applicable_workshop, applicable_process, applicable_calendar, create_by, create_time, update_by, update_time from aps_work_event </sql> <select id="selectApsWorkEventList" parameterType="ApsWorkEvent" resultMap="ApsWorkEventResult"> <include refid="selectApsWorkEventVo"/> <where> <if test="description != null and description != ''"> and description like concat('%', #{description}, '%')</if> <if test="duration != null and duration != ''"> and duration = #{duration}</if> <if test="startDate != null "> and start_date = #{startDate}</if> <if test="endDate != null "> and end_date = #{endDate}</if> <if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if> <if test="endTime != null and endTime != ''"> and end_time = #{endTime}</if> <if test="applicableFactory != null and applicableFactory != ''"> and applicable_factory = #{applicableFactory}</if> <if test="applicableWorkshop != null and applicableWorkshop != ''"> and applicable_workshop = #{applicableWorkshop}</if> <if test="applicableProcess != null and applicableProcess != ''"> and applicable_process = #{applicableProcess}</if> <if test="applicableCalendar != null and applicableCalendar != ''"> and applicable_calendar = #{applicableCalendar}</if> </where> </select> <select id="selectApsWorkEventById" parameterType="Long" resultMap="ApsWorkEventResult"> <include refid="selectApsWorkEventVo"/> where id = #{id} </select> <insert id="insertApsWorkEvent" parameterType="ApsWorkEvent"> insert into aps_work_event <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> <if test="description != null and description != ''">description,</if> <if test="duration != null and duration != ''">duration,</if> <if test="startDate != null">start_date,</if> <if test="endDate != null">end_date,</if> <if test="startTime != null and startTime != ''">start_time,</if> <if test="endTime != null and endTime != ''">end_time,</if> <if test="applicableFactory != null and applicableFactory != ''">applicable_factory,</if> <if test="applicableWorkshop != null and applicableWorkshop != ''">applicable_workshop,</if> <if test="applicableProcess != null and applicableProcess != ''">applicable_process,</if> <if test="applicableCalendar != null and applicableCalendar != ''">applicable_calendar,</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="id != null">#{id},</if> <if test="description != null and description != ''">#{description},</if> <if test="duration != null and duration != ''">#{duration},</if> <if test="startDate != null">#{startDate},</if> <if test="endDate != null">#{endDate},</if> <if test="startTime != null and startTime != ''">#{startTime},</if> <if test="endTime != null and endTime != ''">#{endTime},</if> <if test="applicableFactory != null and applicableFactory != ''">#{applicableFactory},</if> <if test="applicableWorkshop != null and applicableWorkshop != ''">#{applicableWorkshop},</if> <if test="applicableProcess != null and applicableProcess != ''">#{applicableProcess},</if> <if test="applicableCalendar != null and applicableCalendar != ''">#{applicableCalendar},</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="updateApsWorkEvent" parameterType="ApsWorkEvent"> update aps_work_event <trim prefix="SET" suffixOverrides=","> <if test="description != null and description != ''">description = #{description},</if> <if test="duration != null and duration != ''">duration = #{duration},</if> <if test="startDate != null">start_date = #{startDate},</if> <if test="endDate != null">end_date = #{endDate},</if> <if test="startTime != null and startTime != ''">start_time = #{startTime},</if> <if test="endTime != null and endTime != ''">end_time = #{endTime},</if> <if test="applicableFactory != null and applicableFactory != ''">applicable_factory = #{applicableFactory},</if> <if test="applicableWorkshop != null and applicableWorkshop != ''">applicable_workshop = #{applicableWorkshop},</if> <if test="applicableProcess != null and applicableProcess != ''">applicable_process = #{applicableProcess},</if> <if test="applicableCalendar != null and applicableCalendar != ''">applicable_calendar = #{applicableCalendar},</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 id = #{id} </update> <delete id="deleteApsWorkEventById" parameterType="Long"> delete from aps_work_event where id = #{id} </delete> <delete id="deleteApsWorkEventByIds" parameterType="String"> delete from aps_work_event where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </delete> </mapper>