Merge remote-tracking branch 'origin/ahyxasrs' into ahyxasrs
New file |
| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.asrs.entity.WrkMastCrnLog; |
| | | import com.zy.asrs.service.WrkMastCrnLogService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class WrkMastCrnLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WrkMastCrnLogService wrkMastCrnLogService; |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | | return R.ok(wrkMastCrnLogService.selectById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<WrkMastCrnLog> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(WrkMastCrnLog.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(wrkMastCrnLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/add/auth") |
| | | @ManagerAuth |
| | | public R add(WrkMastCrnLog wrkMastCrnLog) { |
| | | wrkMastCrnLogService.insert(wrkMastCrnLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/update/auth") |
| | | @ManagerAuth |
| | | public R update(WrkMastCrnLog wrkMastCrnLog){ |
| | | if (Cools.isEmpty(wrkMastCrnLog) || null==wrkMastCrnLog.getWrkNo()){ |
| | | return R.error(); |
| | | } |
| | | wrkMastCrnLogService.updateById(wrkMastCrnLog); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | wrkMastCrnLogService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/export/auth") |
| | | @ManagerAuth |
| | | public R export(@RequestBody JSONObject param){ |
| | | EntityWrapper<WrkMastCrnLog> wrapper = new EntityWrapper<>(); |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("wrkMastCrnLog")); |
| | | convert(map, wrapper); |
| | | List<WrkMastCrnLog> list = wrkMastCrnLogService.selectList(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLogQuery/auth") |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WrkMastCrnLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("wrk_no", condition); |
| | | Page<WrkMastCrnLog> page = wrkMastCrnLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WrkMastCrnLog wrkMastCrnLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", wrkMastCrnLog.getWrkNo()); |
| | | map.put("value", wrkMastCrnLog.getWrkNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastCrnLog/check/column/auth") |
| | | @ManagerAuth |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<WrkMastCrnLog> wrapper = new EntityWrapper<WrkMastCrnLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != wrkMastCrnLogService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(WrkMastCrnLog.class, String.valueOf(param.get("key")))); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastSplitTwin/add/auth") |
| | | @ManagerAuth(memo = "拆分双工位任务添加") |
| | | @ManagerAuth(memo = "前后双工位任务添加") |
| | | public R add(WrkMastSplitTwin wrkMastSplitTwin) { |
| | | wrkMastSplitTwinService.insert(wrkMastSplitTwin); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastSplitTwin/update/auth") |
| | | @ManagerAuth(memo = "拆分双工位任务修改") |
| | | @ManagerAuth(memo = "前后双工位任务修改") |
| | | public R update(WrkMastSplitTwin wrkMastSplitTwin){ |
| | | if (Cools.isEmpty(wrkMastSplitTwin) || null==wrkMastSplitTwin.getId()){ |
| | | return R.error(); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/wrkMastSplitTwin/delete/auth") |
| | | @ManagerAuth(memo = "拆分双工位任务删除") |
| | | @ManagerAuth(memo = "前后双工位任务删除") |
| | | public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | for (Long id : ids){ |
| | | wrkMastSplitTwinService.deleteById(id); |
New file |
| | |
| | | package com.zy.asrs.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasWrkStatusService; |
| | | import com.zy.asrs.entity.BasWrkStatus; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasWrkIotypeService; |
| | | import com.zy.asrs.entity.BasWrkIotype; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasCrnpService; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.common.utils.Synchro; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import com.core.common.SpringUtils; |
| | | import com.zy.system.service.UserService; |
| | | import com.zy.system.entity.User; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("asr_wrk_mast_crn_log") |
| | | public class WrkMastCrnLog implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 工作号 |
| | | */ |
| | | @ApiModelProperty(value= "工作号") |
| | | @TableId(value = "wrk_no", type = IdType.INPUT) |
| | | @TableField("wrk_no") |
| | | private Long wrkNo; |
| | | |
| | | /** |
| | | * 工作状态 |
| | | */ |
| | | @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("loc_no") |
| | | private String locNo; |
| | | |
| | | /** |
| | | * 目标站 |
| | | */ |
| | | @ApiModelProperty(value= "目标站") |
| | | @TableField("sta_no") |
| | | private Integer staNo; |
| | | |
| | | /** |
| | | * 源站 |
| | | */ |
| | | @ApiModelProperty(value= "源站") |
| | | @TableField("source_sta_no") |
| | | private Integer sourceStaNo; |
| | | |
| | | /** |
| | | * 源库位 |
| | | */ |
| | | @ApiModelProperty(value= "源库位") |
| | | @TableField("source_loc_no") |
| | | private String sourceLocNo; |
| | | |
| | | @ApiModelProperty(value= "") |
| | | @TableField("loc_sts") |
| | | private String locSts; |
| | | |
| | | /** |
| | | * 工作时间 |
| | | */ |
| | | @ApiModelProperty(value= "工作时间") |
| | | @TableField("io_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date ioTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | @TableField("modi_user") |
| | | private String modiUser; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @TableField("modi_time") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date modiTime; |
| | | |
| | | /** |
| | | * 工作号1 |
| | | */ |
| | | @ApiModelProperty(value= "工作号1") |
| | | @TableField("wrk_no_one") |
| | | private Long wrkNoOne; |
| | | |
| | | /** |
| | | * 工作号2 |
| | | */ |
| | | @ApiModelProperty(value= "工作号2") |
| | | @TableField("wrk_no_two") |
| | | private Long wrkNoTwo; |
| | | |
| | | /** |
| | | * 目标库位1 |
| | | */ |
| | | @ApiModelProperty(value= "目标库位1") |
| | | @TableField("loc_no_one") |
| | | private String locNoOne; |
| | | |
| | | /** |
| | | * 目标库位2 |
| | | */ |
| | | @ApiModelProperty(value= "目标库位2") |
| | | @TableField("loc_no_two") |
| | | private String locNoTwo; |
| | | |
| | | /** |
| | | * 目标站1 |
| | | */ |
| | | @ApiModelProperty(value= "目标站1") |
| | | @TableField("sta_no_one") |
| | | private Integer staNoOne; |
| | | |
| | | /** |
| | | * 目标站2 |
| | | */ |
| | | @ApiModelProperty(value= "目标站2") |
| | | @TableField("sta_no_two") |
| | | private Integer staNoTwo; |
| | | |
| | | /** |
| | | * 源站1 |
| | | */ |
| | | @ApiModelProperty(value= "源站1") |
| | | @TableField("source_sta_no_one") |
| | | private Integer sourceStaNoOne; |
| | | |
| | | /** |
| | | * 源站2 |
| | | */ |
| | | @ApiModelProperty(value= "源站2") |
| | | @TableField("source_sta_no_two") |
| | | private Integer sourceStaNoTwo; |
| | | |
| | | /** |
| | | * 源库位1 |
| | | */ |
| | | @ApiModelProperty(value= "源库位1") |
| | | @TableField("source_loc_no_one") |
| | | private String sourceLocNoOne; |
| | | |
| | | /** |
| | | * 源库位2 |
| | | */ |
| | | @ApiModelProperty(value= "源库位2") |
| | | @TableField("source_loc_no_two") |
| | | private String sourceLocNoTwo; |
| | | |
| | | public WrkMastCrnLog() {} |
| | | |
| | | public WrkMastCrnLog(Long wrkNo,Long wrkSts,Integer ioType,Integer crnNo,String locNo,Integer staNo,Integer sourceStaNo,String sourceLocNo,String locSts,Date ioTime,String modiUser,Date modiTime,Long wrkNoOne,Long wrkNoTwo,String locNoOne,String locNoTwo,Integer staNoOne,Integer staNoTwo,Integer sourceStaNoOne,Integer sourceStaNoTwo,String sourceLocNoOne,String sourceLocNoTwo) { |
| | | this.wrkNo = wrkNo; |
| | | this.wrkSts = wrkSts; |
| | | this.ioType = ioType; |
| | | this.crnNo = crnNo; |
| | | this.locNo = locNo; |
| | | this.staNo = staNo; |
| | | this.sourceStaNo = sourceStaNo; |
| | | this.sourceLocNo = sourceLocNo; |
| | | this.locSts = locSts; |
| | | this.ioTime = ioTime; |
| | | this.modiUser = modiUser; |
| | | this.modiTime = modiTime; |
| | | this.wrkNoOne = wrkNoOne; |
| | | this.wrkNoTwo = wrkNoTwo; |
| | | this.locNoOne = locNoOne; |
| | | this.locNoTwo = locNoTwo; |
| | | this.staNoOne = staNoOne; |
| | | this.staNoTwo = staNoTwo; |
| | | this.sourceStaNoOne = sourceStaNoOne; |
| | | this.sourceStaNoTwo = sourceStaNoTwo; |
| | | this.sourceLocNoOne = sourceLocNoOne; |
| | | this.sourceLocNoTwo = sourceLocNoTwo; |
| | | } |
| | | |
| | | // WrkMastCrnLog wrkMastCrnLog = new WrkMastCrnLog( |
| | | // null, // 工作号[非空] |
| | | // null, // 工作状态 |
| | | // null, // 入出库类型 |
| | | // null, // 堆垛机 |
| | | // null, // 目标库位 |
| | | // null, // 目标站 |
| | | // null, // 源站 |
| | | // null, // 源库位 |
| | | // null, // |
| | | // null, // 工作时间 |
| | | // null, // 修改人员 |
| | | // null, // 修改时间 |
| | | // null, // 工作号1 |
| | | // null, // 工作号2 |
| | | // null, // 目标库位1 |
| | | // null, // 目标库位2 |
| | | // null, // 目标站1 |
| | | // null, // 目标站2 |
| | | // null, // 源站1 |
| | | // null, // 源站2 |
| | | // null, // 源库位1 |
| | | // null // 源库位2 |
| | | // ); |
| | | |
| | | 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 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 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 getModiUser$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.modiUser); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getModiTime$(){ |
| | | if (Cools.isEmpty(this.modiTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.modiTime); |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.common.utils.Synchro; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | } |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.mapper; |
| | | |
| | | import com.zy.asrs.entity.WrkMastCrnLog; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface WrkMastCrnLogMapper extends BaseMapper<WrkMastCrnLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.WrkMastCrnLog; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface WrkMastCrnLogService extends IService<WrkMastCrnLog> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.mapper.WrkMastCrnLogMapper; |
| | | import com.zy.asrs.entity.WrkMastCrnLog; |
| | | import com.zy.asrs.service.WrkMastCrnLogService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("wrkMastCrnLogService") |
| | | public class WrkMastCrnLogServiceImpl extends ServiceImpl<WrkMastCrnLogMapper, WrkMastCrnLog> implements WrkMastCrnLogService { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.WrkMastCrn; |
| | | import com.zy.asrs.entity.WrkMastSplitTwin; |
| | | import com.zy.asrs.entity.WrkMastSta; |
| | | import com.zy.asrs.service.WrkMastCrnService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.WrkMastSplitTwinService; |
| | | import com.zy.asrs.service.WrkMastStaService; |
| | | import com.zy.asrs.task.core.ReturnT; |
| | | import com.zy.asrs.task.handler.WorkLogHandler; |
| | |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private WrkMastStaService wrkMastStaService; |
| | | @Autowired |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | @Autowired |
| | | private WrkMastCrnService wrkMastCrnService; |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute(){ |
| | |
| | | return; |
| | | } |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | try{ |
| | | ReturnT<String> result = workLogHandler.start(wrkMast); |
| | | if (!result.isSuccess()) { |
| | | log.error("工作档[workNo={}]历史档处理失败", wrkMast.getWrkNo()); |
| | | log.error("wrkMast工作档[workNo={}]历史档处理失败", wrkMast.getWrkNo()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("wrkMast工作档[workNo={}]历史档处理失败,异常原因={}", wrkMast.getWrkNo(),e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute2(){ |
| | | List<WrkMastSta> wrkMastStaList = wrkMastStaService.selectList(new EntityWrapper<WrkMastSta>().eq("wrk_sts", 3)); |
| | | if (Cools.isEmpty(wrkMastStaList) || wrkMastStaList.size()==0) { |
| | | return; |
| | | } |
| | | for (WrkMastSta wrkMastSta : wrkMastStaList) { |
| | | try{ |
| | | ReturnT<String> result = workLogHandler.start(wrkMastSta); |
| | | if (!result.isSuccess()) { |
| | | log.error("工作档[workNo={}]历史档处理失败", wrkMastSta.getWrkNo()); |
| | | log.error("wrkMastSta工作档[workNo={}]历史档处理失败", wrkMastSta.getWrkNo()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("wrkMastSta工作档[workNo={}]历史档处理失败,异常原因={}", wrkMastSta.getWrkNo(),e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute3(){ |
| | | List<WrkMastSplitTwin> wrkMastSplitTwinList = wrkMastSplitTwinService.selectList(new EntityWrapper<WrkMastSplitTwin>().eq("wrk_sts", 4)); |
| | | for (WrkMastSplitTwin wrkMastSplitTwin : wrkMastSplitTwinList) { |
| | | try{ |
| | | ReturnT<String> result = workLogHandler.start(wrkMastSplitTwin); |
| | | if (!result.isSuccess()) { |
| | | log.error("wrkMastSplitTwin工作档[workNo={}]历史档处理失败", wrkMastSplitTwin.getWrkNo()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("wrkMastSplitTwin工作档[workNo={}]历史档处理失败,异常原因={}", wrkMastSplitTwin.getWrkNo(),e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | private void execute4(){ |
| | | List<WrkMastCrn> wrkMastCrnList = wrkMastCrnService.selectList(new EntityWrapper<WrkMastCrn>().eq("wrk_sts", 4).or().eq("wrk_sts",14)); |
| | | for (WrkMastCrn wrkMastCrn : wrkMastCrnList) { |
| | | try{ |
| | | ReturnT<String> result = workLogHandler.start(wrkMastCrn); |
| | | if (!result.isSuccess()) { |
| | | log.error("wrkMastCrn工作档[workNo={}]历史档处理失败", wrkMastCrn.getWrkNo()); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("wrkMastCrn工作档[workNo={}]历史档处理失败,异常原因={}", wrkMastCrn.getWrkNo(),e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | private WrkMastStaService wrkMastStaService; |
| | | @Autowired |
| | | private WrkMastStaLogService wrkMastStaLogService; |
| | | @Autowired |
| | | private WrkMastSplitTwinService wrkMastSplitTwinService; |
| | | @Autowired |
| | | private WrkMastSplitTwinLogService wrkMastSplitTwinLogService; |
| | | @Autowired |
| | | private WrkMastCrnService wrkMastCrnService; |
| | | @Autowired |
| | | private WrkMastCrnLogService wrkMastCrnLogService; |
| | | |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMast wrkMast) { |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMastSplitTwin wrkMastSplitTwin) { |
| | | try { |
| | | WrkMastSplitTwinLog wrkMastSplitTwinLog = new WrkMastSplitTwinLog(); |
| | | wrkMastSplitTwinLog.sync(wrkMastSplitTwin); |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastSplitTwinLogService.insert(wrkMastSplitTwinLog)) { |
| | | exceptionHandle("保存wrkMastSplitTwinLog工作历史档[workNo={0}]失败", wrkMastSplitTwin.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastSplitTwinService.deleteById(wrkMastSplitTwin)) { |
| | | exceptionHandle("删除wrkMastSplitTwin工作主档[workNo={0}]失败", wrkMastSplitTwin.getWrkNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | @Transactional |
| | | public ReturnT<String> start(WrkMastCrn wrkMastCrn) { |
| | | try { |
| | | WrkMastCrnLog wrkMastCrnLog = new WrkMastCrnLog(); |
| | | wrkMastCrnLog.sync(wrkMastCrn); |
| | | // 保存工作主档历史档 |
| | | if (!wrkMastCrnLogService.insert(wrkMastCrnLog)) { |
| | | exceptionHandle("保存wrkMastCrnLog工作历史档[workNo={0}]失败", wrkMastCrn.getWrkNo()); |
| | | } |
| | | // 删除工作主档 |
| | | if (!wrkMastCrnService.deleteById(wrkMastCrn)) { |
| | | exceptionHandle("删除wrkMastCrn工作主档[workNo={0}]失败", wrkMastCrn.getWrkNo()); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | log.error("前后双工位拆分堆垛机执行作业生成异常!!!====>工作号={},任务类型={},任务类型异常!",wrkMastSplitTwin.getWrkNo(),wrkMastSplitTwin.getIoType$()); |
| | | return FAIL; |
| | | } |
| | | wrkMastSplitTwinNew.setStartRow(LocAndStaCodeUtil.getRow(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setStartBay(LocAndStaCodeUtil.getBay(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setStartLev(LocAndStaCodeUtil.getLev(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setEndRow(LocAndStaCodeUtil.getRow(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setEndBay(LocAndStaCodeUtil.getBay(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setEndLev(LocAndStaCodeUtil.getLev(wrkMastSplitTwin.getWrkStart())); |
| | | wrkMastSplitTwinNew.setStartRow(LocAndStaCodeUtil.getRow(wrkMastSplitTwinNew.getWrkStart())); |
| | | wrkMastSplitTwinNew.setStartBay(LocAndStaCodeUtil.getBay(wrkMastSplitTwinNew.getWrkStart())); |
| | | wrkMastSplitTwinNew.setStartLev(LocAndStaCodeUtil.getLev(wrkMastSplitTwinNew.getWrkStart())); |
| | | wrkMastSplitTwinNew.setEndRow(LocAndStaCodeUtil.getRow(wrkMastSplitTwinNew.getWrkEnd())); |
| | | wrkMastSplitTwinNew.setEndBay(LocAndStaCodeUtil.getBay(wrkMastSplitTwinNew.getWrkEnd())); |
| | | wrkMastSplitTwinNew.setEndLev(LocAndStaCodeUtil.getLev(wrkMastSplitTwinNew.getWrkEnd())); |
| | | wrkMastSplitTwinNew.setWrkType(1);//工作类型 0: 未知 1: 取 2: 放 3: 取放 4: 完成 |
| | | wrkMastSplitTwinNew.setIoType(wrkMastSplitTwin.getIoType());//任务类型 0: 未知 1: 入库 2: 出库 |
| | | wrkMastSplitTwinNew.setWrkSts(0);//工作状态 0: 初始 1: 等待取货完成 2: 取货完成待作业 3: 等待放货完成 4: 完成 |
| | |
| | | generator.url="192.168.4.15:1433;databasename=ahyxasrs"; |
| | | generator.username="sa"; |
| | | generator.password="sa@123"; |
| | | generator.table="asr_wrk_mast_split_twin_log"; |
| | | generator.table="asr_wrk_mast_crn_log"; |
| | | generator.packagePath="com.zy.asrs"; |
| | | generator.build(); |
| | | } |
| | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrn#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn/wrkMastCrn.html', N'wrkMastCrn管理', null, '2', null, '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn/wrkMastCrn.html', N'左右双工位作业档案', '221', '2', '11', '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-export', N'导出', '', '3', '4', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#view', N'查询', '60616', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-add', N'新增', '60616', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-edit', N'编辑', '60616', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-delete', N'删除', '60616', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrn#btn-export', N'导出', '60616', '3', '4', '1'); |
New file |
| | |
| | | -- save wrkMastCrnLog record |
| | | -- mysql |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog/wrkMastCrnLog.html', 'wrkMastCrnLog管理', null , '2', null , '1'); |
| | | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog#view', '查询', '', '3', '0', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog#btn-add', '新增', '', '3', '1', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog#btn-edit', '编辑', '', '3', '2', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog#btn-delete', '删除', '', '3', '3', '1'); |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastCrnLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog/wrkMastCrnLog.html', N'左右双工位历史档案', '221', '2', '11', '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog#btn-add', N'新增', '', '3', '1', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog#btn-edit', N'编辑', '', '3', '2', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog#btn-delete', N'删除', '', '3', '3', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastCrnLog#btn-export', N'导出', '', '3', '4', '1'); |
| | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastSplitTwin#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwin/wrkMastSplitTwin.html', N'wrkMastSplitTwin管理', null, '2', null, '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwin/wrkMastSplitTwin.html', N'前后双工位作业档案', '221', '2', '12', '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwin#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwin#btn-add', N'新增', '', '3', '1', '1'); |
| | |
| | | insert into `sys_resource` ( `code`, `name`, `resource_id`, `level`, `sort`, `status`) values ( 'wrkMastSplitTwinLog#btn-export', '导出', '', '3', '4', '1'); |
| | | |
| | | -- sqlserver |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwinLog/wrkMastSplitTwinLog.html', N'wrkMastSplitTwinLog管理', null, '2', null, '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwinLog/wrkMastSplitTwinLog.html', N'前后双工位历史档案', '221', '2', '13', '1'); |
| | | |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwinLog#view', N'查询', '', '3', '0', '1'); |
| | | insert [dbo].[sys_resource] ( [code], [name], [resource_id], [level], [sort], [status]) values ( N'wrkMastSplitTwinLog#btn-add', N'新增', '', '3', '1', '1'); |
New file |
| | |
| | | <?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.zy.asrs.mapper.WrkMastCrnLogMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMastCrnLog"> |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="wrk_sts" property="wrkSts" /> |
| | | <result column="io_type" property="ioType" /> |
| | | <result column="crn_no" property="crnNo" /> |
| | | <result column="loc_no" property="locNo" /> |
| | | <result column="sta_no" property="staNo" /> |
| | | <result column="source_sta_no" property="sourceStaNo" /> |
| | | <result column="source_loc_no" property="sourceLocNo" /> |
| | | <result column="loc_sts" property="locSts" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="modi_user" property="modiUser" /> |
| | | <result column="modi_time" property="modiTime" /> |
| | | <result column="wrk_no_one" property="wrkNoOne" /> |
| | | <result column="wrk_no_two" property="wrkNoTwo" /> |
| | | <result column="loc_no_one" property="locNoOne" /> |
| | | <result column="loc_no_two" property="locNoTwo" /> |
| | | <result column="sta_no_one" property="staNoOne" /> |
| | | <result column="sta_no_two" property="staNoTwo" /> |
| | | <result column="source_sta_no_one" property="sourceStaNoOne" /> |
| | | <result column="source_sta_no_two" property="sourceStaNoTwo" /> |
| | | <result column="source_loc_no_one" property="sourceLocNoOne" /> |
| | | <result column="source_loc_no_two" property="sourceLocNoTwo" /> |
| | | |
| | | </resultMap> |
| | | |
| | | </mapper> |
New file |
| | |
| | | var pageCurr; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | | elem: '#wrkMastCrnLog', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/wrkMastCrnLog/list/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '工作号'} |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态'} |
| | | ,{field: 'ioType$', align: 'center',title: '入出库类型'} |
| | | ,{field: 'crnNo$', align: 'center',title: '堆垛机'} |
| | | ,{field: 'locNo$', align: 'center',title: '目标库位'} |
| | | ,{field: 'staNo$', align: 'center',title: '目标站'} |
| | | ,{field: 'sourceStaNo$', align: 'center',title: '源站'} |
| | | ,{field: 'sourceLocNo$', align: 'center',title: '源库位'} |
| | | ,{field: 'locSts', align: 'center',title: ''} |
| | | ,{field: 'ioTime$', align: 'center',title: '工作时间'} |
| | | ,{field: 'modiUser$', align: 'center',title: '修改人员'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'wrkNoOne', align: 'center',title: '工作号1'} |
| | | ,{field: 'wrkNoTwo', align: 'center',title: '工作号2'} |
| | | ,{field: 'locNoOne', align: 'center',title: '目标库位1'} |
| | | ,{field: 'locNoTwo', align: 'center',title: '目标库位2'} |
| | | ,{field: 'staNoOne', align: 'center',title: '目标站1'} |
| | | ,{field: 'staNoTwo', align: 'center',title: '目标站2'} |
| | | ,{field: 'sourceStaNoOne', align: 'center',title: '源站1'} |
| | | ,{field: 'sourceStaNoTwo', align: 'center',title: '源站2'} |
| | | ,{field: 'sourceLocNoOne', align: 'center',title: '源库位1'} |
| | | ,{field: 'sourceLocNoTwo', align: 'center',title: '源库位2'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | | 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+"/"; |
| | | } |
| | | pageCurr=curr; |
| | | limit(); |
| | | } |
| | | }); |
| | | |
| | | // 监听排序事件 |
| | | table.on('sort(wrkMastCrnLog)', function (obj) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | searchData['orderByField'] = obj.field; |
| | | searchData['orderByType'] = obj.type; |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: 1} |
| | | }); |
| | | }); |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(wrkMastCrnLog)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | | switch(obj.event) { |
| | | case 'addData': |
| | | showEditModel(); |
| | | break; |
| | | case 'deleteData': |
| | | if (checkStatus.length === 0) { |
| | | layer.msg('请选择要删除的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | del(checkStatus.map(function (d) { |
| | | return d.wrkNo; |
| | | })); |
| | | break; |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | | var fields=[]; |
| | | obj.config.cols[0].map(function (col) { |
| | | if (col.type === 'normal' && col.hide === false && col.toolbar == null) { |
| | | titles.push(col.title); |
| | | fields.push(col.field); |
| | | } |
| | | }); |
| | | var exportData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | exportData[this.name] = this.value; |
| | | }); |
| | | var param = { |
| | | 'wrkMastCrnLog': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastCrnLog/export/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(param), |
| | | dataType:'json', |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200) { |
| | | table.exportFile(titles,res.data,'xls'); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }); |
| | | }); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | // 监听行工具事件 |
| | | table.on('tool(wrkMastCrnLog)', function(obj){ |
| | | var data = obj.data; |
| | | switch (obj.event) { |
| | | case 'edit': |
| | | showEditModel(data); |
| | | break; |
| | | case "del": |
| | | del([data.wrkNo]); |
| | | break; |
| | | } |
| | | }); |
| | | |
| | | /* 弹窗 - 新增、修改 */ |
| | | function showEditModel(mData) { |
| | | admin.open({ |
| | | type: 1, |
| | | area: '600px', |
| | | title: (mData ? '修改' : '添加') + '订单状态', |
| | | content: $('#editDialog').html(), |
| | | success: function (layero, dIndex) { |
| | | layDateRender(mData); |
| | | form.val('detail', mData); |
| | | form.on('submit(editSubmit)', function (data) { |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastCrnLog/"+(mData?'update':'add')+"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: data.field, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.close(dIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | return false; |
| | | }); |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | layui.form.render('select'); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /* 删除 */ |
| | | function del(ids) { |
| | | layer.confirm('确定要删除选中数据吗?', { |
| | | skin: 'layui-layer-admin', |
| | | shade: .1 |
| | | }, function (i) { |
| | | layer.close(i); |
| | | var loadIndex = layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/wrkMastCrnLog/delete/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: {ids: ids}, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.close(loadIndex); |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableReload(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 时间选择器 |
| | | function layDateRender(data) { |
| | | setTimeout(function () { |
| | | layDate.render({ |
| | | elem: '.layui-laydate-range' |
| | | ,type: 'datetime' |
| | | ,range: true |
| | | }); |
| | | layDate.render({ |
| | | elem: '#ioTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['ioTime\\$']:null |
| | | }); |
| | | layDate.render({ |
| | | elem: '#modiTime\\$', |
| | | type: 'datetime', |
| | | value: data!==undefined?data['modiTime\\$']:null |
| | | }); |
| | | |
| | | }, 300); |
| | | } |
| | | layDateRender(); |
| | | |
| | | }); |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | | }); |
| | | |
| | | function tableReload(child) { |
| | | var searchData = {}; |
| | | $.each($('#search-box [name]').serializeArray(), function() { |
| | | searchData[this.name] = this.value; |
| | | }); |
| | | tableIns.reload({ |
| | | where: searchData, |
| | | page: {curr: pageCurr} |
| | | }); |
| | | } |
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/admin.css?v=318" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | </head> |
| | | <body> |
| | | |
| | | <div class="layui-fluid"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body"> |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | </div> |
| | | </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"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | | <button class="layui-btn icon-btn" lay-filter="search" lay-submit> |
| | | <i class="layui-icon"></i>搜索 |
| | | </button> |
| | | <button class="layui-btn icon-btn" lay-filter="reset" lay-submit> |
| | | <i class="layui-icon"></i>重置 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <table class="layui-hide" id="wrkMastCrnLog" lay-filter="wrkMastCrnLog"></table> |
| | | </div> |
| | | </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> |
| | | </script> |
| | | |
| | | <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/wrkMastCrnLog/wrkMastCrnLog.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 layui-form-required">工作号: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wrkNo" placeholder="请输入工作号" lay-vertype="tips" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">工作状态: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="wrkSts" placeholder="请输入工作状态" style="display: none"> |
| | | <input id="wrkSts$" name="wrkSts$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入工作状态" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWrkStatusQueryBywrkSts" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWrkStatusQueryBywrkStsSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">入出库类型: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="ioType" placeholder="请输入入出库类型" style="display: none"> |
| | | <input id="ioType$" name="ioType$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入入出库类型" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basWrkIotypeQueryByioType" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basWrkIotypeQueryByioTypeSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">堆垛机: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="crnNo" placeholder="请输入堆垛机" style="display: none"> |
| | | <input id="crnNo$" name="crnNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入堆垛机" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basCrnpQueryBycrnNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basCrnpQueryBycrnNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标库位: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="locNo" placeholder="请输入目标库位" style="display: none"> |
| | | <input id="locNo$" name="locNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入目标库位" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locMastQueryBylocNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locMastQueryBylocNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标站: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="staNo" placeholder="请输入目标站" style="display: none"> |
| | | <input id="staNo$" name="staNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入目标站" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basDevpQueryBystaNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basDevpQueryBystaNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源站: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="sourceStaNo" placeholder="请输入源站" style="display: none"> |
| | | <input id="sourceStaNo$" name="sourceStaNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入源站" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="basDevpQueryBysourceStaNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="basDevpQueryBysourceStaNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源库位: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="sourceLocNo" placeholder="请输入源库位" style="display: none"> |
| | | <input id="sourceLocNo$" name="sourceLocNo$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入源库位" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="locMastQueryBysourceLocNo" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="locMastQueryBysourceLocNoSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locSts" placeholder="请输入"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">工作时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="ioTime" id="ioTime$" placeholder="请输入工作时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改人员: </label> |
| | | <div class="layui-input-block cool-auto-complete"> |
| | | <input class="layui-input" name="modiUser" placeholder="请输入修改人员" style="display: none"> |
| | | <input id="modiUser$" name="modiUser$" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="请输入修改人员" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="userQueryBymodiUser" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="userQueryBymodiUserSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">修改时间: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="modiTime" id="modiTime$" placeholder="请输入修改时间"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">工作号1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wrkNoOne" placeholder="请输入工作号1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">工作号2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="wrkNoTwo" placeholder="请输入工作号2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标库位1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNoOne" placeholder="请输入目标库位1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标库位2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="locNoTwo" placeholder="请输入目标库位2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标站1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="staNoOne" placeholder="请输入目标站1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">目标站2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="staNoTwo" placeholder="请输入目标站2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源站1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="sourceStaNoOne" placeholder="请输入源站1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源站2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="sourceStaNoTwo" placeholder="请输入源站2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源库位1: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="sourceLocNoOne" placeholder="请输入源库位1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">源库位2: </label> |
| | | <div class="layui-input-block"> |
| | | <input class="layui-input" name="sourceLocNoTwo" placeholder="请输入源库位2"> |
| | | </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> |
| | | |