zhanghl
2025-04-23 af2f1450e22d4b65e0013733e08025cdcd075b31
Merge remote-tracking branch 'origin/dev' into dev
已修改8个文件
131 ■■■■ 文件已修改
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsStandardProcessController.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsStandardProcessService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsStandardProcessServiceImpl.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-gen/src/main/resources/vm/java/controller.java.vm 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-gen/src/main/resources/vm/java/domain.java.vm 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
aps-modules/aps-core/src/main/java/com/aps/core/controller/basicData/ApsStandardProcessController.java
@@ -9,9 +9,12 @@
import com.aps.common.security.annotation.RequiresPermissions;
import com.aps.core.domain.ApsStandardProcess;
import com.aps.core.service.IApsStandardProcessService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -22,6 +25,8 @@
 * @date 2025-04-23
 */
@Tag(name = "标准工序", description = "标准工序接口")
@RestController
@RequestMapping("/standardProcess")
public class ApsStandardProcessController extends BaseController
@@ -32,7 +37,9 @@
    /**
     * 查询标准工序列表
     */
    @RequiresPermissions("core:standardProcess:list")
    @Operation(summary = "查询标准工序列表", description = "分页查询")
    @RequiresPermissions("aps:standardProcess:list")
    @GetMapping("/list")
    public TableDataInfo list(ApsStandardProcess apsStandardProcess)
    {
@@ -44,7 +51,8 @@
    /**
     * 导出标准工序列表
     */
    @RequiresPermissions("core:standardProcess:export")
    @Operation(summary = "导出标准工序列表", description = "导出Excel")
    @RequiresPermissions("aps:standardProcess:export")
    @Log(title = "标准工序", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ApsStandardProcess apsStandardProcess)
@@ -57,7 +65,8 @@
    /**
     * 获取标准工序详细信息
     */
    @RequiresPermissions("core:standardProcess:query")
    @Operation(summary = "获取标准工序详细信息", description = "根据id获取")
    @RequiresPermissions("aps:standardProcess:query")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
@@ -67,7 +76,8 @@
    /**
     * 新增标准工序
     */
    @RequiresPermissions("core:standardProcess:add")
    @Operation(summary = "新增标准工序", description = "单个增加")
    @RequiresPermissions("aps:standardProcess:add")
    @Log(title = "标准工序", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ApsStandardProcess apsStandardProcess)
@@ -78,7 +88,8 @@
    /**
     * 修改标准工序
     */
    @RequiresPermissions("core:standardProcess:edit")
    @Operation(summary = "修改标准工序", description = "单个修改")
    @RequiresPermissions("aps:standardProcess:edit")
    @Log(title = "标准工序", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ApsStandardProcess apsStandardProcess)
@@ -89,11 +100,34 @@
    /**
     * 删除标准工序
     */
    @RequiresPermissions("core:standardProcess:remove")
    @Operation(summary = "删除标准工序", description = "批量删除")
    @RequiresPermissions("aps:standardProcess:remove")
    @Log(title = "标准工序", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(apsStandardProcessService.deleteApsStandardProcessByIds(ids));
    }
    /**
     * 导入标准工序数据
     */
    @Operation(summary = "导入标准工序数据", description = "增量导入")
    @RequiresPermissions("aps:standardProcess:importData")
    @PostMapping("/importData")
    public AjaxResult importData(MultipartFile file) throws Exception {
        ExcelUtil<ApsStandardProcess> util = new ExcelUtil<>(ApsStandardProcess.class);
        List<ApsStandardProcess> tempList = util.importExcel(file.getInputStream());
        //判断导入数据是否为空
        if (!tempList.isEmpty()) {
            Boolean res = apsStandardProcessService.importData(tempList);
            if(res){
                return AjaxResult.success("导入成功!");
            }else{
                return AjaxResult.error("导入失败!");
            }
        } else {
            return AjaxResult.error("模板内容为空");
        }
    }
}
aps-modules/aps-core/src/main/java/com/aps/core/domain/ApsStandardProcess.java
@@ -2,8 +2,11 @@
import com.aps.common.core.annotation.Excel;
import com.aps.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
 * 标准工序对象 aps_standard_process
@@ -11,61 +14,77 @@
 * @author hjy
 * @date 2025-04-23
 */
