Commit ae50762bd797aa22bc12c4b9e60ed8495ec54f1b

Authored by liufu
1 parent 613f1932

空托盘入库、空托盘出库以及移库bug修复

src/main/java/com/huaheng/pc/general/container/service/ContainerServiceImpl.java
... ... @@ -8,6 +8,7 @@ import com.huaheng.pc.general.container.domain.ContainerStatus;
8 8 import com.huaheng.pc.general.container.mapper.ContainerMapperAuto;
9 9 import com.huaheng.pc.general.container.mapper.ContainerMapper;
10 10 import com.huaheng.pc.general.location.domain.Location;
  11 +import com.huaheng.pc.general.location.mapper.LocationMapper;
11 12 import com.huaheng.pc.general.location.mapper.LocationMapperAuto;
12 13 import com.huaheng.pc.inventory.inventory.domain.Inventory;
13 14 import com.huaheng.pc.inventory.inventory.service.IInventoryService;
... ... @@ -39,6 +40,8 @@ public class ContainerServiceImpl implements IContainerService {
39 40 private ContainerMapperAuto aotuMapper;
40 41 @Resource
41 42 private LocationMapperAuto locationAutoMapper;
  43 + @Resource
  44 + LocationMapper locationMapper;
42 45  
43 46 public List<Container> selectListEntityByLike(Container condition) {
44 47 return aotuMapper.selectListEntityByLike(condition);
... ... @@ -146,6 +149,11 @@ public class ContainerServiceImpl implements IContainerService {
146 149 return true;
147 150 }
148 151  
  152 + @Override
  153 + public List<Location> getEmptyContainerInLocation(String containerCode, String locationCode, Integer warehouseId) {
  154 + return locationMapper.getEmptyContainerInLocation(containerCode,locationCode,warehouseId);
  155 + }
  156 +
149 157 private Integer getNumber(String type) {
150 158 if (!dictDataService.checkConfig("containerType",type))
151 159 throw new ServiceException("容器类型编码不存在");
... ...
src/main/java/com/huaheng/pc/general/container/service/IContainerService.java
... ... @@ -3,6 +3,7 @@ package com.huaheng.pc.general.container.service;
3 3 import com.huaheng.framework.web.domain.AjaxResult;
4 4  
5 5 import com.huaheng.pc.general.container.domain.Container;
  6 +import com.huaheng.pc.general.location.domain.Location;
6 7  
7 8 import java.util.List;
8 9 import java.util.Map;
... ... @@ -41,6 +42,7 @@ public interface IContainerService {
41 42  
42 43 Boolean insertContainer(String type, Integer quantity);
43 44  
  45 + List<Location> getEmptyContainerInLocation(String containerCode, String locationCode, Integer warehouseId);
44 46 }
45 47  
46 48  
... ...
src/main/java/com/huaheng/pc/general/location/mapper/LocationMapper.java
1 1 package com.huaheng.pc.general.location.mapper;
2 2  
3 3  
  4 +import com.huaheng.pc.general.location.domain.Location;
  5 +import org.apache.ibatis.annotations.Param;
  6 +
  7 +import java.util.List;
  8 +
4 9 /**
5 10 * 库位 数据层
6 11 *
... ... @@ -9,5 +14,6 @@ package com.huaheng.pc.general.location.mapper;
9 14 */
10 15 public interface LocationMapper {
11 16  
  17 + List<Location> getEmptyContainerInLocation(@Param("containerCode") String containerCode,@Param("locationCode") String locationCode,@Param("warehouseId") Integer warehouseId);
12 18 }
13 19  
... ...
src/main/java/com/huaheng/pc/inventory/inventory/mapper/InventoryMapper.java
... ... @@ -2,6 +2,8 @@ package com.huaheng.pc.inventory.inventory.mapper;
2 2  
3 3 import com.huaheng.pc.inventory.inventory.domain.Inventory;
4 4 import com.huaheng.pc.inventory.inventory.domain.InventorySearchModel;
  5 +import org.apache.ibatis.annotations.Param;
  6 +
5 7 import java.util.List;
6 8  
7 9 /**
... ... @@ -19,5 +21,9 @@ public interface InventoryMapper {
19 21 List<Inventory> selectListEntityByLikeLocationCode(Inventory condition);
20 22  
21 23 List<Inventory> selectListEntityByLikeMaterialCode(Inventory condition);
  24 +
  25 + int getUncompleteReceiptContainer(@Param("locationCode") String locationCode,@Param("warehouseId") int warehouseId);
  26 +
  27 + int getUncompleteShipmentContainer(@Param("locationCode") String locationCode,@Param("warehouseId") int warehouseId);
22 28 }
23 29  
... ...
src/main/java/com/huaheng/pc/inventory/inventory/service/IInventoryService.java
... ... @@ -46,6 +46,10 @@ public interface IInventoryService {
46 46 AjaxResult getInventoryForecast(String code);
47 47  
48 48 AjaxResult transfer(String sourceLocation, String destinationLocation);
  49 +
  50 + int getUncompleteReceiptContainer(String locationCode,int warehouseId);
  51 +
  52 + int getUncompleteShipmentContainer(String sourceLocation, Integer warehouseId);
49 53 }
50 54  
51 55  
... ...
src/main/java/com/huaheng/pc/inventory/inventory/service/InventoryServiceImpl.java
... ... @@ -168,6 +168,16 @@ public class InventoryServiceImpl implements IInventoryService {
168 168 return taskService.createTransferTask(sourceLocation,destinationLocation);
169 169 }
170 170  
  171 + @Override
  172 + public int getUncompleteReceiptContainer(String locationCode, int warehouseId) {
  173 + return inventoryMapper.getUncompleteReceiptContainer(locationCode,warehouseId);
  174 + }
  175 +
  176 + @Override
  177 + public int getUncompleteShipmentContainer(String locationCode, Integer warehouseId) {
  178 + return inventoryMapper.getUncompleteShipmentContainer(locationCode,warehouseId);
  179 + }
  180 +
171 181 private boolean isLocation(String code) {
172 182 boolean result = false;
173 183 if(code.contains("-")) {
... ...
src/main/java/com/huaheng/pc/task/task/controller/TaskController.java
... ... @@ -3,8 +3,13 @@ package com.huaheng.pc.task.task.controller;
3 3 import com.huaheng.common.support.Convert;
4 4 import com.huaheng.common.utils.StringUtils;
5 5 import com.huaheng.common.utils.security.ShiroUtils;
  6 +import com.huaheng.pc.general.container.domain.Container;
  7 +import com.huaheng.pc.general.container.service.ContainerServiceImpl;
  8 +import com.huaheng.pc.general.location.domain.Location;
  9 +import com.huaheng.pc.general.location.service.LocationServiceImpl;
6 10 import com.huaheng.pc.task.task.service.TaskServiceImpl;
7 11 import org.apache.shiro.authz.annotation.RequiresPermissions;
  12 +import org.aspectj.weaver.loadtime.Aj;
8 13 import org.springframework.beans.factory.annotation.Autowired;
9 14 import org.springframework.stereotype.Controller;
10 15 import org.springframework.ui.ModelMap;
... ... @@ -36,6 +41,8 @@ public class TaskController extends BaseController
36 41  
37 42 @Autowired
38 43 private ITaskService taskService;
  44 + @Autowired
  45 + private ContainerServiceImpl containerService;
39 46  
40 47 @RequiresPermissions("task:task")
41 48 @GetMapping()
... ... @@ -150,5 +157,43 @@ public class TaskController extends BaseController
150 157 AjaxResult ajaxResult = taskService.completeTask(Convert.toIntArray(taskId));
151 158 return ajaxResult;
152 159 }
  160 +
  161 + @PostMapping("/emptyIn")
  162 + @ResponseBody
  163 + public AjaxResult emptyIn(String containerCode,String destinationLocation){
  164 + return taskService.createEmptyIn( containerCode, destinationLocation);
  165 + }
  166 +
  167 + @GetMapping("/emptyIn")
  168 + public String emptyIn(){
  169 + return prefix+"/emptyIn";
  170 + }
  171 +
  172 + @GetMapping("/emptyOut")
  173 + public String emptyOut(){
  174 + return prefix+"/emptyOut";
  175 + }
  176 +
  177 + @PostMapping("/emptyOut")
  178 + @ResponseBody
  179 + public AjaxResult emptyOut(String containerCode,String sourceLocation){
  180 + return taskService.createEmptyOut(containerCode, sourceLocation);
  181 + }
  182 +
  183 + @PostMapping("/listEmptyContainer")
  184 + @ResponseBody
  185 + public TableDataInfo listEmptyContainer(String containerCode,String locationCode)
  186 + {
  187 + containerCode = containerCode==null?"":containerCode.trim();
  188 + locationCode = locationCode==null?"":locationCode.trim();
  189 + startPage();
  190 + List<Location> list = containerService.getEmptyContainerInLocation(containerCode,locationCode,ShiroUtils.getWarehouseId());
  191 + return getDataTable(list);
  192 + }
  193 +
  194 + @GetMapping("/listEmpty")
  195 + public String listEmpty(){
  196 + return prefix+"/emptyContainer";
  197 + }
153 198  
154 199 }
... ...
src/main/java/com/huaheng/pc/task/task/service/ITaskService.java
... ... @@ -69,6 +69,10 @@ public interface ITaskService {
69 69 AjaxResult createTransferTask(String sourceLocation,String destinationLocation);
70 70  
71 71 AjaxResult createCheckOutTask(String[] ids);
  72 +
  73 + AjaxResult createEmptyIn(String containerCode, String destinationLocation);
  74 +
  75 + AjaxResult createEmptyOut(String containerCode, String sourceLocation);
72 76 }
73 77  
74 78  
... ...
src/main/java/com/huaheng/pc/task/task/service/TaskServiceImpl.java
... ... @@ -185,12 +185,12 @@ public class TaskServiceImpl implements ITaskService {
185 185 //出库任务,则修改关联的出库货箱状态
186 186 shipmentContainerHeaderService.resetStatusShipmentContainer(task.getContainerCode(),(short)0);
187 187 }
188   - if(task.getType()==800){
  188 + if(task.getType()==800||task.getType()==900||task.getType()==500||task.getType()==600){
189 189 //移库任务没有关联的货箱,故这里不做处理
190 190 }
191   - if(task.getType()==900){
192   - //出库查看任务没有关联的货箱,不做处理
193   - }
  191 +// if(task.getType()==900){
  192 +// //出库查看任务没有关联的货箱,不做处理
  193 +// }
194 194 }
195 195  
196 196 return AjaxResult.success("取消任务成功!");
... ... @@ -258,11 +258,55 @@ public class TaskServiceImpl implements ITaskService {
258 258 //移库
259 259 completeTransferTask(task);
260 260 }
  261 + if(task.getType() == 500){
  262 + completeEmptyIn(task);
  263 + }
  264 + if(task.getType()==600){
  265 + completeEmptyOut(task);
  266 + }
261 267 }
262 268 return AjaxResult.success("完成任务成功!");
263 269 }
264 270  
265 271 /**
  272 + * 完成空托盘出库任务
  273 + * @param task
  274 + */
  275 + private void completeEmptyOut(Task task) {
  276 + //更新货位
  277 + Location temp1 = new Location();
  278 + temp1.setWarehouseId(ShiroUtils.getWarehouseId());
  279 + temp1.setCode(task.getSourceLocation());
  280 + Location loc = locationService.selectFirstEntity(temp1);
  281 + loc.setContainerCode("");
  282 + loc.setStatus("empty");
  283 + locationService.updateByModel(loc);
  284 + //更新任务状态为40
  285 + task.setLastStatus((short) 40);
  286 + task.setFirstStatus((short) 40);
  287 + taskService.updateByModel(task);
  288 + //空托出库无需写库存交易记录
  289 + }
  290 +
  291 + /**
  292 + * 完成空托盘入库任务
  293 + * @param task
  294 + */
  295 + private void completeEmptyIn(Task task) {
  296 + Location temp1 = new Location();
  297 + temp1.setWarehouseId(ShiroUtils.getWarehouseId());
  298 + temp1.setCode(task.getDestinationLocation());
  299 + Location loc1 = locationService.selectFirstEntity(temp1);
  300 + loc1.setContainerCode(task.getContainerCode());
  301 + loc1.setStatus("empty");
  302 + locationService.updateByModel(loc1);
  303 + //完成任务
  304 + task.setLastStatus((short) 40);
  305 + task.setFirstStatus((short) 40);
  306 + taskService.updateByModel(task);
  307 + }
  308 +
  309 + /**
266 310 * 完成移库任务
267 311 * @param task
268 312 */
... ... @@ -930,6 +974,17 @@ public class TaskServiceImpl implements ITaskService {
930 974 if(StringUtils.isEmpty(loc1.getContainerCode())){
931 975 return AjaxResult.error("源库位:"+sourceLocation+"不存在托盘");
932 976 }
  977 + //这里增加组盘校验,如果此托盘存在未完成的组盘数据,则不能移库
  978 + //校验入库组盘
  979 + int count1 = inventoryService.getUncompleteReceiptContainer(sourceLocation,ShiroUtils.getWarehouseId());
  980 + if(count1>0){
  981 + return AjaxResult.error("源库位:"+sourceLocation+"存在入库组盘,不能移库");
  982 + }
  983 + int count2 = inventoryService.getUncompleteShipmentContainer(sourceLocation,ShiroUtils.getWarehouseId());
  984 + if(count2>0){
  985 + return AjaxResult.error("源库位:"+sourceLocation+"存在出库组盘,不能移库");
  986 + }
  987 +
933 988 Location temp2 = new Location();
934 989 temp2.setWarehouseId(ShiroUtils.getWarehouseId());
935 990 temp2.setCode(destinationLocation);
... ... @@ -943,6 +998,10 @@ public class TaskServiceImpl implements ITaskService {
943 998 if(StringUtils.isNotEmpty(loc2.getContainerCode())){
944 999 return AjaxResult.error("目标库位:"+destinationLocation+"已存在托盘");
945 1000 }
  1001 + int count3 = inventoryService.getUncompleteReceiptContainer(destinationLocation,ShiroUtils.getWarehouseId());
  1002 + if(count3>0){
  1003 + return AjaxResult.error("目标库位:"+sourceLocation+"存在入库组盘,不能移库");
  1004 + }
946 1005 //hack:这里暂时写死第五层不能往其他四层移库
947 1006 if(loc1.getLayer()==5){
948 1007 if(loc2.getLayer()<4){
... ... @@ -1027,4 +1086,102 @@ public class TaskServiceImpl implements ITaskService {
1027 1086 }
1028 1087 return AjaxResult.success("生成出库查看成功");
1029 1088 }
  1089 +
  1090 + @Override
  1091 + @Transactional
  1092 + public AjaxResult createEmptyIn(String containerCode, String destinationLocation) {
  1093 + //校验托盘和目标地址
  1094 + Location temp = new Location();
  1095 + temp.setCode(destinationLocation);
  1096 + temp.setWarehouseId(ShiroUtils.getWarehouseId());
  1097 + Location loc = locationService.selectFirstEntity(temp);
  1098 + if(loc==null){
  1099 + return AjaxResult.error("目标货位不存在");
  1100 + }
  1101 + if(StringUtils.isNotEmpty(loc.getContainerCode())){
  1102 + return AjaxResult.error("目标货位已存在托盘");
  1103 + }
  1104 + if(!loc.getStatus().equals("empty")){
  1105 + return AjaxResult.error("目标货位非空闲");
  1106 + }
  1107 + Container temp3 = new Container();
  1108 + temp3.setCode(containerCode);
  1109 + temp3.setWarehouseId(ShiroUtils.getWarehouseId());
  1110 + Container container = containerService.selectFirstEntity(temp3);
  1111 + if(container==null){
  1112 + return AjaxResult.error("托盘不存在");
  1113 + }
  1114 + Location temp2 = new Location();
  1115 + temp2.setContainerCode(containerCode);
  1116 + temp2.setWarehouseId(ShiroUtils.getWarehouseId());
  1117 + List<Location> locList = locationService.selectListEntityByEqual(temp2);
  1118 + if(locList.size()>0){
  1119 + return AjaxResult.error("托盘已在库位中存在");
  1120 + }
  1121 + //创建任务
  1122 + Task task = new Task();
  1123 + task.setWarehouseId(ShiroUtils.getWarehouseId());
  1124 + task.setWarehouseCode(ShiroUtils.getWarehouseCode());
  1125 + //这里默认一个0
  1126 + task.setPriority(0);
  1127 + task.setType(500);
  1128 + task.setStation(1);
  1129 + task.setContainerCode(containerCode);
  1130 + task.setFirstStatus((short)0);
  1131 + task.setLastStatus((short)0);
  1132 +// task.setSourceLocation(loc.getCode());
  1133 + task.setDestinationLocation(loc.getCode());
  1134 + task.setCreated(new Date());
  1135 + task.setCreatedBy(ShiroUtils.getLoginName());
  1136 + insert(task);
  1137 + //更新货位状态
  1138 + loc.setStatus("lock");
  1139 + locationService.updateByModel(loc);
  1140 + return AjaxResult.success("成功");
  1141 + }
  1142 +
  1143 + @Override
  1144 + public AjaxResult createEmptyOut(String containerCode, String sourceLocation) {
  1145 + Location temp = new Location();
  1146 + temp.setCode(sourceLocation);
  1147 + temp.setWarehouseId(ShiroUtils.getWarehouseId());
  1148 + Location loc = locationService.selectFirstEntity(temp);
  1149 + if(loc==null){
  1150 + return AjaxResult.error("源货位不存在");
  1151 + }
  1152 + if(StringUtils.isEmpty(loc.getContainerCode())){
  1153 + return AjaxResult.error("源货位没有托盘");
  1154 + }
  1155 + if(!loc.getStatus().equals("empty")){
  1156 + return AjaxResult.error("源货位非空闲");
  1157 + }
  1158 +
  1159 + Container temp3 = new Container();
  1160 + temp3.setCode(containerCode);
  1161 + temp3.setWarehouseId(ShiroUtils.getWarehouseId());
  1162 + Container container = containerService.selectFirstEntity(temp3);
  1163 + if(container==null){
  1164 + return AjaxResult.error("托盘不存在");
  1165 + }
  1166 + //创建任务
  1167 + Task task = new Task();
  1168 + task.setWarehouseId(ShiroUtils.getWarehouseId());
  1169 + task.setWarehouseCode(ShiroUtils.getWarehouseCode());
  1170 + //这里默认一个0
  1171 + task.setPriority(0);
  1172 + task.setType(600);
  1173 + task.setStation(1);
  1174 + task.setContainerCode(containerCode);
  1175 + task.setFirstStatus((short)0);
  1176 + task.setLastStatus((short)0);
  1177 + task.setSourceLocation(loc.getCode());
  1178 +// task.setDestinationLocation(loc.getCode());
  1179 + task.setCreated(new Date());
  1180 + task.setCreatedBy(ShiroUtils.getLoginName());
  1181 + insert(task);
  1182 + //更新货位状态
  1183 + loc.setStatus("lock");
  1184 + locationService.updateByModel(loc);
  1185 + return AjaxResult.success("成功");
  1186 + }
1030 1187 }
... ...
src/main/resources/mybatis/general/LocationMapper.xml
... ... @@ -3,6 +3,25 @@
3 3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 5 <mapper namespace="com.huaheng.pc.general.location.mapper.LocationMapper">
6   -
7   -
  6 +
  7 +
  8 + <select id="getEmptyContainerInLocation" resultType="com.huaheng.pc.general.location.domain.Location">
  9 + SELECT * FROM location t
  10 + <where>
  11 + t.warehouseId = #{warehouseId} AND t.containerCode !='' AND t.containerCode is not NULL
  12 + AND t.`code` NOT in (SELECT b.locationCode FROM inventory b WHERE b.warehouseId = #{warehouseId} )
  13 + <if test="containerCode != null and containerCode !=''">
  14 + <bind name="temp1" value="'%' + containerCode + '%'" />
  15 + and t.containerCode like #{temp1}
  16 + </if>
  17 + <if test="locationCode != null and locationCode !=''">
  18 + <bind name="temp2" value="'%' + locationCode + '%'" />
  19 + and t.`code` like #{temp2}
  20 + </if>
  21 + </where>
  22 +
  23 +
  24 +
  25 +
  26 + </select>
8 27 </mapper>
9 28 \ No newline at end of file
... ...
src/main/resources/mybatis/inventory/InventoryMapper.xml
... ... @@ -85,4 +85,11 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
85 85 </where>
86 86 GROUP BY materialCode
87 87 </select>
  88 + <select id="getUncompleteReceiptContainer" resultType="java.lang.Integer">
  89 + SELECT count(*) from receipt_container_header WHERE locationCode = #{locationCode} and `status`&lt;40 and warehouseId = #{warehouseId}
  90 + </select>
  91 + <select id="getUncompleteShipmentContainer" resultType="java.lang.Integer">
  92 + SELECT * from shipment_container_header t join location b ON t.warehouseId = b.warehouseId and t.shipmentContainerCode = b.containerCode
  93 + WHERE b.`code` = #{locationCode} AND t.`status`&lt;20 and t.warehouseId = #{warehouseId}
  94 + </select>
88 95 </mapper>
89 96 \ No newline at end of file
... ...
src/main/resources/templates/shipment/shipmentHeader/add.html
... ... @@ -180,7 +180,7 @@
180 180 $(function () {
181 181 layui.use('laydate', function() {
182 182 var laydate = layui.laydate;
183   - laydate.render({ elem: '#appointmentTime', theme: 'molv' });
  183 + laydate.render({ elem: '#appointmentTime', theme: 'molv' ,type: 'datetime'});
184 184 });
185 185 })
186 186 </script>
... ...
src/main/resources/templates/shipment/shipmentHeader/edit.html
... ... @@ -242,7 +242,7 @@
242 242 $(function () {
243 243 layui.use('laydate', function() {
244 244 var laydate = layui.laydate;
245   - laydate.render({ elem: '#appointmentTime', theme: 'molv' });
  245 + laydate.render({ elem: '#appointmentTime', theme: 'molv' ,type: 'datetime'});
246 246 });
247 247 })
248 248 </script>
... ...
src/main/resources/templates/task/task/emptyContainer.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="gray-bg">
  6 +<div class="container-div">
  7 + <row>
  8 + <div class="col-sm-12 select-info">
  9 + <form id="location-form">
  10 + <div class="select-list">
  11 + <ul>
  12 + <li>
  13 + 容器编码:<input type="text" name="containerCode"/>
  14 + </li>
  15 + <li>
  16 + 库位编码:<input type="text" name="locationCode"/>
  17 + </li>
  18 + <li>
  19 + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  20 + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="general:location:export"><i class="fa fa-download"></i>&nbsp;导出</a>-->
  21 + </li>
  22 + </ul>
  23 + </div>
  24 + </form>
  25 + </div>
  26 +
  27 + <div class="col-sm-12 select-info">
  28 + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
  29 + </div>
  30 + </row>
  31 +</div>
  32 +<div th:include="include :: footer"></div>
  33 +<script th:inline="javascript">
  34 + var prefix = ctx + "task/task";
  35 + var editFlag = [[${@permission.hasPermi('general:location:edit')}]];
  36 + var removeFlag = [[${@permission.hasPermi('general:location:remove')}]];
  37 + var datas = [[${@dict.getType('sys_normal_disable')}]];
  38 + var locationTypes = [[${@locationType.getLocationPrefix()}]];
  39 + var locationStatus = [[${@dict.getType('locationStatus')}]];
  40 +
  41 + $(function() {
  42 + var options = {
  43 + url: prefix + "/listEmptyContainer",
  44 + createUrl: prefix + "/add",
  45 + updateUrl: prefix + "/edit/{id}",
  46 + removeUrl: prefix + "/remove",
  47 + modalName: "库位",
  48 + search: false,
  49 + columns: [
  50 + {
  51 + title: '操作',
  52 + align: 'center',
  53 + formatter: function(value, row, index) {
  54 + var actions = [];
  55 + actions.push('<a class="btn btn-success btn-xs" href="#" onclick="select(\'' + row.containerCode + '\',\''+row.code+'\',\''+row.status+'\')"><i class="fa fa-edit"></i>选取</a> ');
  56 + // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
  57 + return actions.join('');
  58 + }
  59 + },
  60 + {
  61 + field : 'id',
  62 + title : 'ID'
  63 + },
  64 + {
  65 + field : 'code',
  66 + title : '库位'
  67 + },
  68 + // {
  69 + // field : 'warehouseId',
  70 + // title : '仓库Id'
  71 + // },
  72 + // {
  73 + // field : 'warehouseCode',
  74 + // title : '仓库编码'
  75 + // },
  76 + {
  77 + field : 'row',
  78 + title : '行'
  79 + },
  80 + {
  81 + field : 'line',
  82 + title : '列'
  83 + },
  84 + {
  85 + field : 'layer',
  86 + title : '层'
  87 + },
  88 + {
  89 + field : 'grid',
  90 + title : '格'
  91 + },
  92 + {
  93 + field : 'type',
  94 + title : '库位类型' ,
  95 + align: 'center',
  96 + formatter: function(value, row, index) {
  97 + return $.table.selectPrefixToName(locationTypes, value);
  98 + }
  99 + },
  100 + // {
  101 + // field : 'containerId',
  102 + // title : '容器id号' ,
  103 + // visible:false
  104 + // },
  105 + {
  106 + field : 'containerCode',
  107 + title : '容器编码'
  108 + },
  109 + {
  110 + field : 'zoneId',
  111 + title : '区域id' ,
  112 + visible:false
  113 + },
  114 + {
  115 + field : 'zoneCode',
  116 + title : '区域编码'
  117 + },
  118 + {
  119 + field : 'status',
  120 + title : '状态' ,
  121 + align: 'center',
  122 + formatter: function(value, row, index) {
  123 + return $.table.selectDictLabel(locationStatus, value);
  124 + }
  125 + },
  126 + {
  127 + field : 'lastCycleCountDate',
  128 + title : '上次盘点日期' ,
  129 + visible:false
  130 + },
  131 + {
  132 + field : 'created',
  133 + title : '创建时间'
  134 + },
  135 + {
  136 + field : 'createdBy',
  137 + title : '创建用户'
  138 + },
  139 + {
  140 + field : 'lastUpdated',
  141 + title : '创建时间'
  142 + },
  143 + {
  144 + field : 'lastUpdatedBy',
  145 + title : '更新用户'
  146 + },
  147 + {
  148 + field : 'enable',
  149 + title : '是否有效' ,
  150 + align: 'center',
  151 + formatter: function(value, row, index) {
  152 + return $.table.selectDictLabel(datas, value);
  153 + }
  154 + },
  155 + // {
  156 + // field : 'deleted',
  157 + // title : '是否删除'
  158 + // },
  159 + {
  160 + field : 'userDef1',
  161 + title : '自定义字段1' ,
  162 + visible:false
  163 + },
  164 + {
  165 + field : 'userDef2',
  166 + title : '自定义字段2' ,
  167 + visible:false
  168 + },
  169 + {
  170 + field : 'userDef3',
  171 + title : '自定义字段3' ,
  172 + visible:false
  173 + },
  174 + {
  175 + field : 'userDef4',
  176 + title : '自定义字段4' ,
  177 + visible:false
  178 + },
  179 + {
  180 + field : 'userDef5',
  181 + title : '自定义字段5' ,
  182 + visible:false
  183 + }
  184 + ]
  185 + };
  186 + $.table.init(options);
  187 + });
  188 + function select(containerCode,code,status) {
  189 + if(status!="empty"){
  190 + $.modal.alertError("所选库位非空闲");
  191 + return;
  192 + }
  193 + parent.$('#containerCode').val(containerCode);
  194 + parent.$('#sourceLocation').val(code);
  195 + $.modal.close();
  196 + }
  197 +</script>
  198 +</body>
  199 +</html>
0 200 \ No newline at end of file
... ...
src/main/resources/templates/task/task/emptyIn.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-task-emptyIn">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">容器编号:</label>
  10 + <div class="col-sm-8">
  11 + <input id="containerCode" name="containerCode" class="form-control" type="text" >
  12 + </div>
  13 + </div>
  14 + <div class="form-group">
  15 + <label class="col-sm-3 control-label">目的库位:</label>
  16 + <div class="col-sm-8">
  17 + <input id="destinationLocation" name="destinationLocation" class="form-control" type="text" >
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <div class="form-control-static col-sm-offset-9">
  22 + <button type="submit" class="btn btn-primary">提交</button>
  23 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  24 + </div>
  25 + </div>
  26 + </form>
  27 +</div>
  28 +<div th:include="include::footer"></div>
  29 +<script type="text/javascript">
  30 + var prefix = ctx + "task/task"
  31 + $("#form-task-emptyIn").validate({
  32 + rules:{
  33 + containerCode:{
  34 + required:true,
  35 + },
  36 + destinationLocation:{
  37 + required:true,
  38 + },
  39 + },
  40 + submitHandler: function(form) {
  41 + $.operate.save(prefix + "/emptyIn", $('#form-task-emptyIn').serialize());
  42 + }
  43 + });
  44 +</script>
  45 +</body>
  46 +</html>
... ...
src/main/resources/templates/task/task/emptyOut.html 0 → 100644
  1 +<!DOCTYPE HTML>
  2 +<html lang="zh" xmlns:th="http://www.thymeleaf.org">
  3 +<meta charset="utf-8">
  4 +<head th:include="include :: header"></head>
  5 +<body class="white-bg">
  6 +<div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7 + <form class="form-horizontal m" id="form-task-emptyOut">
  8 + <div class="form-group">
  9 + <label class="col-sm-3 control-label">容器编号:</label>
  10 + <div class="col-sm-8">
  11 + <input id="containerCode" name="containerCode" class="form-control" type="text">
  12 + </div>
  13 + </div>
  14 + <div class="form-group">
  15 + <label class="col-sm-3 control-label">源库位:</label>
  16 + <div class="col-sm-8">
  17 + <input id="sourceLocation" name="sourceLocation" class="form-control" type="text">
  18 + </div>
  19 + </div>
  20 + <div class="form-group">
  21 + <div class="form-control-static col-sm-offset-9">
  22 + <button class="btn-success btn" onclick="selectEmptyOut()">选取</button>
  23 + <button type="submit" class="btn btn-primary">提交</button>
  24 + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
  25 + </div>
  26 + </div>
  27 + </form>
  28 +</div>
  29 +<div th:include="include::footer"></div>
  30 +<script type="text/javascript">
  31 + var prefix = ctx + "task/task"
  32 + $("#form-task-emptyOut").validate({
  33 + rules:{
  34 + containerCode:{
  35 + required:true,
  36 + },
  37 + sourceLocation:{
  38 + required:true,
  39 + },
  40 + },
  41 + submitHandler: function(form) {
  42 + $.operate.save(prefix + "/emptyOut", $('#form-task-emptyOut').serialize());
  43 + }
  44 + });
  45 +
  46 + function selectEmptyOut() {
  47 + $.modal.open("空托盘选取",prefix+"/listEmpty");
  48 + }
  49 +</script>
  50 +</body>
  51 +</html>
... ...
src/main/resources/templates/task/task/task.html
... ... @@ -436,11 +436,11 @@
436 436 }
437 437  
438 438 function emptyIn() {
439   -
  439 + $.modal.open("空托盘入库",prefix+"/emptyIn")
440 440 }
441 441  
442 442 function emptyOut() {
443   -
  443 + $.modal.open("空托盘出库",prefix+"/emptyOut")
444 444 }
445 445  
446 446 function seeOut() {
... ...