| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/task/control") |
| | | @ManagerAuth(memo = "手动处理工作档") |
| | | public R handControlWrkMast(@RequestParam String workNo, |
| | | @RequestParam Integer type){ |
| | | if (type == 1) { |
| | | taskService.completeWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已完成"); |
| | | } else if (type == 2) { |
| | | taskService.cancelWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已取消"); |
| | | } else if (type == 3) { |
| | | taskService.pickWrkMast(workNo, getUserId()); |
| | | return R.ok("工作档已拣料"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/task/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.system.entity.User; |
| | | import com.zy.system.service.UserService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("agv_task") |
| | | @Accessors(chain = true) |
| | | public class Task implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | @TableField("task_type") |
| | | private String taskType; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableField("wrk_no") |
| | | private Integer wrkNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("inv_wh") |
| | | private String invWh; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private Date ymd; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String mk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("whs_type") |
| | | private Integer whsType; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @ApiModelProperty(value= "工作状态") |
| | | @TableField("wrk_sts") |
| | | private Long wrkSts; |
| | | |
| | | /** |
| | | * 入出库类型 |
| | | */ |
| | | @ApiModelProperty(value= "入出库类型") |
| | | @TableField("io_type") |
| | | private Integer ioType; |
| | | |
| | | /** |
| | | * 堆垛机 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机") |
| | | @TableField("crn_no") |
| | | private Integer crnNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sheet_no") |
| | | private String sheetNo; |
| | | |
| | | /** |
| | | * 优先级 |
| | | */ |
| | | @ApiModelProperty(value= "优先级") |
| | | @TableField("io_pri") |
| | | private Double ioPri; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("wrk_date") |
| | | private Date wrkDate; |
| | | |
| | | /** |
| | | * 目标库位 |
| | | */ |
| | | @ApiModelProperty(value= "目标库位") |
| | | @TableField("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 目标站 |
| | | */ |
| | | @ApiModelProperty(value= "目标站") |
| | | @TableField("sta_no") |
| | | private String staNo; |
| | | |
| | | /** |
| | | * 源站 |
| | | */ |
| | | @ApiModelProperty(value= "源站") |
| | | @TableField("source_sta_no") |
| | | private String sourceStaNo; |
| | | |
| | | /** |
| | | * 源库位 |
| | | */ |
| | | @ApiModelProperty(value= "源库位") |
| | | @TableField("source_loc_no") |
| | | private String sourceLocNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("loc_sts") |
| | | private String locSts; |
| | | |
| | | /** |
| | | * 拣料 |
| | | */ |
| | | @ApiModelProperty(value= "拣料") |
| | | private String picking; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("link_mis") |
| | | private String linkMis; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("online_yn") |
| | | private String onlineYn; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("upd_mk") |
| | | private String updMk; |
| | | |
| | | /** |
| | | * 退出 |
| | | */ |
| | | @ApiModelProperty(value= "退出") |
| | | @TableField("exit_mk") |
| | | private String exitMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("plt_type") |
| | | private Integer pltType; |
| | | |
| | | /** |
| | | * 空板 |
| | | */ |
| | | @ApiModelProperty(value= "空板") |
| | | @TableField("empty_mk") |
| | | private String emptyMk; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value= "工作时间") |
| | | @TableField("io_time") |
| | | private Date ioTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ctn_type") |
| | | private Integer ctnType; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | private String packed; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ove_mk") |
| | | private String oveMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("mtn_type") |
| | | private Double mtnType; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("user_no") |
| | | private String userNo; |
| | | |
| | | /** |
| | | * 堆垛机启动时间 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机启动时间") |
| | | @TableField("crn_str_time") |
| | | private Date crnStrTime; |
| | | |
| | | /** |
| | | * 堆垛机停止时间 |
| | | */ |
| | | @ApiModelProperty(value= "堆垛机停止时间") |
| | | @TableField("crn_end_time") |
| | | private Date crnEndTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("plc_str_time") |
| | | private Date plcStrTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("crn_pos_time") |
| | | private Date crnPosTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("load_time") |
| | | private Double loadTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("exp_time") |
| | | private Double expTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ref_wrkno") |
| | | private Double refWrkno; |
| | | |
| | | /** |
| | | * 拣料时间 |
| | | */ |
| | | @ApiModelProperty(value= "拣料时间") |
| | | @TableField("ref_iotime") |
| | | private Date refIotime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private Long modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 创建者 |
| | | */ |
| | | @ApiModelProperty(value= "创建者") |
| | | @TableField("appe_user") |
| | | private Long appeUser; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @TableField("appe_time") |
| | | private Date appeTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("pause_mk") |
| | | private String pauseMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("error_time") |
| | | private Date errorTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("error_memo") |
| | | private String errorMemo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ctn_kind") |
| | | private Integer ctnKind; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("manu_type") |
| | | private String manuType; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("sc_weight") |
| | | private Double scWeight; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("log_mk") |
| | | private String logMk; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("log_err_time") |
| | | private Date logErrTime; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("log_err_memo") |
| | | private String logErrMemo; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | private String barcode; |
| | | |
| | | // Y:销售订单出库任务 |
| | | @ApiModelProperty(value= "") |
| | | @TableField("Pdc_type") |
| | | private String PdcType; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("ctn_no") |
| | | private String ctnNo; |
| | | |
| | | /** |
| | | * 满板 |
| | | */ |
| | | @ApiModelProperty(value= "满板") |
| | | @TableField("full_plt") |
| | | private String fullPlt; |
| | | |
| | | /** |
| | | * 先入品 / 双重入库 |
| | | */ |
| | | @ApiModelProperty(value= "先入品") |
| | | @TableField("pre_have") |
| | | private String preHave; |
| | | |
| | | /** |
| | | * 空操作 / 取货无箱 |
| | | */ |
| | | @ApiModelProperty(value= "空操作") |
| | | @TableField("take_none") |
| | | private String takeNone; |
| | | |
| | | public Task() {} |
| | | |
| | | public Task(String taskType) { |
| | | this.taskType = taskType; |
| | | public String getYmd$(){ |
| | | if (Cools.isEmpty(this.ymd)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ymd); |
| | | } |
| | | |
| | | // Task task = new Task( |
| | | // null // 任务类型: agv , crn |
| | | // ); |
| | | public String getWrkSts$(){ |
| | | BasWrkStatusService service = SpringUtils.getBean(BasWrkStatusService.class); |
| | | BasWrkStatus basWrkStatus = service.selectById(this.wrkSts); |
| | | if (!Cools.isEmpty(basWrkStatus)){ |
| | | return String.valueOf(basWrkStatus.getWrkDesc()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getIoType$(){ |
| | | BasWrkIotypeService service = SpringUtils.getBean(BasWrkIotypeService.class); |
| | | BasWrkIotype basWrkIotype = service.selectById(this.ioType); |
| | | if (!Cools.isEmpty(basWrkIotype)){ |
| | | return String.valueOf(basWrkIotype.getIoDesc()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getCrnNo$(){ |
| | | BasCrnpService service = SpringUtils.getBean(BasCrnpService.class); |
| | | BasCrnp basCrnp = service.selectById(this.crnNo); |
| | | if (!Cools.isEmpty(basCrnp)){ |
| | | return String.valueOf(basCrnp.getCrnNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getWrkDate$(){ |
| | | if (Cools.isEmpty(this.wrkDate)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.wrkDate); |
| | | } |
| | | |
| | | public String getLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.locNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getTaskType$(){ |
| | | if (Cools.isEmpty(this.taskType)){return null;} |
| | | if (taskType.equals("agv")) { |
| | | return "AGV任务"; |
| | | } else { |
| | | return "堆垛机任务"; |
| | | } |
| | | } |
| | | |
| | | |
| | | public String getStaNo$(){ |
| | | BasDevpService service = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevp basDevp = service.selectById(this.staNo); |
| | | if (!Cools.isEmpty(basDevp)){ |
| | | return String.valueOf(basDevp.getDevNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSourceStaNo$(){ |
| | | BasDevpService service = SpringUtils.getBean(BasDevpService.class); |
| | | BasDevp basDevp = service.selectById(this.sourceStaNo); |
| | | if (!Cools.isEmpty(basDevp)){ |
| | | return String.valueOf(basDevp.getDevNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getSourceLocNo$(){ |
| | | LocMastService service = SpringUtils.getBean(LocMastService.class); |
| | | LocMast locMast = service.selectById(this.sourceLocNo); |
| | | if (!Cools.isEmpty(locMast)){ |
| | | return String.valueOf(locMast.getLocNo()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getIoTime$(){ |
| | | if (Cools.isEmpty(this.ioTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime); |
| | | } |
| | | |
| | | public String getCrnStrTime$(){ |
| | | if (Cools.isEmpty(this.crnStrTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnStrTime); |
| | | } |
| | | |
| | | public String getCrnEndTime$(){ |
| | | if (Cools.isEmpty(this.crnEndTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnEndTime); |
| | | } |
| | | |
| | | public String getPlcStrTime$(){ |
| | | if (Cools.isEmpty(this.plcStrTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.plcStrTime); |
| | | } |
| | | |
| | | public String getCrnPosTime$(){ |
| | | if (Cools.isEmpty(this.crnPosTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.crnPosTime); |
| | | } |
| | | |
| | | public String getRefIotime$(){ |
| | | if (Cools.isEmpty(this.refIotime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.refIotime); |
| | | } |
| | | |
| | | public String getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public String getAppeUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.appeUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getUsername()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getAppeTime$(){ |
| | | if (Cools.isEmpty(this.appeTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.appeTime); |
| | | } |
| | | |
| | | public String getErrorTime$(){ |
| | | if (Cools.isEmpty(this.errorTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.errorTime); |
| | | } |
| | | |
| | | |
| | | public String getLogErrTime$(){ |
| | | if (Cools.isEmpty(this.logErrTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.logErrTime); |
| | | } |
| | | } |
| | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @TableName("agv_task_detl") |
| | | public class TaskDetl implements Serializable { |
| | | |
| | |
| | | |
| | | public interface TaskLogService extends IService<TaskLog> { |
| | | |
| | | boolean save(Integer wrkNo); |
| | | } |
| | |
| | | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | void completeWrkMast(String workNo, Long userId); |
| | | |
| | | void cancelWrkMast(String workNo, Long userId); |
| | | |
| | | void pickWrkMast(String workNo, Long userId); |
| | | } |
| | |
| | | |
| | | @Resource |
| | | private OrderDetlPakoutService orderDetlPakoutService; |
| | | |
| | | @Autowired |
| | | private LocCacheService locCacheService; |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | |
| | | @Override |
| | | @Transactional |
| | |
| | | // 获取工作号 |
| | | int workNo = commonService.getWorkNo(WorkNoType.PICK.type); |
| | | // 保存工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(11L); // 工作状态:11.生成出库ID |
| | | wrkMast.setIoType(11); // 入出库状态: 11.库格移载 |
| | | wrkMast.setTaskType("agv"); |
| | | wrkMast.setIoPri(10D); |
| | | wrkMast.setLocNo(loc.getLocNo()); // 目标库位 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setSourceLocNo(orgSite); |
| | | wrkMast.setEmptyMk(loc.getLocSts().equals("D") ? "Y" : "N"); // 空板 |
| | | wrkMast.setBarcode(barcode); // 托盘码 |
| | | wrkMast.setLinkMis("N"); |
| | | wrkMast.setAppeUser(userId); |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.insert(wrkMast)) { |
| | | Task task = new Task(); |
| | | task.setWrkNo(workNo) |
| | | .setIoTime(now) |
| | | .setWrkSts(11L) // 工作状态:11.生成出库ID |
| | | .setIoType(11) // 入出库状态: 11.库格移载 |
| | | .setTaskType("agv") |
| | | .setIoPri(10D) |
| | | .setLocNo(loc.getLocNo()) // 目标库位 |
| | | .setFullPlt("Y") // 满板:Y |
| | | .setPicking("N") // 拣料 |
| | | .setExitMk("N")// 退出 |
| | | .setSourceLocNo(orgSite) |
| | | .setEmptyMk(loc.getLocSts().equals("D") ? "Y" : "N")// 空板 |
| | | .setBarcode(barcode)// 托盘码 |
| | | .setLinkMis("N") |
| | | .setAppeUser(userId) |
| | | .setAppeTime(now) |
| | | .setModiUser(userId) |
| | | .setModiTime(now); |
| | | if (!taskService.insert(task)) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | |
| | | List<WrkDetl> taskDetls = new ArrayList<>(); |
| | | List<TaskDetl> taskDetls = new ArrayList<>(); |
| | | detls.forEach(detl -> { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | TaskDetl wrkDetl = new TaskDetl(); |
| | | BeanUtils.copyProperties(detl, wrkDetl); |
| | | wrkDetl.setWrkNo(workNo) |
| | | .setIoTime(new Date()) |
| | |
| | | taskDetls.add(wrkDetl); |
| | | }); |
| | | //保存工作档明细 |
| | | if (!wrkDetlService.insertBatch(taskDetls)) { |
| | | if (!taskDetlService.insertBatch(taskDetls)) { |
| | | throw new CoolException("保存工作档明细失败"); |
| | | } |
| | | // 修改目标库位状态 |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.WrkMastLog; |
| | | import com.zy.asrs.mapper.TaskLogMapper; |
| | | import com.zy.asrs.entity.TaskLog; |
| | | import com.zy.asrs.service.TaskLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.service.TaskService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | @Service("taskLogService") |
| | | public class TaskLogServiceImpl extends ServiceImpl<TaskLogMapper, TaskLog> implements TaskLogService { |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/9/23 |
| | | * @description: 保存任务日志 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean save(Integer wrkNo) { |
| | | Task task = taskService.selectOne(new EntityWrapper<Task>().eq("wrk_no", wrkNo)); |
| | | if (Objects.isNull(task)) { |
| | | throw new CoolException("数据错误:任务不存在!!"); |
| | | } |
| | | TaskLog taskLog = new TaskLog(); |
| | | BeanUtils.copyProperties(task, taskLog); |
| | | taskLog.setLogId(task.getId()); |
| | | |
| | | if (!this.insert(taskLog)) { |
| | | throw new CoolException("任务日志保存失败!!"); |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.TaskMapper; |
| | | import com.zy.asrs.entity.Task; |
| | | import com.zy.asrs.service.TaskLogService; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.zy.asrs.utils.OrderInAndOutUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | | @Autowired |
| | | private TaskLogService taskLogService; |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | | Task wrkMast = this.selectOne(new EntityWrapper<Task>().eq("wrk_no", workNo)); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 14) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | | wrkMast.setCrnStrTime(DateUtils.calculate(now, 1L, TimeUnit.SECONDS, true)); |
| | | wrkMast.setCrnEndTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | // 完成操作人员记录 |
| | | wrkMast.setManuType("手动完成"); |
| | | if (!this.updateById(wrkMast)) { |
| | | throw new CoolException("修改工作档失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void pickWrkMast(String workNo, Long userId) { |
| | | Task wrkMast = this.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | // 入出库类型判断 |
| | | if (wrkMast.getIoType() != 103 && wrkMast.getIoType() != 104 && wrkMast.getIoType() != 107) { |
| | | throw new CoolException("当前入出库类型无法进行操作"); |
| | | } |
| | | // 工作状态判断 |
| | | if (wrkMast.getWrkSts() < 11 || wrkMast.getWrkSts() == 15) { |
| | | throw new CoolException("当前工作状态无法进行操作"); |
| | | } |
| | | // 保存工作明细档历史档 |
| | | // if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存工作明细档历史档失败"); |
| | | // } |
| | | // 保存工作主档历史档 |
| | | if (!taskLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("保存工作主档历史档失败"); |
| | | } |
| | | // 获取目标站 |
| | | Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>() |
| | | .eq("type_no", wrkMast.getIoType() - 50) |
| | | .eq("stn_no", wrkMast.getStaNo()) // 作业站点 = 拣料出库的目标站 |
| | | .eq("crn_no", wrkMast.getCrnNo()); // 堆垛机号 |
| | | StaDesc staDesc = staDescService.selectOne(wrapper); |
| | | if (Cools.isEmpty(staDesc)) { |
| | | throw new CoolException("入库路径不存在"); |
| | | } |
| | | Date now = new Date(); |
| | | // 堆垛机站点(目标站) |
| | | Integer staNo = staDesc.getCrnStn(); |
| | | // 更新工作档数据状态 |
| | | wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 |
| | | wrkMast.setWrkSts(2L); // 工作状态: 2.设备上走 |
| | | wrkMast.setSourceStaNo(wrkMast.getStaNo()); // 源站 |
| | | wrkMast.setStaNo(staNo + ""); // 目标站 |
| | | wrkMast.setLocNo(wrkMast.getSourceLocNo()); // 目标库位 = 出库时的源库位 |
| | | wrkMast.setSourceLocNo(""); // 源库位清空 |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setModiUser(userId); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("更新工作档数据状态失败"); |
| | | } |
| | | // 修改库位状态 Q.拣料/盘点/并板再入库 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | locMast.setLocSts("Q"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("修改库位状态失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void cancelWrkMast(String workNo, Long userId) { |
| | | Date now = new Date(); |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | String locNo = ""; // 待修改目标库位 |
| | | String locSts = ""; // 待修改目标库位状态 |
| | | // 入库取消(修改目标库位) |
| | | if (wrkMast.getWrkSts() < 4) { |
| | | locNo = wrkMast.getLocNo(); |
| | | locSts = "O"; |
| | | |
| | | // 库位转移 |
| | | if (wrkMast.getIoType() == 11) { |
| | | // 库位转移:源库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getSourceLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,源库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts(wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | // 出库取消(修改源库位) |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() != 14) { |
| | | locNo = wrkMast.getSourceLocNo(); |
| | | // 出库 ===>> F.在库 |
| | | if (wrkMast.getIoType() > 100 && wrkMast.getIoType() != 110) { |
| | | locSts = "F"; |
| | | // 空板出库 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 110) { |
| | | locSts = "D"; |
| | | // 库位转移 ===>> D.空桶/空栈板 |
| | | } else if (wrkMast.getIoType() == 11) { |
| | | locSts = wrkMast.getFullPlt().equalsIgnoreCase("N") ? "D" : "F"; |
| | | // 库位转移:目标库位 |
| | | LocMast locMast = locMastService.selectById(wrkMast.getLocNo()); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消库位转移失败,目标库位不存在:" + wrkMast.getSourceLocNo()); |
| | | } |
| | | locMast.setLocSts("O"); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | locMastService.updateById(locMast); |
| | | } |
| | | } else { |
| | | throw new CoolException("当前工作状态无法取消"); |
| | | } |
| | | |
| | | //取消入库工作档时,查询组托表,如果有将状态改为待处理 |
| | | if (wrkMast.getIoType() == 1) { |
| | | List<WaitPakin> waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | if (!Cools.isEmpty(waitPakin)) { |
| | | waitPakin.setIoStatus("N"); |
| | | waitPakin.setLocNo(""); |
| | | waitPakinService.update(waitPakin, new EntityWrapper<WaitPakin>() |
| | | // .eq("order_no", waitPakin.getOrderNo()) |
| | | .eq("zpallet", waitPakin.getZpallet()) |
| | | .eq("matnr", waitPakin.getMatnr()) |
| | | .eq("batch", waitPakin.getBatch())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //取消出库工作档时,查询单据管理表,回滚作业中数量 |
| | | if (wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) { |
| | | List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls) { |
| | | if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | OrderInAndOutUtil.decrease(Boolean.FALSE, wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getBrand(), |
| | | wrkDetl.getStandby1(), wrkDetl.getStandby2(), wrkDetl.getStandby3(), |
| | | wrkDetl.getBoxType1(), wrkDetl.getBoxType2(), wrkDetl.getBoxType3(), wrkDetl.getAnfme()); |
| | | |
| | | //修改订单主表状态,没有作业数量时才可以修改 |
| | | boolean flag = true; |
| | | // List<OrderDetl> orderDetls = orderDetlService.selectList(new EntityWrapper<OrderDetl>().eq("order_no",wrkDetl.getOrderNo())); |
| | | Order order = OrderInAndOutUtil.selectByNo(Boolean.FALSE, wrkDetl.getOrderNo()); |
| | | List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(Boolean.FALSE, order.getId()); |
| | | for (OrderDetl orderDetl : orderDetls) { |
| | | if (orderDetl.getWorkQty() > 0) { |
| | | flag = false; |
| | | } |
| | | } |
| | | if (flag) { |
| | | // Order order = orderService.selectOne(new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo())); |
| | | if (!Cools.isEmpty(order) && order.getSettle() == 2) { |
| | | order.setSettle(1L); |
| | | order.setUpdateBy(userId); |
| | | order.setUpdateTime(now); |
| | | } |
| | | // if(!orderService.update(order,new EntityWrapper<Order>().eq("order_no",wrkDetl.getOrderNo()))){ |
| | | // throw new CoolException("修改订单状态失败"); |
| | | // } |
| | | OrderInAndOutUtil.updateOrder(Boolean.FALSE, order.getId(), order.getSettle(), userId); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | // // 订单关联 |
| | | // List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | // for (WrkDetl wrkDetl : wrkDetls) { |
| | | // if (!Cools.isEmpty(wrkDetl.getOrderNo())) { |
| | | // if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) { |
| | | // throw new CoolException("订单数据回滚失败"); |
| | | // } |
| | | // // 生成新的出库作业 |
| | | //// stockOutRe(wrkMast, wrkDetls); |
| | | // } |
| | | // } |
| | | |
| | | // 取消操作人员记录 |
| | | wrkMast.setManuType("手动取消"); |
| | | wrkMast.setModiUser(userId); |
| | | wrkMast.setModiTime(now); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | throw new CoolException("取消工作档失败"); |
| | | } |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastLogService.save(wrkMast.getWrkNo())) { |
| | | throw new CoolException("保存工作历史档失败, workNo = " + wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | boolean wrkMastRes = wrkMastService.deleteById(wrkMast); |
| | | |
| | | if (wrkMast.getIoType() != 10 && wrkMast.getIoType() != 110) { |
| | | // 保存工作明细档历史档 |
| | | if (!wrkDetlLogService.save(wrkMast.getWrkNo())) { |
| | | // throw new CoolException("保存工作明细历史档失败, workNo = " + wrkMast.getWrkNo()); |
| | | } |
| | | // 删除工作档明细 |
| | | boolean wrkDetlRes = wrkDetlService.delete(new EntityWrapper<WrkDetl>().eq("wrk_no", workNo)); |
| | | } |
| | | |
| | | // 修改库位状态 |
| | | LocMast locMast = locMastService.selectById(locNo); |
| | | if (Cools.isEmpty(locMast)) { |
| | | throw new CoolException("取消工作档失败,库位不存在:" + locNo); |
| | | } |
| | | locMast.setLocSts(locSts); |
| | | locMast.setModiTime(now); |
| | | locMast.setModiUser(userId); |
| | | boolean locMastRes = locMastService.updateById(locMast); |
| | | if (!wrkMastRes || !locMastRes) { |
| | | throw new CoolException("保存数据失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @Override |
| | | @Transactional |
| | | public void completeWrkMast(String workNo, Long userId) { |
| | | WrkMast wrkMast = wrkMastService.selectById(workNo); |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", workNo)); |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | |
| | | } |
| | | |
| | | Set<Long> list = apallet.stream().map(WaitPakin::getOrderId).collect(Collectors.toSet()); |
| | | List<OrderPakin> pakins = orderPakinService.selectList(new EntityWrapper<OrderPakin>().in("order_id", list)); |
| | | List<OrderPakin> pakins = orderPakinService.selectList(new EntityWrapper<OrderPakin>().in("id", list)); |
| | | if (Objects.isNull(pakins) || pakins.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | |
| | | ,{field: 'batch', align: 'center',title: '货品特征', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: false} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: false} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: ''} |
| | | ,{field: 'taskType', align: 'center',title: '任务类型: agv , crn'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | , {field: 'wrkNo', align: 'center', title: '工作号', sort: true, width: 115} |
| | | , {field: 'ioTime$', align: 'center', title: '工作时间', sort: true, width: 160} |
| | | , {field: 'wrkSts$', align: 'center', title: '工作状态', width: 150} |
| | | , {field: 'ioType$', align: 'center', title: '入出库类型', width: 150} |
| | | , {field: 'ioPri', align: 'center', title: '优先级'} |
| | | , {field: 'taskType$', align: 'center', title: '任务类型'} |
| | | , {field: 'crnNo$', align: 'center', title: '堆垛机', hide: true} |
| | | , {field: 'sourceStaNo$', align: 'center', title: '源站'} |
| | | , {field: 'staNo$', align: 'center', title: '目标站'} |
| | | , {field: 'sourceLocNo', align: 'center', title: '源库位'} |
| | | , {field: 'locNo', align: 'center', title: '目标库位'} |
| | | , {field: 'barcode', align: 'center', title: '条码'} |
| | | , {field: 'preHave', align: 'center', title: '先入品', hide: true} |
| | | , {field: 'takeNone', align: 'center', title: '空操作', hide: true} |
| | | , {field: 'modiUser$', align: 'center', title: '修改人员', hide: true} |
| | | , {field: 'modiTime$', align: 'center', title: '修改时间', hide: true, width: 160} |
| | | , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 250} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(task)', function(obj){ |
| | | var data = obj.data; |
| | | let data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | // 明细展示 |
| | | case 'detlShow': |
| | | wrkNo = data.wrkNo; |
| | | // 弹层显示 |
| | | layer.open({ |
| | | type: 2, |
| | | title: '工作档明细', |
| | | maxmin: true, |
| | | area: [top.detailWidth, top.detailHeight], |
| | | shadeClose: true, |
| | | content: 'taskDetl.html', |
| | | success: function (layero, index) { |
| | | } |
| | | }); |
| | | break; |
| | | case "del": |
| | | del([data.id]); |
| | | // 完成 |
| | | case 'complete': |
| | | layer.confirm('确认完成该笔工作档?', {title: '工作号:' + data.wrkNo, shadeClose: true}, function () { |
| | | http.post(baseUrl + "/hand/control/wrkMast", {workNo: data.wrkNo, type: 1}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg); |
| | | }) |
| | | layer.closeAll(); |
| | | }); |
| | | break; |
| | | // 取消 |
| | | case 'cancel': |
| | | if (data.pdcType === "Y") { |
| | | layer.confirm('当前任务关联ERP销售单,取消将重新生成出库作业,是否继续?', { |
| | | title: '工作号:' + data.wrkNo, |
| | | shadeClose: true |
| | | }, function () { |
| | | http.post(baseUrl + "/hand/control/wrkMast", {workNo: data.wrkNo, type: 2}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg); |
| | | }) |
| | | layer.closeAll(); |
| | | }); |
| | | } else { |
| | | layer.confirm('确认取消该笔工作档?', { |
| | | title: '工作号:' + data.wrkNo, |
| | | shadeClose: true |
| | | }, function () { |
| | | http.post(baseUrl + "/hand/control/wrkMast", {workNo: data.wrkNo, type: 2}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg); |
| | | }) |
| | | layer.closeAll(); |
| | | }); |
| | | } |
| | | break; |
| | | // 拣料入库 |
| | | case 'pick': |
| | | layer.confirm('拣料入库该笔工作档?', {title: '工作号:' + data.wrkNo, shadeClose: true}, function () { |
| | | http.post(baseUrl + "/hand/control/wrkMast", {workNo: data.wrkNo, type: 3}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg); |
| | | }) |
| | | layer.closeAll(); |
| | | }); |
| | | break; |
| | | // 先入品 |
| | | case 'preHave': |
| | | layer.confirm('任务发生先入品异常。如需重新入库,请确保货物已放至堆垛机出库站!', { |
| | | title: '工作号:' + data.wrkNo, |
| | | shadeClose: true |
| | | }, function () { |
| | | http.post(baseUrl + "/deal/preHave/start", {wrkNo: data.wrkNo}, function (res) { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(data.wrkNo + res.msg, {icon: 1}); |
| | | }) |
| | | layer.closeAll(); |
| | | }); |
| | | break; |
| | | // 空操作 |
| | | case 'takeNone': |
| | | layer.confirm('任务发送空操作异常!是否。。。。。。。。?', { |
| | | title: '工作号:' + data.wrkNo, |
| | | shadeClose: true |
| | | }, function () { |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | |
| | | |
| | | }, 300); |
| | | } |
| | | |
| | | layDateRender(); |
| | | |
| | | }); |
| | |
| | | ,{field: 'barcode', align: 'center',title: '条码'} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | | // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){ |
| | | // var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.picking === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // ,{field: 'exitMk', align: 'center',title: '退出', templet:function(row){ |
| | | // var html = "<input value='exitMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.exitMk === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // ,{field: 'emptyMk', align: 'center',title: '空板', templet:function(row){ |
| | | // var html = "<input value='emptyMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.emptyMk === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | // |
| | | // ,{field: 'crnStrTime$', align: 'center',title: '堆垛机启动时间'} |
| | | // ,{field: 'crnEndTime$', align: 'center',title: '堆垛机停止时间'} |
| | | // ,{field: 'refIotime$', align: 'center',title: '拣料时间'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true, width: 160} |
| | | // ,{field: 'memo', align: 'center',title: '备注'} |
| | | // |
| | | // ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){ |
| | | // var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'"; |
| | | // if(row.fullPlt === 'Y'){html += " checked ";} |
| | | // html += ">"; |
| | | // return html; |
| | | // }} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:250} |
| | | ]], |
| | | request: { |
| | |
| | | </div> |
| | | <div class="layui-inline" style="width: 300px"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | <input class="layui-input layui-laydate-range" name="create_time" type="text" |
| | | placeholder="起始时间 - 终止时间" autocomplete="off" style="width: 300px"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" |
| | | autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> |
| | | {{#if (d.preHave === 'Y' && d.wrkSts === 3) { }} |
| | | <a class="layui-btn layui-btn-primary layui-border-red layui-btn-xs btn-error" lay-event="preHave">先入品</a> |
| | | {{# } }} |
| | | {{#if (d.takeNone === 'Y' && d.wrkSts === 12) { }} |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-error" lay-event="takeNone">空操作</a> |
| | | {{# } }} |
| | | <a class="layui-btn layui-btn-xs btn-detlShow" lay-event="detlShow">明细</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs btn-complete" lay-event="complete">完成</a> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs btn-cancel" lay-event="cancel">取消</a> |
| | | {{#if (d.ioType === 103) { }} |
| | | <a class="layui-btn layui-btn-warm layui-btn-xs btn-pick" lay-event="pick">拣</a> |
| | | {{# } }} |
| | | {{#if (d.ioType === 107) { }} |
| | | <a class="layui-btn layui-btn-warm layui-btn-xs btn-pick" lay-event="pick">盘</a> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/task/task.js" charset="utf-8"></script> |
| | | </body> |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |
| | | <input name="id" type="hidden"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">任务类型: agv , crn: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="taskType" placeholder="请输入任务类型: agv , crn"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |
| | | <div class="layui-form-item text-right"> |
| | | <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button> |
| | | <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button> |
| | | </div> |
| | | </form> |
| | | </script> |
| | | </html> |
| | | |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <div class="layui-inline" style="width:31%;margin-top: 20px"> |
| | | <label class="layui-form-label">工 作 号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input id="wrkNo" class="layui-input" type="text" disabled="disabled"> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="taskDetailByMast" lay-filter="taskDetailByMast"></table> |
| | | </body> |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/locMast/locMast.js" charset="utf-8"></script> |
| | | <script type="text/javascript"> |
| | | var pageCur; |
| | | |
| | | function getCol() { |
| | | var cols = [ |
| | | {field: 'wrkNo', align: 'center', title: '工作号'} |
| | | , {field: 'ioTime$', align: 'center', title: '工作时间'} |
| | | ]; |
| | | cols.push.apply(cols, detlCols); |
| | | return cols; |
| | | } |
| | | |
| | | layui.use(['table', 'laydate', 'form'], function () { |
| | | table = layui.table; |
| | | var $ = layui.jquery; |
| | | var form = layui.form; |
| | | |
| | | $('#wrkNo').val(parent.wrkNo); |
| | | // 数据渲染 |
| | | tableIns1 = table.render({ |
| | | elem: '#taskDetailByMast', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl + '/taskDetl/list/auth', |
| | | where: {wrk_no: parent.wrkNo}, |
| | | page: true, |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function (res, curr, count) { |
| | | if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } |
| | | pageCur = curr; |
| | | form.on('checkbox(tableCheckbox)', function (data) { |
| | | var _index = $(data.elem).attr('table-index') || 0; |
| | | if (data.elem.checked) { |
| | | res.data[_index][data.value] = 'Y'; |
| | | } else { |
| | | res.data[_index][data.value] = 'N'; |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | </script> |
| | | </html> |
| | | |