@Schema(description = "标准工序实体")
public class ApsStandardProcess extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** 主键id */
    @Schema(description = "主键id", type = "Long")
    private Long id;
    /** 工序编码 */
    @Schema(description = "工序编码", type = "String")
    @Excel(name = "工序编码")
    private String processNumber;
    /** 工序名称 */
    @Schema(description = "工序名称", type = "String")
    @Excel(name = "工序名称")
    private String processName;
    /** 资源组 */
    @Schema(description = "资源组", type = "String")
    @Excel(name = "资源组")
    private String resourceGroupName;
    /** 产能模型: 独占/合批 */
    @Excel(name = "产能模型: 独占/合批")
    @Schema(description = "产能模型", type = "String")
    @Excel(name = "产能模型")
    private String model;
    /** 设计产能 */
    @Schema(description = "设计产能", type = "String")
    @Excel(name = "设计产能")
    private String designCapacity;
    private BigDecimal designCapacity;
    /** 工厂Id */
    @Excel(name = "工厂Id")
    @Schema(description = "工厂Id", type = "String")
//    @Excel(name = "工厂Id")
    private String plantId;
    /** 工厂 */
    @Schema(description = "工厂", type = "String")
    @Excel(name = "工厂")
    private String plant;
    /** 车间Id */
    @Excel(name = "车间Id")
    @Schema(description = "车间Id", type = "String")
//    @Excel(name = "车间Id")
    private String workShopId;
    /** 车间 */
    @Schema(description = "车间", type = "String")
    @Excel(name = "车间")
    private String workShop;
    /** 日历Id */
    @Excel(name = "日历Id")
    @Schema(description = "日历Id", type = "Long")
//    @Excel(name = "日历Id")
    private Long workCalenderId;
    /** 删除标志(0代表存在 2代表删除) */
    @Schema(description = "删除标志(0代表存在 2代表删除)", type = "String")
    private String delFlag;
    /** 产能模型Id */
    @Excel(name = "产能模型Id")
    @Schema(description = "产能模型Id", type = "Long")
//    @Excel(name = "产能模型Id")
    private Long modelId;
    /** 日历描述 */
    @Schema(description = "日历描述", type = "String")
    @Excel(name = "日历描述")
    private String workCalender;
@@ -119,12 +138,12 @@
        return model;
    }
    public void setDesignCapacity(String designCapacity)
    public void setDesignCapacity(BigDecimal designCapacity)
    {
        this.designCapacity = designCapacity;
    }
    public String getDesignCapacity()
    public BigDecimal getDesignCapacity()
    {
        return designCapacity;
    }
aps-modules/aps-core/src/main/java/com/aps/core/service/IApsStandardProcessService.java
@@ -59,4 +59,11 @@
     * @return 结果
     */
    public int deleteApsStandardProcessById(Long id);
    /**
     * 导入数据
     * @param tempList
     * @return
     */
    public boolean importData(List<ApsStandardProcess> tempList);
}
aps-modules/aps-core/src/main/java/com/aps/core/service/impl/ApsStandardProcessServiceImpl.java
@@ -1,6 +1,7 @@
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.ApsStandardProcess;
import com.aps.core.mapper.ApsStandardProcessMapper;
import com.aps.core.service.IApsStandardProcessService;
@@ -55,6 +56,7 @@
    public int insertApsStandardProcess(ApsStandardProcess apsStandardProcess)
    {
        apsStandardProcess.setCreateTime(DateUtils.getNowDate());
        apsStandardProcess.setCreateBy(SecurityUtils.getUsername());
        return apsStandardProcessMapper.insertApsStandardProcess(apsStandardProcess);
    }
@@ -68,6 +70,7 @@
    public int updateApsStandardProcess(ApsStandardProcess apsStandardProcess)
    {
        apsStandardProcess.setUpdateTime(DateUtils.getNowDate());
        apsStandardProcess.setUpdateBy(SecurityUtils.getUsername());
        return apsStandardProcessMapper.updateApsStandardProcess(apsStandardProcess);
    }
@@ -94,4 +97,26 @@
    {
        return apsStandardProcessMapper.deleteApsStandardProcessById(id);
    }
    /**
     * 导入数据
     * @param tempList
     * @return true/false
     */
    @Override
    public boolean importData(List<ApsStandardProcess> tempList) {
        try {
            if (!tempList.isEmpty()) {
                tempList.forEach(temp->{
                    temp.setCreateBy(SecurityUtils.getUsername());
                    temp.setCreateTime(DateUtils.getNowDate());
                    apsStandardProcessMapper.insertApsStandardProcess(temp);
                });
            }
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
        return true;
    }
}
aps-modules/aps-core/src/main/resources/mapper/core/ApsStandardProcessMapper.xml
@@ -55,7 +55,6 @@
    <insert id="insertApsStandardProcess" parameterType="ApsStandardProcess">
        insert into aps_standard_process
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="processNumber != null">process_number,</if>
            <if test="processName != null">process_name,</if>
            <if test="resourceGroupName != null">resource_group_name,</if>
