自动化立体仓库 - WMS系统
#
lsh
2024-06-27 001969849cbc4613cafee4d680f7d4ac19597fce
#
7个文件已修改
74 ■■■■ 已修改文件
src/main/java/com/zy/asrs/entity/WrkMastExecute.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastExecuteLog.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/WrkMastExecuteMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/WrkMastExecuteService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WrkMastExecuteServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/task/handler/WrkMastExecuteHandler.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastExecuteMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/WrkMastExecute.java
@@ -29,13 +29,13 @@
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 工作号
     */
    @ApiModelProperty(value= "工作号")
    @TableId(value = "wrk_no", type = IdType.INPUT)
    @TableField("wrk_no")
    private Long wrkNo;
@@ -143,7 +143,6 @@
     * 任务类型 0: 未知  1: 开门  2: 关门  3: 入硫化罐  4: 入冷却槽  5: 穿梭车进冷却槽  6: 穿梭车离开冷却槽  7: 出冷却槽  
     */
    @ApiModelProperty(value= "任务类型 0: 未知  1: 开门  2: 关门  3: 入硫化罐  4: 入冷却槽  5: 穿梭车进冷却槽  6: 穿梭车离开冷却槽  7: 出冷却槽  ")
    @TableId(value = "io_type", type = IdType.INPUT)
    @TableField("io_type")
    private Integer ioType;
src/main/java/com/zy/asrs/entity/WrkMastExecuteLog.java
@@ -29,13 +29,13 @@
     * ID
     */
    @ApiModelProperty(value= "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 工作号
     */
    @ApiModelProperty(value= "工作号")
    @TableId(value = "wrk_no", type = IdType.INPUT)
    @TableField("wrk_no")
    private Long wrkNo;
@@ -143,7 +143,6 @@
     * 任务类型 0: 未知  1: 开门  2: 关门  3: 入硫化罐  4: 入冷却槽  5: 穿梭车进冷却槽  6: 穿梭车离开冷却槽  7: 出冷却槽  
     */
    @ApiModelProperty(value= "任务类型 0: 未知  1: 开门  2: 关门  3: 入硫化罐  4: 入冷却槽  5: 穿梭车进冷却槽  6: 穿梭车离开冷却槽  7: 出冷却槽  ")
    @TableId(value = "io_type", type = IdType.INPUT)
    @TableField("io_type")
    private Integer ioType;
@@ -183,6 +182,27 @@
        this.rgvEndId = rgvEndId;
    }
    public WrkMastExecuteLog(WrkMastExecute wrkMastExecute) {
        this.wrkNo = wrkMastExecute.getWrkNo();
        this.enterStaNo = wrkMastExecute.getEnterStaNo();
        this.outStaNo = wrkMastExecute.getOutStaNo();
        this.jarEnterStaNo = wrkMastExecute.getJarEnterStaNo();
        this.jarOutStaNo = wrkMastExecute.getJarOutStaNo();
        this.jarId = wrkMastExecute.getJarId();
        this.jarRegin = wrkMastExecute.getJarRegin();
        this.status = wrkMastExecute.getStatus();
        this.steId = wrkMastExecute.getSteId();
        this.rgvId = wrkMastExecute.getRgvId();
        this.ioTime = wrkMastExecute.getIoTime();
        this.modiTime = wrkMastExecute.getModiTime();
        this.appeTime = wrkMastExecute.getAppeTime();
        this.wrkType = wrkMastExecute.getWrkType();
        this.wrkSts = wrkMastExecute.getWrkSts();
        this.ioType = wrkMastExecute.getIoType();
        this.type = wrkMastExecute.getType();
        this.rgvEndId = wrkMastExecute.getRgvEndId();
    }