@@ -75,7 +74,6 @@
            <if test="workCalender != null">work_calender,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="processNumber != null">#{processNumber},</if>
            <if test="processName != null">#{processName},</if>
            <if test="resourceGroupName != null">#{resourceGroupName},</if>
aps-modules/aps-core/src/main/resources/mapper/core/ApsWorkCalendarMapper.xml
@@ -84,7 +84,7 @@
            <if test="type != null">type = #{type},</if>
            <if test="effectiveDate != null">effective_date = #{effectiveDate},</if>
            <if test="expiringDate != null">expiring_date = #{expiringDate},</if>
            <if test="content != null">content = #{content},</if>
            <if test="content != null">content = #{content , typeHandler=com.aps.core.typeHandler.JsonTypeHandler, jdbcType=OTHER},</if>
            <if test="applicableFactory != null">applicable_factory = #{applicableFactory},</if>
            <if test="applicableWorkshop != null">applicable_workshop = #{applicableWorkshop},</if>
            <if test="applicableProcess != null">applicable_process = #{applicableProcess},</if>
aps-modules/aps-gen/src/main/resources/vm/java/controller.java.vm
@@ -3,6 +3,8 @@
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -31,6 +33,8 @@
 * @author ${author}
 * @date ${datetime}
 */
@Tag(name = "${functionName}", description = "${functionName}接口")
@RestController
@RequestMapping("/${businessName}")
public class ${ClassName}Controller extends BaseController
@@ -41,6 +45,7 @@
    /**
     * 查询${functionName}列表
     */
    @Operation(summary = "查询${functionName}列表", description = "分页查询")
    @RequiresPermissions("${permissionPrefix}:list")
    @GetMapping("/list")
#if($table.crud || $table.sub)
@@ -61,6 +66,7 @@
    /**
     * 导出${functionName}列表
     */
    @Operation(summary = "导出${functionName}列表", description = "导出")
    @RequiresPermissions("${permissionPrefix}:export")
    @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
@@ -74,6 +80,7 @@
    /**
     * 获取${functionName}详细信息
     */
    @Operation(summary = "获取${functionName}详细信息", description = "根据id获取")
    @RequiresPermissions("${permissionPrefix}:query")
    @GetMapping(value = "/{${pkColumn.javaField}}")
    public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField})
@@ -84,6 +91,7 @@
    /**
     * 新增${functionName}
     */
    @Operation(summary = "新增${functionName}", description = "单个新增")
    @RequiresPermissions("${permissionPrefix}:add")
    @Log(title = "${functionName}", businessType = BusinessType.INSERT)
    @PostMapping
@@ -95,6 +103,7 @@
    /**
     * 修改${functionName}
     */
    @Operation(summary = "修改${functionName}", description = "单个修改")
    @RequiresPermissions("${permissionPrefix}:edit")
    @Log(title = "${functionName}", businessType = BusinessType.UPDATE)
    @PutMapping
@@ -106,6 +115,7 @@
    /**
     * 删除${functionName}
     */
    @Operation(summary = "删除${functionName}", description = "批量删除")
    @RequiresPermissions("${permissionPrefix}:remove")
    @Log(title = "${functionName}", businessType = BusinessType.DELETE)
    @DeleteMapping("/{${pkColumn.javaField}s}")
aps-modules/aps-gen/src/main/resources/vm/java/domain.java.vm
@@ -6,6 +6,8 @@
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.aps.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
#if($table.crud || $table.sub)
import com.aps.common.core.web.domain.BaseEntity;
#elseif($table.tree)
@@ -23,6 +25,7 @@
#elseif($table.tree)
#set($Entity="TreeEntity")
#end
@ApiModel("${functionName}实体类")
public class ${ClassName} extends ${Entity}
{
    private static final long serialVersionUID = 1L;
@@ -46,6 +49,7 @@
    @Excel(name = "${comment}")
#end
#end
    @ApiModelProperty("$column.columnComment")
    private $column.javaType $column.javaField;
#end