//    WrkMastExecuteLog wrkMastExecuteLog = new WrkMastExecuteLog(
//            null,    // 工作号[非空]
//            null,    // 入库源站点[非空]
src/main/java/com/zy/asrs/mapper/WrkMastExecuteMapper.java
@@ -2,7 +2,6 @@
import com.zy.asrs.entity.WrkMastExecute;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -11,6 +10,9 @@
@Repository
public interface WrkMastExecuteMapper extends BaseMapper<WrkMastExecute> {
    @Insert("insert into jar_wrk_mast_execute_log select * from jar_wrk_mast_execute where io_type=#{ioType} and wrk_sts=#{wrkSts} and wrk_type=1")
    int save(@Param("ioType") Integer ioType,@Param("wrkSts") Integer wrkSts);
//    @Insert("insert into jar_wrk_mast_execute_log select * from jar_wrk_mast_execute where io_type=#{ioType} and wrk_sts=#{wrkSts} and wrk_type=2")
//    int save(@Param("ioType") Integer ioType,@Param("wrkSts") Integer wrkSts);
    WrkMastExecute selectIoTypeAndWekSts(@Param("ioType") Integer ioType,@Param("wrkSts") Integer wrkSts);
}
src/main/java/com/zy/asrs/service/WrkMastExecuteService.java
@@ -4,5 +4,6 @@
import com.baomidou.mybatisplus.service.IService;
public interface WrkMastExecuteService extends IService<WrkMastExecute> {
    boolean save(int[] excute);
//    boolean save(int[] excute);
    WrkMastExecute selectIoTypeAndWekSts(int[] excute);
}
src/main/java/com/zy/asrs/service/impl/WrkMastExecuteServiceImpl.java
@@ -8,8 +8,13 @@
@Service("wrkMastExecuteService")
public class WrkMastExecuteServiceImpl extends ServiceImpl<WrkMastExecuteMapper, WrkMastExecute> implements WrkMastExecuteService {
//    @Override
//    public boolean save(int[] excute) {
//        return this.baseMapper.save(excute[0],excute[1]) > 0;
//    }
    @Override
    public boolean save(int[] excute) {
        return this.baseMapper.save(excute[0],excute[1]) > 0;
    public WrkMastExecute selectIoTypeAndWekSts(int[] excute) {
        return this.baseMapper.selectIoTypeAndWekSts(excute[0],excute[1]);
    }
}
src/main/java/com/zy/asrs/task/handler/WrkMastExecuteHandler.java
@@ -2,7 +2,10 @@
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.common.Cools;
import com.zy.asrs.entity.WrkMastExecute;
import com.zy.asrs.entity.WrkMastExecuteLog;
import com.zy.asrs.service.WrkMastExecuteLogService;
import com.zy.asrs.service.WrkMastExecuteService;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
@@ -22,16 +25,22 @@
public class WrkMastExecuteHandler extends AbstractHandler<String> {
    @Autowired
    private WrkMastExecuteService wrkMastExecuteService;
    @Autowired
    private WrkMastExecuteLogService wrkMastExecuteLogService;
    public ReturnT<String> start(int[] excute) {
        try {
            //保存历史档案
            if (!wrkMastExecuteService.save(excute)){
                log.error("保存硫化罐区域执行任务历史档[workNo={"+ JSON.toJSONString(excute) +"}]失败");
            }
            //删除工作档案
            if (!wrkMastExecuteService.delete(new EntityWrapper<WrkMastExecute>().eq("io_type",excute[0]).eq("wrk_sts",excute[1]).eq("wrk_type",2))){
                log.error("删除硫化罐区域执行任务[workNo={"+JSON.toJSONString(excute)+"}]失败");
            WrkMastExecute wrkMastExecute = wrkMastExecuteService.selectIoTypeAndWekSts(excute);
            if (!Cools.isEmpty(wrkMastExecute)){
                WrkMastExecuteLog wrkMastExecuteLog = new WrkMastExecuteLog(wrkMastExecute);
                //保存历史档案
                if (!wrkMastExecuteLogService.insert(wrkMastExecuteLog)){
                    log.error("保存硫化罐区域执行任务历史档[workNo={"+ JSON.toJSONString(excute) +"}]失败");
                }
                //删除工作档案
                if (!wrkMastExecuteService.deleteById(wrkMastExecute)){
                    log.error("删除硫化罐区域执行任务[workNo={"+JSON.toJSONString(excute)+"}]失败");
                }
            }
        }catch (Exception e){
            log.error("异常!!!"+e);
src/main/resources/mapper/WrkMastExecuteMapper.xml
@@ -26,4 +26,8 @@
    </resultMap>
    <select id="selectIoTypeAndWekSts" resultMap="BaseResultMap">
        select top 1 * from jar_wrk_mast_execute where io_type=#{ioType} and wrk_sts=#{wrkSts} and wrk_type=2
    </select>
</mapper>