diff --git a/src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java b/src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java index a0acd74..d41fe04 100644 --- a/src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java +++ b/src/main/java/com/huaheng/pc/check/checkDetail/controller/CheckDetailController.java @@ -130,15 +130,6 @@ public class CheckDetailController extends BaseController { } /** - * 完成质检 - */ - @GetMapping("complete/{id}") - public String complete(@PathVariable("id") Integer id, ModelMap mmap) { - mmap.put("checkDetailId", id); - return prefix + "/checkComplete"; - } - - /** * 保存质检完成 * @param inventorySts 库存状态 * @param qty 数量 @@ -149,9 +140,7 @@ public class CheckDetailController extends BaseController { @Log(title = "质检-质检详情 ",operating = "质检详情删除", action = BusinessType.DELETE) @PostMapping("/complete") @ResponseBody - public AjaxResult complete(@ApiParam(name="质检明细id",value="id")Integer id, - @ApiParam(name="库存状态",value="inventorySts",example="good,bad")String inventorySts, - @ApiParam(name = "数量",value = "qty",example = "10,20") String qty) { - return checkDetailService.complete(id, inventorySts, qty); + public AjaxResult complete(@ApiParam(name="质检明细id",value="id")Integer id) { + return checkDetailService.complete(id); } } diff --git a/src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java b/src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java index c9c9eb3..e0515c1 100644 --- a/src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java +++ b/src/main/java/com/huaheng/pc/check/checkDetail/service/CheckDetailService.java @@ -26,77 +26,58 @@ import org.springframework.transaction.annotation.Transactional; public class CheckDetailService extends ServiceImpl<CheckDetailMapper, CheckDetail> { @Resource - private CheckingRegisterService checkingRegisterService; - @Resource private CheckHeaderService checkHeaderService; + @Resource + private CheckingRegisterService checkingRegisterService; /** * 质检完成 * @param id 质检明细id - * @param inventorySts 库存状态 good, - * @param qty 数量 10,20 * @return AjaxResult */ @Transactional - public AjaxResult complete(Integer id, String inventorySts, String qty){ + public AjaxResult complete(Integer id){ + LambdaQueryWrapper<CheckingRegister> checkingRegisterLambda = Wrappers.lambdaQuery(); + checkingRegisterLambda.eq(CheckingRegister::getCheckDetailId, id); + List<CheckingRegister> checkingRegisters = checkingRegisterService.list(checkingRegisterLambda); + int total = 0; //质检登记中的总数量 + for (CheckingRegister checkingRegister: checkingRegisters){ + total += checkingRegister.getQty(); + } - //将库存状态、数量字符串转为List - List<String> inventoryStsList = Arrays.asList(Convert.toStrArray(inventorySts)); - List<Integer> qtyList = Arrays.asList(Convert.toIntArray(qty)); + //更新传入明细id为完成质检状态 CheckDetail checkDetail = this.getById(id); - - // - int sum = 0; - for (Integer quantity : qtyList) { - sum += quantity; - } - if (checkDetail.getQty() == sum) { - AjaxResult.error("质检登记数量和质检明细系统数量核对错误"); + if ( !(total == checkDetail.getQty())){ + return AjaxResult.error("质检登记中总数量不等于质检明细中数量,不能完成质检"); } + checkDetail.setCheckBy(ShiroUtils.getLoginName()); + checkDetail.setCheckAt(new Date()); + checkDetail.setStatus("20"); - if ( !this.updateById(checkDetail)){ - throw new ServiceException("更新质检明细表错误"); + checkDetail.setLastUpdated(new Date()); + checkDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); + if (!this.updateById(checkDetail)){ + throw new ServiceException("更新质检明细表失败"); } - CheckingRegister checkingRegister = new CheckingRegister(); - checkingRegister.setCheckDetailId(checkDetail.getId()); - checkingRegister.setCheckHeaderId(checkDetail.getCheckHeaderId()); - checkingRegister.setWarehouseCode(ShiroUtils.getWarehouseCode()); - checkingRegister.setCheckCode(checkDetail.getCheckCode()); - checkingRegister.setReceiptDetailId(checkDetail.getReceiptDetailId()); - checkingRegister.setReceiptCode(checkDetail.getReceiptCode()); - checkingRegister.setReferCode(checkDetail.getReferCode()); - checkingRegister.setReferLineId(checkDetail.getReferLineId()); - checkingRegister.setReferPlatform(checkDetail.getReferPlatform()); - checkingRegister.setMaterialCode(checkDetail.getMaterialCode()); - checkingRegister.setMaterialName(checkDetail.getMaterialName()); - checkingRegister.setMaterialSpec(checkDetail.getMaterialSpec()); - checkingRegister.setMaterialUnit(checkDetail.getMaterialUnit()); - checkingRegister.setCompanyCode(checkDetail.getCompanyCode()); - checkingRegister.setCheckBy(ShiroUtils.getLoginName()); - checkingRegister.setCheckAt(new Date()); - checkingRegister.setCreatedBy(ShiroUtils.getLoginName()); - checkingRegister.setLastUpdatedBy(ShiroUtils.getLoginName()); + LambdaQueryWrapper<CheckDetail> lambda = Wrappers.lambdaQuery(); + lambda.eq(CheckDetail::getCheckHeaderId, checkDetail.getCheckHeaderId()); + List<CheckDetail> checkDetails = this.list(lambda); - for (int i = 0; i<inventoryStsList.size(); i++){ - checkingRegister.setInventorySts(inventoryStsList.get(i)); - checkingRegister.setQty(qtyList.get(0)); - if ( !checkingRegisterService.save(checkingRegister)){ - throw new ServiceException("生成质检报告失败"); + //判断头表下所有明细是否全部完成 + boolean result = false; + for (CheckDetail checkDetail1 : checkDetails){ + if ("20".equals(checkDetail1.getStatus())){ + result = true; + } else { + result = false; } } - - LambdaQueryWrapper<CheckDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); - lambdaQueryWrapper.eq(CheckDetail::getCheckHeaderId, checkDetail.getCheckHeaderId()) - .ne(CheckDetail::getStatus, 20); - List<CheckDetail> checkDetails = this.list(lambdaQueryWrapper); - - //如果改质检单的全部明细都完成质检则更新质检头表状态 - if (checkDetails == null){ + if (result){ CheckHeader checkHeader = new CheckHeader(); checkHeader.setId(checkDetail.getCheckHeaderId()); - checkHeader.setStatus("20"); - if (!checkHeaderService.updateById(checkHeader)){ - throw new ServiceException("更新质检头表发生错误"); + checkHeader.setStatus("30"); + if ( !checkHeaderService.updateById(checkHeader)){ + throw new ServiceException("质检头表更新失败"); } } return AjaxResult.success("质检完成"); diff --git a/src/main/java/com/huaheng/pc/config/FilterConfigDetail/domain/FilterConfigDetail.java b/src/main/java/com/huaheng/pc/config/FilterConfigDetail/domain/FilterConfigDetail.java index 4831b61..a37b6fa 100644 --- a/src/main/java/com/huaheng/pc/config/FilterConfigDetail/domain/FilterConfigDetail.java +++ b/src/main/java/com/huaheng/pc/config/FilterConfigDetail/domain/FilterConfigDetail.java @@ -78,6 +78,10 @@ public class FilterConfigDetail implements Serializable { @ApiModelProperty(value="全SQL") private String statement; + @TableField(value = "sqll") + @ApiModelProperty(value="后续分组排序") + private String sqll; + /** * 是否系统创建 */ diff --git a/src/main/java/com/huaheng/pc/config/waveMaster/domain/WaveMaster.java b/src/main/java/com/huaheng/pc/config/waveMaster/domain/WaveMaster.java index e77de7f..83ff3b0 100644 --- a/src/main/java/com/huaheng/pc/config/waveMaster/domain/WaveMaster.java +++ b/src/main/java/com/huaheng/pc/config/waveMaster/domain/WaveMaster.java @@ -23,13 +23,20 @@ public class WaveMaster implements Serializable { private Integer id; /** - * 主表名称 + * 主表编码 */ @TableField(value = "code") - @ApiModelProperty(value="主表名称") + @ApiModelProperty(value="主表编码") private String code; /** + * 主表名称 + */ + @TableField(value = "name") + @ApiModelProperty(value="主表名称") + private String name; + + /** * 仓库编码 */ @TableField(value = "warehouseCode") diff --git a/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java index cb273b8..9e75c9e 100644 --- a/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/inventory/adjustHeader/service/AdjustHeaderServiceImpl.java @@ -32,11 +32,11 @@ public class AdjustHeaderServiceImpl extends ServiceImpl<AdjustHeaderMapper, Adj if (maxCode != null && maxCode.substring(maxCode.length() - 13, maxCode.length() - 5).equals(df.format(now))) { Integer Count = Integer.valueOf(maxCode.substring(maxCode.length() - 5, maxCode.length())); - code = "CY" + df.format(now) + String.format("%05d", Count + 1); + code = "AD" + df.format(now) + String.format("%05d", Count + 1); } else { - code = "CY" + df.format(now) + "00001"; + code = "AD" + df.format(now) + "00001"; } return code; } diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java index 4675cf5..ea2e37d 100644 --- a/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/inventory/cycleCountDetail/service/CycleCountDetailServiceImpl.java @@ -349,7 +349,7 @@ public class CycleCountDetailServiceImpl extends ServiceImpl<CycleCountDetailMap if(cyclecountDetail.getEnableStatus() == 100){ return AjaxResult.error("盘点任务完成后不能再登记数量!"); } - if(cycleCountHeader==null){ + if(cycleCountHeader == null){ return AjaxResult.error("主单据不存在"); } /*if(cyclecountDetail.getEnableStatus() == 10){ diff --git a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java index 14c9914..91fc8f0 100644 --- a/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/inventory/cycleCountHeader/service/CycleCountHeaderServiceImpl.java @@ -178,7 +178,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap AdjustHeader adjustHeader = new AdjustHeader(); adjustHeader.setWarehouseCode(ShiroUtils.getWarehouseCode());//仓库 adjustHeader.setCode(adjustHeaderService.createCode());//生成差异单号 - adjustHeader.setProblemType("盘点调整"); + adjustHeader.setProblemType("cyclecountAdjust"); adjustHeader.setCycleCountCode(cyclecountHeader.getCode()); adjustHeader.setCompanyCode(cyclecountHeader.getCompanyCode()); adjustHeader.setCreated(new Date()); @@ -199,6 +199,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap AdjustDetail adjustDetail = new AdjustDetail(); for(CycleCountDetail item:cycleCountDetailList){ //BigDecimal的比较 .compareTo(BigDecimal.ZERO) != 0 + if(item.getGapQty().compareTo(BigDecimal.ZERO) != 0){ //比较差异数量不为0的就生成差异单 adjustDetail.setAdjustCode(adjustHeader.getCode()); @@ -212,7 +213,7 @@ public class CycleCountHeaderServiceImpl extends ServiceImpl<CycleCountHeaderMap adjustDetail.setMaterialSpec(item.getMaterialSpec()); adjustDetail.setMaterialUnit(item.getMaterialUnit()); adjustDetail.setCycleDetailId(item.getId()); - adjustDetail.setProblemType("盘点调整"); + adjustDetail.setProblemType("cyclecountAdjust"); adjustDetail.setToInventorySts(item.getInventorySts());//盘点不涉及属性 adjustDetail.setFromInventorySts(item.getInventorySts()); adjustDetail.setFromQty(item.getSystemQty());//调整前数量 diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java index 6368a48..a8c9a78 100644 --- a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java +++ b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailService.java @@ -14,7 +14,7 @@ public interface InventoryDetailService extends IService<InventoryDetail> { void detailcreateCheckOutTask (Integer id); - List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail); + List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail,String sqll); AjaxResult detailCheckTask (Integer[] ids) throws InvocationTargetException, IllegalAccessException; diff --git a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java index 33e4755..65504f1 100644 --- a/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/inventory/inventoryDetail/service/InventoryDetailServiceImpl.java @@ -128,11 +128,18 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe } @Override - public List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail) { - sql=sql+" \n" +"and warehouseCode='" + shipmentDetail.getWarehouseCode()+"' \n" + - "and companyCode='" + shipmentDetail.getCompanyCode()+"' \n" + - "and materialCode='" + shipmentDetail.getMaterialCode() +"' \n" + - "and inventorySts='" + shipmentDetail.getInventorySts() + "'"; + public List<InventoryDetail> selectBysql(String sql, ShipmentDetail shipmentDetail,String sqll) { + if(StringUtils.isEmpty(sqll)) { + sql = sql + " \n" + "and warehouseCode='" + shipmentDetail.getWarehouseCode() + "' \n" + + "and companyCode='" + shipmentDetail.getCompanyCode() + "' \n" + + "and materialCode='" + shipmentDetail.getMaterialCode() + "' \n" + + "and inventorySts='" + shipmentDetail.getInventorySts() + "'"; + }else { + sql = sql + " \n" + "and warehouseCode='" + shipmentDetail.getWarehouseCode() + "' \n" + + "and companyCode='" + shipmentDetail.getCompanyCode() + "' \n" + + "and materialCode='" + shipmentDetail.getMaterialCode() + "' \n" + + "and inventorySts='" + shipmentDetail.getInventorySts() + "'"+ " \n" +sqll; + } return inventoryDetailMapper.selectBysql(sql); } diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java index 6357164..e078a89 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/controller/ReceiptContainerDetailController.java @@ -74,6 +74,7 @@ public class ReceiptContainerDetailController extends BaseController { @RequiresPermissions("receipt:receiptContainerDetail:remove") @Log(title = "入库-入库详情列表", operating = "入库详情列表", action = BusinessType.GRANT) @PostMapping("remove") + @ResponseBody public AjaxResult remove(String ids) { if (StringUtils.isEmpty(ids)){ return AjaxResult.error("id不能为空"); diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java index 5af580f..449f7ac 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/domain/ReceiptContainerDetail.java @@ -65,6 +65,13 @@ public class ReceiptContainerDetail implements Serializable { private String receiptType; /** + * 库位编码 + */ + @TableField(value = "locationCode") + @ApiModelProperty(value="库位编码") + private String locationCode; + + /** * 货箱号 */ @TableField(value = "containerCode") diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java index 814dfed..3262e09 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerDetail/service/ReceiptContainerDetailServiceImpl.java @@ -8,11 +8,14 @@ import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; import com.huaheng.pc.receipt.receiptContainerDetail.mapper.ReceiptContainerDetailMapper; +import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; +import com.huaheng.pc.receipt.receiptContainerHeader.service.ReceiptContainerHeaderService; import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; import org.springframework.stereotype.Service; +import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.List; @@ -24,6 +27,8 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai private ReceiptDetailService receiptDetailService; @Resource private ReceiptHeaderService receiptHeaderService; + @Resource + private ReceiptContainerHeaderService receiptContainerHeaderService; /** * 根据入库单编码查询入库组盘明细 * @param receiptCode 入库单编码 @@ -53,8 +58,18 @@ public class ReceiptContainerDetailServiceImpl extends ServiceImpl<ReceiptContai //回滚入库单明细收货数量 ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); receiptDetail.setOpenQty(receiptDetail.getOpenQty() - receiptContainerDetail.getQty()); - if (!receiptDetailService.updateById(receiptDetail)){throw new SecurityException("回滚入库单明细失败");} + if (!receiptDetailService.updateById(receiptDetail)){throw new SecurityException("回滚入库单明细失败");} + //删除组盘明细 + if (!this.removeById(id)){ throw new ServiceException("回滚入库组盘失败");} + LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerDetail.getReceiptContainerId()); + List<ReceiptContainerDetail> list = this.list(lambdaQueryWrapper); + if (list.size() == 0){ + if (!receiptContainerHeaderService.removeById(receiptContainerDetail.getReceiptContainerId())){ + throw new ServiceException("删除入库组盘头失败"); + } + } //查询入库头表 LambdaQueryWrapper<ReceiptContainerDetail> containerDetailLambda = Wrappers.lambdaQuery(); containerDetailLambda.eq(ReceiptContainerDetail::getReceiptId, receiptContainerDetail.getReceiptId()); diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java index 978c8d3..820e4bd 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/controller/ReceiptContainerHeaderController.java @@ -158,6 +158,28 @@ public class ReceiptContainerHeaderController extends BaseController { for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails) receivingService.position(receiptContainerDetail); } - return AjaxResult.success(""); + return AjaxResult.success("定位成功"); + } + + /** + * 取消定位 + */ + @RequiresPermissions("receipt:receiptContainer:canalPosition") + @Log(title = "入库-取消定位", operating = "取消定位", action = BusinessType.OTHER) + @PostMapping( "/cancelPosition") + @ResponseBody + public AjaxResult cancelPosition(String ids){ + if (StringUtils.isEmpty(ids)){ + return AjaxResult.error("id不能为空"); + } + List<Integer> idList = Arrays.asList(Convert.toIntArray(ids)); + for (int i = 0; i<idList.size(); i++){ + LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); + lambda.eq(ReceiptContainerDetail::getReceiptContainerId, idList.get(i)); + List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda); + for (ReceiptContainerDetail receiptContainerDetail : receiptContainerDetails) + receivingService.cancelPosition(receiptContainerDetail); + } + return AjaxResult.success("取消定位成功"); } } diff --git a/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java index 993c1ef..b002102 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptContainerHeader/service/ReceiptContainerHeaderServiceImpl.java @@ -113,7 +113,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai receiptDetail = receiptDetailService.getById(receiptDetailId); - receiptContainerDetailAdd(receiptContainerHeaders.get(0).getId(), receiptDetail, qty, containerCode); + receiptContainerDetailAdd(receiptContainerHeaders.get(0).getId(), receiptDetail, qty, containerCode, locationCode); //如果单据数量等于已收数量,更新入库详情状态和入库单状态 if (receiptDetail.getTotalQty() == receiptDetail.getOpenQty()){ ReceiptDetail receiptDetail1 = receiptDetailService.queryflow(receiptDetail); @@ -285,7 +285,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai * @param containerCode 容器编码 */ @Transactional - public void receiptContainerDetailAdd(Integer receiptContainerHeaderId, ReceiptDetail receiptDetail, Integer qty, String containerCode){ + public void receiptContainerDetailAdd(Integer receiptContainerHeaderId, ReceiptDetail receiptDetail, Integer qty, String containerCode, String locationCode){ LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); lambda.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeaderId) .eq(ReceiptContainerDetail::getReceiptId, receiptDetail.getReceiptId()) @@ -312,6 +312,7 @@ public class ReceiptContainerHeaderServiceImpl extends ServiceImpl<ReceiptContai receiptContainerDetail.setReceiptDetailId(receiptDetail.getId()); receiptContainerDetail.setReceiptCode(receiptDetail.getReceiptCode()); receiptContainerDetail.setReceiptType(receiptHeader.getReceiptType()); + receiptContainerDetail.setLocationCode(locationCode); receiptContainerDetail.setContainerCode(container.getCode()); receiptContainerDetail.setContainerType(container.getContainerType()); receiptContainerDetail.setCompanyCode(receiptDetail.getCompanyCode()); diff --git a/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java b/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java index f39e1a8..df3089e 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java @@ -253,7 +253,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R } } - //从数据子典中获取单据当前状态 + //从数据字典中获取单据当前状态 List<DictData> dictData = dictDataService.selectDictDataByType("receiptHeaderStatus"); for (int i = 0; i<dictData.size(); i++){ if (dictData.get(i).getDictValue().equals(minStatus)){ diff --git a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java index cf4b88a..ded8ef7 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptHeader/controller/ReceiptHeaderController.java @@ -281,7 +281,10 @@ public class ReceiptHeaderController extends BaseController { @Log(title = "入库-入库单 ",operating = "查询入库单 ", action = BusinessType.OTHER) @PostMapping("/getReceiptHeader") @ResponseBody - public AjaxResult<ReceiptHeader> getReceiptHeader(int id) { + public AjaxResult<ReceiptHeader> getReceiptHeader(String id) { + if (StringUtils.isEmpty(id)){ + return AjaxResult.success(""); + } return AjaxResult.success(receiptHeaderService.getById(id)); } } diff --git a/src/main/java/com/huaheng/pc/receipt/receiving/controller/ReceivingController.java b/src/main/java/com/huaheng/pc/receipt/receiving/controller/ReceivingController.java index 88bc4d6..e3242cb 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiving/controller/ReceivingController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiving/controller/ReceivingController.java @@ -41,8 +41,6 @@ public class ReceivingController extends BaseController { @Resource private ReceiptContainerDetailService receiptContainerDetailService; @Resource - private TaskHeaderService taskHeaderService; - @Resource private ReceiptContainerHeaderService receiptContainerHeaderService; @RequiresPermissions("receipt:receiving:view") diff --git a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java index 0a2a83c..6df0890 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java +++ b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java @@ -19,10 +19,12 @@ import com.huaheng.pc.config.materialType.domain.MaterialType; import com.huaheng.pc.config.materialType.service.MaterialTypeService; import com.huaheng.pc.config.receiptPreference.service.ReceiptPreferenceService; import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; +import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; import com.huaheng.pc.receipt.receiptContainerHeader.service.ReceiptContainerHeaderService; import com.huaheng.pc.receipt.receiptDetail.domain.ReceiptDetail; import com.huaheng.pc.receipt.receiptDetail.service.ReceiptDetailService; +import org.aspectj.weaver.loadtime.Aj; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,6 +46,8 @@ public class ReceivingService { @Resource private ReceiptContainerHeaderService receiptContainerHeaderService; @Resource + private ReceiptContainerDetailService receiptContainerDetailService; + @Resource private LocationService locationService; @Resource private MaterialService materialService; @@ -79,9 +83,11 @@ public class ReceivingService { @Transactional public Boolean position(ReceiptContainerDetail receiptContainerDetail){ ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); - + if (!(0 ==receiptContainerHeader.getStatus())){ + throw new ServiceException("该入库组盘已生成任务不能重新定位"); + } //如果入库组盘表中有目标库位说明已经指定 - if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){return true;} + if (StringUtils.isNotEmpty(receiptContainerHeader.getToLocation())){throw new ServiceException("该入库组盘已有库位,不需要定位;如需定位请先取消定位");} String locatingRule = receiptContainerHeader.getLocatingRule(); //定位规则 if (StringUtils.isNotEmpty(locatingRule)){ //入库组盘头表中定位规则不为空时执行 @@ -132,12 +138,21 @@ public class ReceivingService { throw new ServiceException("定位失败,请检查定位规则是否正确"); } + //更新库位编码到组盘头表 receiptContainerHeader.setToLocation(locationCode); - if (!receiptContainerHeaderService.updateById(receiptContainerHeader)){ throw new ServiceException("更新库位失败"); } + //把库位编码赋到该入库组盘头表下的所有明细 + LambdaQueryWrapper<ReceiptContainerDetail> lambda = Wrappers.lambdaQuery(); + lambda.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerHeader.getId()); + List<ReceiptContainerDetail> receiptContainerDetails = receiptContainerDetailService.list(lambda); + for (ReceiptContainerDetail receiptContainerDetail2: receiptContainerDetails) { + receiptContainerDetail2.setLocationCode(locationCode); + if (!receiptContainerDetailService.updateById(receiptContainerDetail2)){throw new ServiceException("更新库位编码到入库组盘明细");} + } + ReceiptDetail receiptDetail = receiptDetailService.queryflow(receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId())); //更新入库单详情状态 if (!receiptDetailService.updateById(receiptDetail)){ throw new ServiceException("更新入库单详情失败");} @@ -146,4 +161,44 @@ public class ReceivingService { return true; } + + /** + * 取消定位 + * @param receiptContainerDetail 入库组盘明细 + * @return + */ + @Transactional + public AjaxResult cancelPosition(ReceiptContainerDetail receiptContainerDetail){ + //查询入库组盘头 + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); + if (!(receiptContainerHeader.getStatus() == 0)){ + throw new ServiceException("组盘已生成任务不能取消定位"); + } + //将入库组盘头表中的而库位编码赋值null + receiptContainerHeader.setToLocation(null); + if (!receiptContainerHeaderService.updateById(receiptContainerHeader)){ + throw new ServiceException("回滚入库组盘头失败"); + } + + LambdaQueryWrapper<ReceiptContainerDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ReceiptContainerDetail::getReceiptContainerId, receiptContainerDetail.getReceiptContainerId()); + List<ReceiptContainerDetail> receiptContainerDetailList = receiptContainerDetailService.list(lambdaQueryWrapper); + for (ReceiptContainerDetail receiptContainerDetail2 : receiptContainerDetailList) { + receiptContainerDetail2.setLocationCode(null); + if (!receiptContainerDetailService.updateById(receiptContainerDetail2)){ + throw new ServiceException("回滚入库组盘明细失败"); + } + } + + //回滚入库明细状态 + ReceiptDetail receiptDetail = receiptDetailService.getById(receiptContainerDetail.getReceiptDetailId()); + receiptDetail.setProcessStamp("240"); + if ( !receiptDetailService.updateById(receiptDetail)){ + throw new ServiceException("回滚入库明细状态失败"); + } + + receiptDetailService.updateReceiptHeaderLastStatus(receiptDetail.getReceiptId()); + + return AjaxResult.success("取消定位成功"); + } } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java index 96d8afd..1f4896f 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailService.java @@ -17,5 +17,8 @@ public interface ShipmentDetailService extends IService<ShipmentDetail>{ Integer countUnCompleted(Integer shipmentId); + //选中的单据加入波次 + void saveWave(String ids,String code); + } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java index 06e3515..fbe805d 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetail/service/ShipmentDetailServiceImpl.java @@ -2,17 +2,25 @@ package com.huaheng.pc.shipment.shipmentDetail.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.exception.service.ServiceException; +import com.huaheng.common.support.Convert; import com.huaheng.common.utils.DataUtils; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.config.material.domain.Material; import com.huaheng.pc.config.material.service.MaterialService; +import com.huaheng.pc.config.waveMaster.domain.WaveMaster; +import com.huaheng.pc.config.waveMaster.service.WaveMasterService; import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; +import com.huaheng.pc.shipment.wave.domain.Wave; +import com.huaheng.pc.shipment.wave.service.WaveService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -31,6 +39,10 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, private MaterialService materialService; @Resource private ShipmentDetailMapper shipmentDetailMapper; + @Autowired + private WaveMasterService waveMasterService; + @Autowired + private WaveService waveService; /** * 新增出库明细 @@ -137,4 +149,93 @@ public class ShipmentDetailServiceImpl extends ServiceImpl<ShipmentDetailMapper, public Integer countUnCompleted(Integer shipmentId) { return shipmentDetailMapper.countUnCompleted(shipmentId); } + + + //选中的单据加入波次 + @Override + @Transactional + public void saveWave(String ids, String code) { + //找到波次主表,看系统是否有此波次 + LambdaQueryWrapper<WaveMaster> lam=Wrappers.lambdaQuery(); + lam.eq(WaveMaster::getCode,code) + .eq(WaveMaster::getWarehouseCode,ShiroUtils.getWarehouseCode()); + WaveMaster waveMaster=waveMasterService.getOne(lam); + if(waveMaster == null){ + throw new ServiceException("系统没有此波次"); + } + + if(Convert.toIntArray(ids).length >waveMaster.getMaxShipments()){ + throw new ServiceException("加入波次的单据数量超过波次的单据限制"); + } + + List<ShipmentDetail> shipmentDetailList=new ArrayList<>(); + BigDecimal qty=new BigDecimal(0); + //检查出库子表是否有处于波次的 + for (Integer id : Convert.toIntArray(ids)) + { + LambdaQueryWrapper<ShipmentDetail> lamDetail=Wrappers.lambdaQuery(); + lamDetail.eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) + .eq(ShipmentDetail::getShipmentId,id); + List<ShipmentDetail> shipmentDetails=this.list(lamDetail); + if(shipmentDetails == null || shipmentDetails.size() == 0){ + throw new ServiceException("系统没有主单id为"+id+"的子单"); + } + + //查看是否有单据处于波次中 + for(ShipmentDetail shipmentDetail : shipmentDetails) { + if (shipmentDetail.getWaveId() != 0) { + throw new ServiceException("主单id为" + id + "子单id为" + shipmentDetail.getId() + "的子单已加入波次,不可再加入波次"); + } + shipmentDetailList.add(shipmentDetail); + qty=qty.add(shipmentDetail.getShipQty()); + } + } + + if(shipmentDetailList.size()>waveMaster.getMaxLines()){ + throw new ServiceException("加入波次的总行数超过波次的行数限制"); + } + + Boolean flag=false; + + //查看波次是否建成未执行 + LambdaQueryWrapper<Wave> waveLam = Wrappers.lambdaQuery(); + waveLam.eq(Wave::getStatus,0) + .eq(Wave::getWaveMode,code) + .eq(Wave::getWarehouseCode,ShiroUtils.getWarehouseCode()); + Wave wave = waveService.getOne(waveLam); + if(wave != null && (wave.getTotalShipments()+Convert.toIntArray(ids).length)<= waveMaster.getMaxShipments() + && (wave.getTotalLines()+shipmentDetailList.size()<= waveMaster.getMaxLines())){ + //修改波次 + wave.setTotalShipments(Convert.toIntArray(ids).length + wave.getTotalShipments()); + wave.setTotalLines(shipmentDetailList.size() + wave.getTotalLines()); + wave.setTotalQty(qty.add(wave.getTotalQty())); + wave.setLastUpdatedBy(ShiroUtils.getLoginName()); + + }else { + //创建波次 + wave.setWarehouseCode(ShiroUtils.getWarehouseCode()); + wave.setMasterCode(code); + wave.setWaveName(waveMaster.getName()); + wave.setStatus(0); + wave.setCurrentWaveStep("0"); + wave.setTotalShipments(Convert.toIntArray(ids).length); + wave.setTotalLines(shipmentDetailList.size()); + wave.setTotalQty(qty); + wave.setCreatedBy(ShiroUtils.getLoginName()); + flag = waveService.save(wave); + if (flag == false) { + throw new ServiceException("波次建立失败"); + } + } + + //修改出库子单 + for(ShipmentDetail shipmentDetail :shipmentDetailList){ + shipmentDetail.setWaveId(wave.getId()); + } + + flag = this.updateBatchById(shipmentDetailList); + if(flag == false){ + throw new ServiceException("出库子单加入波次失败"); + } + } } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java index d460e40..76a300f 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java @@ -15,6 +15,8 @@ import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; +import com.huaheng.pc.config.waveMaster.domain.WaveMaster; +import com.huaheng.pc.config.waveMaster.service.WaveMasterService; import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; @@ -46,6 +48,9 @@ public class ShipmentHeaderController extends BaseController private ShipmentHeaderService shipmentHeaderService; @Autowired private ShipmentDetailService shipmentDetailService; + @Autowired + private WaveMasterService waveMasterService; + @RequiresPermissions("shipment:bill:view") @GetMapping() @@ -225,4 +230,49 @@ public class ShipmentHeaderController extends BaseController // // } + /** + * 加入波次 + */ + @GetMapping("/wave") + public String addZoneCode() + { + return prefix + "/addWave"; + } + + /** + * 查询波次列表 + */ + @RequiresPermissions("shipment:bill:list") + @Log(title = "出库-出库单", operating = "查询库区列表", action = BusinessType.GRANT) + @PostMapping("/waveList") + @ResponseBody + public TableDataInfo waveList() + { + LambdaQueryWrapper<WaveMaster> lam = Wrappers.lambdaQuery(); + lam.eq(WaveMaster::getWarehouseCode,ShiroUtils.getWarehouseCode()); + List<WaveMaster> waveMasters = waveMasterService.list(lam); + return getDataTable(waveMasters); + } + + + + /** + * 波次 + */ + @RequiresPermissions("shipment:bill:wave") + @Log(title = "出库-出库单", operating="波次", action = BusinessType.OTHER) + @PostMapping( "/addWave") + @ResponseBody + @Transactional + public AjaxResult analysis(String ids,String code){ + if (StringUtils.isEmpty(ids)) + throw new ServiceException("id不能为空"); + if(StringUtils.isEmpty(code)){ + throw new ServiceException("波次不能为空"); + } + + shipmentDetailService.saveWave(ids,code); + return AjaxResult.success("加入波次成功"); + } + } diff --git a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java index 9c38262..a603558 100644 --- a/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java +++ b/src/main/java/com/huaheng/pc/shipment/shippingCombination/service/ShippingCombinationService.java @@ -61,7 +61,7 @@ public class ShippingCombinationService { //根据sql查库存 try { - list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); + list = inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail,filterConfigDetail.getSqll()); }catch (Exception e){ throw new ServiceException("sql错误"); } @@ -81,7 +81,7 @@ public class ShippingCombinationService { } //根据sql查库存 - list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail,filterConfigDetail.getSqll()); return list; } @@ -110,7 +110,7 @@ public class ShippingCombinationService { } //根据sql查库存 - list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail); + list=inventoryDetailService.selectBysql(filterConfigDetail.getStatement(),shipmentDetail,filterConfigDetail.getSqll()); return list; } diff --git a/src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java b/src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java index ee9f2c6..306f83c 100644 --- a/src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java +++ b/src/main/java/com/huaheng/pc/shipment/wave/controller/WaveController.java @@ -15,6 +15,8 @@ import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; +import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; import com.huaheng.pc.shipment.wave.domain.Wave; import com.huaheng.pc.shipment.wave.service.WaveService; import io.swagger.annotations.Api; @@ -43,6 +45,8 @@ public class WaveController extends BaseController { @Autowired private WaveService waveService; + @Autowired + private ShipmentDetailService shipmentDetailService; @RequiresPermissions("shipment:wave:view") @GetMapping() @@ -86,48 +90,48 @@ public class WaveController extends BaseController { } } - /** - * 新增波次 - */ - @GetMapping("/add") - public String add() { - return prefix + "/add"; - } - - /** - * 新增波次 - */ - @RequiresPermissions("shipment:wave:add") - @Log(title = "出库-波次", operating = "新增波次", action = BusinessType.INSERT) - @PostMapping("/add") - @ResponseBody - public AjaxResult addSave(Wave wave){ - wave.setWarehouseCode(ShiroUtils.getWarehouseCode()); - wave.setCreatedBy(ShiroUtils.getLoginName()); - wave.setLastUpdatedBy(ShiroUtils.getLoginName()); - return toAjax(waveService.save(wave)); - } - - /** - * 修改波次 - */ - @GetMapping("/edit/{id}") - public String edit(@PathVariable("id") Integer id, ModelMap mmap) { - mmap.put("wave", waveService.getById(id)); - return prefix + "/edit"; - } - - /** - * 修改波次 - */ - @RequiresPermissions("shipment:wave:edit") - @Log(title = "出库-波次", operating = "修改波次", action = BusinessType.UPDATE) - @PostMapping("/edit") - @ResponseBody - public AjaxResult editSave(Wave wave) { - wave.setLastUpdatedBy(ShiroUtils.getLoginName()); - return toAjax(waveService.updateById(wave)); - } +// /** +// * 新增波次 +// */ +// @GetMapping("/add") +// public String add() { +// return prefix + "/add"; +// } +// +// /** +// * 新增波次 +// */ +// @RequiresPermissions("shipment:wave:add") +// @Log(title = "出库-波次", operating = "新增波次", action = BusinessType.INSERT) +// @PostMapping("/add") +// @ResponseBody +// public AjaxResult addSave(Wave wave){ +// wave.setWarehouseCode(ShiroUtils.getWarehouseCode()); +// wave.setCreatedBy(ShiroUtils.getLoginName()); +// wave.setLastUpdatedBy(ShiroUtils.getLoginName()); +// return toAjax(waveService.save(wave)); +// } + +// /** +// * 修改波次 +// */ +// @GetMapping("/edit/{id}") +// public String edit(@PathVariable("id") Integer id, ModelMap mmap) { +// mmap.put("wave", waveService.getById(id)); +// return prefix + "/edit"; +// } +// +// /** +// * 修改波次 +// */ +// @RequiresPermissions("shipment:wave:edit") +// @Log(title = "出库-波次", operating = "修改波次", action = BusinessType.UPDATE) +// @PostMapping("/edit") +// @ResponseBody +// public AjaxResult editSave(Wave wave) { +// wave.setLastUpdatedBy(ShiroUtils.getLoginName()); +// return toAjax(waveService.updateById(wave)); +// } /** * 删除波次 @@ -142,10 +146,28 @@ public class WaveController extends BaseController { } List<Integer> list = new ArrayList<>(); for (Integer id : Convert.toIntArray(ids)) { + LambdaQueryWrapper<ShipmentDetail> lam=Wrappers.lambdaQuery(); + lam.eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) + .eq(ShipmentDetail::getWaveId,id); + List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lam); + if(shipmentDetails !=null || shipmentDetails.size()>0){ + return AjaxResult.error("id为"+ id +"的波次不能删除,有单据处于此波次中"); + } list.add(id); } return toAjax(waveService.removeByIds(list)); } + /** + * 开始波次 + */ + @RequiresPermissions("shipment:wave:startWave") + @Log(title = "出库-波次", operating = "开始波次", action = BusinessType.UPDATE) + @PostMapping("/startWave") + @ResponseBody + public AjaxResult editSave(Wave wave) { + wave.setLastUpdatedBy(ShiroUtils.getLoginName()); + return toAjax(waveService.updateById(wave)); + } } diff --git a/src/main/java/com/huaheng/pc/shipment/wave/domain/Wave.java b/src/main/java/com/huaheng/pc/shipment/wave/domain/Wave.java index 9fbebd0..a91ca74 100644 --- a/src/main/java/com/huaheng/pc/shipment/wave/domain/Wave.java +++ b/src/main/java/com/huaheng/pc/shipment/wave/domain/Wave.java @@ -9,6 +9,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; @ApiModel(value="com.huaheng.pc.shipment.wave.domain.Wave") @@ -83,7 +84,7 @@ public class Wave implements Serializable { */ @TableField(value = "totalQty") @ApiModelProperty(value="总数量") - private Integer totalQty; + private BigDecimal totalQty; /** * 波次开始时间 diff --git a/src/main/resources/application-druid.properties b/src/main/resources/application-druid.properties index f46a33f..54782c1 100644 --- a/src/main/resources/application-druid.properties +++ b/src/main/resources/application-druid.properties @@ -2,14 +2,14 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver # \u4E3B\u5E93 -#spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false +spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false #spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/huahengExample?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false -spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8 +#spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms2.0?characterEncoding=utf8&serverTimezone=GMT%2b8 -#spring.datasource.druid.master.username=softhuaheng -#spring.datasource.druid.master.password=HHrobot123. -spring.datasource.druid.master.username=root -spring.datasource.druid.master.password=123456 +spring.datasource.druid.master.username=softhuaheng +spring.datasource.druid.master.password=HHrobot123. +#spring.datasource.druid.master.username=root +#spring.datasource.druid.master.password=123456 # \u4ECE\u5E93 #spring.datasource.druid.slave.open = true #spring.datasource.druid.slave.url=jdbc:mysql://172.16.29.45:3306/huaheng?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false diff --git a/src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml b/src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml index 29ee3ad..6b0fb85 100644 --- a/src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml +++ b/src/main/resources/mybatis/receipt/ReceiptContainerDetailMapper.xml @@ -8,6 +8,7 @@ <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> <result column="receiptId" jdbcType="INTEGER" property="receiptId" /> <result column="receiptDetailId" jdbcType="INTEGER" property="receiptDetailId" /> + <result column="locationCode" jdbcType="VARCHAR" property="locationCode" /> <result column="receiptCode" jdbcType="VARCHAR" property="receiptCode" /> <result column="receiptType" jdbcType="VARCHAR" property="receiptType" /> <result column="containerCode" jdbcType="VARCHAR" property="containerCode" /> @@ -53,7 +54,7 @@ </resultMap> <sql id="Base_Column_List"> <!--@mbg.generated--> - id, receiptContainerId, warehouseCode, receiptId, receiptDetailId, receiptCode, receiptType, + id, receiptContainerId, warehouseCode, receiptId, receiptDetailId,locationCode , receiptCode, receiptType, containerCode, containerType, companyCode, materialCode, materialName, materialSpec, materialUnit, qty, `status`, attributeId, attribute1, attribute2, attribute3, attribute4, supplierCode, batch, lot, projectNo, weight, manufactureDate, expirationDate, agingDate, diff --git a/src/main/resources/static/huaheng/js/common.js b/src/main/resources/static/huaheng/js/common.js index eb275a9..6621886 100644 --- a/src/main/resources/static/huaheng/js/common.js +++ b/src/main/resources/static/huaheng/js/common.js @@ -21,8 +21,10 @@ $(function(){ if ($(".time").length > 0) { layui.use('laydate', function() { var laydate = layui.laydate; - laydate.render({ elem: '#startTime', theme: 'molv' }); - laydate.render({ elem: '#endTime', theme: 'molv' }); + var day1 = new Date(); + day1.setTime(day1.getTime()-24*60*60*1000*7); + laydate.render({ elem: '#startTime', theme: 'molv',value: new Date(day1), isInitValue: true}); + laydate.render({ elem: '#endTime', theme: 'molv',value: new Date(), isInitValue: true }); }); } }); diff --git a/src/main/resources/templates/check/checkHeader/checkHeader.html b/src/main/resources/templates/check/checkHeader/checkHeader.html index 80c3231..f11b78a 100644 --- a/src/main/resources/templates/check/checkHeader/checkHeader.html +++ b/src/main/resources/templates/check/checkHeader/checkHeader.html @@ -32,9 +32,9 @@ </li> <li class="time"> <label>创建时间: </label> - <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[createdBegin]"/> + <input type="text" class="time-input" id="startCreatedTime" placeholder="开始时间" name="params[createdBegin]"/> <span>-</span> - <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[createdEnd]"/> + <input type="text" class="time-input" id="endCreatedTime" placeholder="结束时间" name="params[createdEnd]"/> </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> @@ -103,8 +103,8 @@ </div> <div class="btn-group hidden-xs" id="toolbarReg" role="group"> - <a class="btn btn-outline btn-danger btn-rounded" onclick="complete()" shiro:hasPermission="check:checkingRegister:remove"> - <i class="fa fa-trash-o"></i> 质检完成 + <a class="btn btn-outline btn-success btn-rounded" onclick="complete()" shiro:hasPermission="check:checkingRegister:remove"> + <i class="fa fa-check-circle-o"></i> 质检完成 </a> <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="check:checkingRegister:remove"> <i class="fa fa-trash-o"></i> 删除 @@ -259,7 +259,6 @@ //质检明细表格初始化 $("#bootstrap-table1").bootstrapTable({ - url: prefix + "/list", createUrl: prefix1 + "/add", updateUrl: prefix1 + "/edit/{id}", removeUrl: prefix1 + "/remove", @@ -269,7 +268,6 @@ sortOrder: "desc", iconSize: "outline", toolbar: "#toolbar1", - contentType: "application/x-www-form-urlencoded", pagination: true, // 是否显示分页(*) pageNumber: 1, // 初始化加载第一页,默认第一页 pageSize: 50, // 每页的记录行数(*) @@ -282,11 +280,13 @@ }, { field : 'id', - title : 'id' + title : 'id', + visible: false }, { field : 'checkHeaderId', - title : '质检头id' + title : '质检头id', + visible : false }, { field : 'warehouseCode', @@ -299,7 +299,8 @@ }, { field : 'inventoryDetailId', - title : '库存明细标识' + title : '库存明细标识', + visible : false }, { field : 'locationCode', @@ -311,7 +312,8 @@ }, { field : 'receiptDetailId', - title : '入库单明细标识' + title : '入库单明细标识', + visible : false }, { field : 'receiptCode', @@ -402,7 +404,6 @@ }); //质检登记表格初始化 $("#bootstrap-table2").bootstrapTable({ - contentType: "application/x-www-form-urlencoded", editable: true, clickEdit: true, clickToSelect: true, @@ -586,6 +587,7 @@ }); } }); + /* 质检单列表-详细 */ function detail(id, code) { checkId = id; @@ -647,8 +649,23 @@ function complete() { var url = prefix1+"/complete"; + var data = {id: checkDetailId}; $.operate.submit(url, "post", "json", data); } + + layui.use('laydate', function(){ + var laydate = layui.laydate; + var day1 = new Date(); + day1.setTime(day1.getTime()-24*60*60*1000*7); + //执行一个laydate实例 + laydate.render({ + elem: '#startCreatedTime' //指定元素 + ,theme: 'molv',value: new Date(day1), isInitValue: true + }); + laydate.render({ + elem: '#endCreatedTime', theme: 'molv',value: new Date(), isInitValue: true + }) + }); </script> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/config/alarmLevel/alarmLevel.html b/src/main/resources/templates/config/alarmLevel/alarmLevel.html index 4f51db5..2ecac0c 100644 --- a/src/main/resources/templates/config/alarmLevel/alarmLevel.html +++ b/src/main/resources/templates/config/alarmLevel/alarmLevel.html @@ -17,6 +17,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('alarmLevel-form')"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> diff --git a/src/main/resources/templates/config/bomHeader/bomHeader.html b/src/main/resources/templates/config/bomHeader/bomHeader.html index 645a90d..1f39f7a 100644 --- a/src/main/resources/templates/config/bomHeader/bomHeader.html +++ b/src/main/resources/templates/config/bomHeader/bomHeader.html @@ -34,6 +34,7 @@ <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('alarmFlow-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/carrier/carrier.html b/src/main/resources/templates/config/carrier/carrier.html index a4dca63..4a43f39 100644 --- a/src/main/resources/templates/config/carrier/carrier.html +++ b/src/main/resources/templates/config/carrier/carrier.html @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('company-form')"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> diff --git a/src/main/resources/templates/config/company/company.html b/src/main/resources/templates/config/company/company.html index 7b25bc5..b02fb65 100644 --- a/src/main/resources/templates/config/company/company.html +++ b/src/main/resources/templates/config/company/company.html @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('company-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/configValue/add.html b/src/main/resources/templates/config/configValue/add.html index 365a59f..6b612f5 100644 --- a/src/main/resources/templates/config/configValue/add.html +++ b/src/main/resources/templates/config/configValue/add.html @@ -64,7 +64,7 @@ </div> <div th:include="include::footer"></div> <script type="text/javascript"> - var prefix = ctx + "config/company" + var prefix = ctx + "config/configValue" $("#form-configValue-add").validate({ rules:{ moduleType:{ diff --git a/src/main/resources/templates/config/configValue/configValue.html b/src/main/resources/templates/config/configValue/configValue.html index da28b43..c3ca7f7 100644 --- a/src/main/resources/templates/config/configValue/configValue.html +++ b/src/main/resources/templates/config/configValue/configValue.html @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('company-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/container/container.html b/src/main/resources/templates/config/container/container.html index 2e1399e..efb7bfc 100644 --- a/src/main/resources/templates/config/container/container.html +++ b/src/main/resources/templates/config/container/container.html @@ -35,6 +35,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('container-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:container:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/containerCapacity/containerCapacity.html b/src/main/resources/templates/config/containerCapacity/containerCapacity.html index 9d0b347..393be08 100644 --- a/src/main/resources/templates/config/containerCapacity/containerCapacity.html +++ b/src/main/resources/templates/config/containerCapacity/containerCapacity.html @@ -32,6 +32,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('containerCapacity-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/containerType/containerType.html b/src/main/resources/templates/config/containerType/containerType.html index adc2d2a..42bc496 100644 --- a/src/main/resources/templates/config/containerType/containerType.html +++ b/src/main/resources/templates/config/containerType/containerType.html @@ -29,6 +29,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('containerType-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/customer/customer.html b/src/main/resources/templates/config/customer/customer.html index 77533fe..f84be52 100644 --- a/src/main/resources/templates/config/customer/customer.html +++ b/src/main/resources/templates/config/customer/customer.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="material-form"> + <form id="customer-form"> <div class="select-list"> <ul> <li> @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('customer-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:customer:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html b/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html index 488845a..f4b9817 100644 --- a/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html +++ b/src/main/resources/templates/config/cycleCountPreference/cycleCountPreference.html @@ -35,6 +35,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('cycleCountPreference-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/excelTemplate/excelTemplate.html b/src/main/resources/templates/config/excelTemplate/excelTemplate.html index ad6c575..62c5381 100644 --- a/src/main/resources/templates/config/excelTemplate/excelTemplate.html +++ b/src/main/resources/templates/config/excelTemplate/excelTemplate.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="execlTemplate-form"> <div class="select-list"> <ul> <li> @@ -20,6 +20,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('execlTemplate-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/filterConfigHeader/filterConfigHeader.html b/src/main/resources/templates/config/filterConfigHeader/filterConfigHeader.html index 6b3d3f0..f162b82 100644 --- a/src/main/resources/templates/config/filterConfigHeader/filterConfigHeader.html +++ b/src/main/resources/templates/config/filterConfigHeader/filterConfigHeader.html @@ -37,6 +37,7 @@ <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('filterConfigHeader-form')"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> diff --git a/src/main/resources/templates/config/location/location.html b/src/main/resources/templates/config/location/location.html index 8719e3c..7582f1c 100644 --- a/src/main/resources/templates/config/location/location.html +++ b/src/main/resources/templates/config/location/location.html @@ -56,6 +56,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('location-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:location:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/locationType/locationType.html b/src/main/resources/templates/config/locationType/locationType.html index 51504d8..6d412df 100644 --- a/src/main/resources/templates/config/locationType/locationType.html +++ b/src/main/resources/templates/config/locationType/locationType.html @@ -29,6 +29,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('alarmLevel-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/material/material.html b/src/main/resources/templates/config/material/material.html index 9c3661e..410a2df 100644 --- a/src/main/resources/templates/config/material/material.html +++ b/src/main/resources/templates/config/material/material.html @@ -35,6 +35,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('material-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:material:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/materialMultiple/materialMultiple.html b/src/main/resources/templates/config/materialMultiple/materialMultiple.html index bad7b0a..83f520f 100644 --- a/src/main/resources/templates/config/materialMultiple/materialMultiple.html +++ b/src/main/resources/templates/config/materialMultiple/materialMultiple.html @@ -5,7 +5,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="materialMultiple-form"> <div class="select-list"> <ul> <li> @@ -22,6 +22,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('materialMultiple-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/materialType/materialType.html b/src/main/resources/templates/config/materialType/materialType.html index 10c521c..6073919 100644 --- a/src/main/resources/templates/config/materialType/materialType.html +++ b/src/main/resources/templates/config/materialType/materialType.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="materialType-form"> <div class="select-list"> <ul> <li> @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('materialType-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/materialUnit/materialUnit.html b/src/main/resources/templates/config/materialUnit/materialUnit.html index e0d18af..1e1b2ab 100644 --- a/src/main/resources/templates/config/materialUnit/materialUnit.html +++ b/src/main/resources/templates/config/materialUnit/materialUnit.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="materialUnit-form"> <div class="select-list"> <ul> <li> @@ -27,6 +27,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('materialUnit-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/receiptPreference/receiptPreference.html b/src/main/resources/templates/config/receiptPreference/receiptPreference.html index f54ce20..05ee9a4 100644 --- a/src/main/resources/templates/config/receiptPreference/receiptPreference.html +++ b/src/main/resources/templates/config/receiptPreference/receiptPreference.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="receiptPreference-form"> <div class="select-list"> <ul> <li> @@ -29,6 +29,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('receiptPreference-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/receiptType/receiptType.html b/src/main/resources/templates/config/receiptType/receiptType.html index 822dbf5..34b8a3b 100644 --- a/src/main/resources/templates/config/receiptType/receiptType.html +++ b/src/main/resources/templates/config/receiptType/receiptType.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="locationType-form"> + <form id="receiptType-form"> <div class="select-list"> <ul> <li> @@ -20,6 +20,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('receiptType-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/shipmentPreference/shipmentPreference.html b/src/main/resources/templates/config/shipmentPreference/shipmentPreference.html index 6782f94..6cc75c5 100644 --- a/src/main/resources/templates/config/shipmentPreference/shipmentPreference.html +++ b/src/main/resources/templates/config/shipmentPreference/shipmentPreference.html @@ -26,6 +26,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('shipmentPreference-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/shipmentType/shipmentType.html b/src/main/resources/templates/config/shipmentType/shipmentType.html index 78e1cfe..b71ed67 100644 --- a/src/main/resources/templates/config/shipmentType/shipmentType.html +++ b/src/main/resources/templates/config/shipmentType/shipmentType.html @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('shipmentType-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/statusFlowHeader/statusFlowHeader.html b/src/main/resources/templates/config/statusFlowHeader/statusFlowHeader.html index f192bf3..681d46b 100644 --- a/src/main/resources/templates/config/statusFlowHeader/statusFlowHeader.html +++ b/src/main/resources/templates/config/statusFlowHeader/statusFlowHeader.html @@ -40,6 +40,7 @@ <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('statusFlowHeader-form')"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> diff --git a/src/main/resources/templates/config/supplier/supplier.html b/src/main/resources/templates/config/supplier/supplier.html index 697b19f..651e3b6 100644 --- a/src/main/resources/templates/config/supplier/supplier.html +++ b/src/main/resources/templates/config/supplier/supplier.html @@ -23,6 +23,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('supplier-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:supplier:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/warehouse/warehouse.html b/src/main/resources/templates/config/warehouse/warehouse.html index 5516b60..b8c6c3b 100644 --- a/src/main/resources/templates/config/warehouse/warehouse.html +++ b/src/main/resources/templates/config/warehouse/warehouse.html @@ -6,7 +6,7 @@ <div class="container-div"> <div class="row"> <div class="col-sm-12 select-info"> - <form id="company-form"> + <form id="warehouse-form"> <div class="select-list"> <ul> <li> @@ -29,6 +29,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('warehouse-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:company:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/waveFlowHeader/waveFlowHeader.html b/src/main/resources/templates/config/waveFlowHeader/waveFlowHeader.html index c4d3cd2..07d4649 100644 --- a/src/main/resources/templates/config/waveFlowHeader/waveFlowHeader.html +++ b/src/main/resources/templates/config/waveFlowHeader/waveFlowHeader.html @@ -31,6 +31,7 @@ <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('waveFlowHeader')"><i class="fa fa-refresh"></i> 重置</a> </li> </ul> </div> diff --git a/src/main/resources/templates/config/waveMaster/waveMaster.html b/src/main/resources/templates/config/waveMaster/waveMaster.html index 7d22e9d..270959f 100644 --- a/src/main/resources/templates/config/waveMaster/waveMaster.html +++ b/src/main/resources/templates/config/waveMaster/waveMaster.html @@ -26,6 +26,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('waveMaster-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/zone/zone.html b/src/main/resources/templates/config/zone/zone.html index cdd8a50..1b3a706 100644 --- a/src/main/resources/templates/config/zone/zone.html +++ b/src/main/resources/templates/config/zone/zone.html @@ -29,6 +29,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('zone-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/config/zoneCapacity/zoneCapacity.html b/src/main/resources/templates/config/zoneCapacity/zoneCapacity.html index b9e1597..0478af6 100644 --- a/src/main/resources/templates/config/zoneCapacity/zoneCapacity.html +++ b/src/main/resources/templates/config/zoneCapacity/zoneCapacity.html @@ -30,6 +30,7 @@ </li> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('zoneCapacity-form')"><i class="fa fa-refresh"></i> 重置</a> <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="config:zoneCapacity:export"><i class="fa fa-download"></i> 导出</a>--> </li> </ul> diff --git a/src/main/resources/templates/include.html b/src/main/resources/templates/include.html index b67955d..1576122 100644 --- a/src/main/resources/templates/include.html +++ b/src/main/resources/templates/include.html @@ -20,7 +20,7 @@ <div th:fragment="footer"> <script th:src="@{/js/jquery.min.js}"></script> <script th:src="@{/js/bootstrap.min.js}"></script> - + <script th:src="@{/huaheng/js/common.js?v=2.3.0}"></script> <!-- bootstrap-table 表格插件 --> <script th:src="@{/ajax/libs/bootstrap-table/bootstrap-table.min.js}"></script> <script th:src="@{/ajax/libs/bootstrap3-editable/js/bootstrap-editable.js}"></script> @@ -42,7 +42,6 @@ <script th:src="@{/ajax/libs/layer/layer.min.js}"></script> <script th:src="@{/ajax/libs/layui/layui.js}"></script> <script th:src="@{/ajax/libs/layui/lay/modules/upload.js}"></script> - <script th:src="@{/huaheng/js/common.js?v=2.3.0}"></script> <script th:src="@{/huaheng/js/huahengUI.js?v=2.3.2}"></script> <script th:inline="javascript"> var ctx = [[@{/}]]; </script> </div> diff --git a/src/main/resources/templates/inventory/adjustHeader/addAdjust.html b/src/main/resources/templates/inventory/adjustDetail/add.html index fb5e0e8..fb5e0e8 100644 --- a/src/main/resources/templates/inventory/adjustHeader/addAdjust.html +++ b/src/main/resources/templates/inventory/adjustDetail/add.html diff --git a/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html b/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html index 82c2f6e..d9f885d 100644 --- a/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html +++ b/src/main/resources/templates/inventory/adjustDetail/adjustDetail.html @@ -55,8 +55,8 @@ 物料规格:<input id="materialSpec" type="text" name="materialSpec"/> </li> <li> - 调整单类型:<select name="problemType" - th:with="problemType=${@dict.getType('cyclecountStatus')}"> + 调整类型:<select name="problemType" + th:with="problemType=${@dict.getType('adjustType')}"> <option value="">所有</option> <option th:each="e : ${problemType}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option> @@ -91,11 +91,13 @@ </div> </div> <div class="btn-group hidden-xs" id="toolbar" role="group"> - - <a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/> - <!--shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"--> - <i class="fa fa-vcard"></i>差异调整 + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"> + <i class="fa fa-plus"></i> 新增 </a> + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="addAdjust()"/> + <!–shiro:hasPermission="inventory:cyclecountAdjustDetail:addAdjust"–> + <i class="fa fa-vcard"></i>调整 + </a>--> <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="createCyclecountWithGapQty()" shiro:hasPermission="inventoryHeader:cycleCountDetail:cyclecountRepeat"> <i class="fa fa-vcard"></i> 差异复盘 @@ -104,9 +106,9 @@ shiro:hasPermission="inventoryHeader:cycleCountDetail:adjust"> <i class="fa fa-vcard"></i> 差异库存调整 </a>--> - <a class="btn btn-outline btn-success btn-rounded" onclick="update()"> - <i class="fa fa-refresh"></i> 刷 新 - </a> + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.table.refresh()"> + <i class="fa fa-refresh"></i> 刷新 + </a>--> </div> <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> </div> @@ -115,14 +117,14 @@ <script th:inline="javascript"> var prefix = ctx + "inventory/adjustDetail"; var prefix_head = ctx + "inventory/adjustHeader"; - var datas = [[${@dict.getType('adjustType')}]]; + var type2 = [[${@dict.getType('adjustType')}]]; + var adjustStatus = [[${@dict.getType('adjustStatus')}]]; var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; var created; $(function () { update(); }); - function update() { let adjustCode=null; let options = { @@ -130,13 +132,22 @@ modalName: "调整单明细", sortName: "id", sortOrder: "desc", - showRefresh: false, search: false, + showRefresh: true, columns: [ { radio: true }, { + title: '调整操作', + align: 'center', + formatter: function (value, row, index) { + var actions = []; + actions.push('<a class="btn btn-warning btn-xs " href="#" onclick="$.operate.addAdjust()"><i class="fa fa-trash-o"></i>调整</a> '); + return actions.join(''); + } + }, + { field: 'id', title: '明细id', sortable: true @@ -201,7 +212,7 @@ { field: 'checkDetailId', title: '质检单明细行号', - visible: false + visible: true }, { field: 'referCode', @@ -211,14 +222,18 @@ { field: 'referDetailId', title: '调整单关联明细ID', - visible: false + visible: true }, { field: 'problemType', title: '调整类型', - sortable: true, - visible: true + align: 'center', + formatter: function (value, row, index) { + return $.table.selectDictLabel(type2, value); + }, + visible: true, + //sortable: true }, { field: 'fromQty', @@ -278,9 +293,9 @@ }, { field: 'status', - title: '明细状态', + title: '调整状态', formatter: function (value, row, index) { - return $.table.selectDictLabel(datas, value); + return $.table.selectDictLabel(adjustStatus, value); }, sortable: true }, @@ -299,7 +314,15 @@ title: '处理标记', visible: false }, - + { + title: '操作', + align: 'center', + formatter: function (value, row, index) { + var actions = []; + actions.push('<a class="btn btn-danger btn-xs" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); + return actions.join(''); + } + } ] }; diff --git a/src/main/resources/templates/inventory/adjustDetail/adjustEdit.html b/src/main/resources/templates/inventory/adjustDetail/adjustEdit.html new file mode 100644 index 0000000..ecffbfd --- /dev/null +++ b/src/main/resources/templates/inventory/adjustDetail/adjustEdit.html @@ -0,0 +1,168 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-cyclecountAdjustDetail-AdjustEdit" th:object="${cyclecountAdjustDetailEdit}" > + <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="*{cyclecountAdjustId}"> + + <div class="form-group"> + <label class="col-sm-3 control-label">明细id:</label> + <div class="col-sm-8"> + <input id="id" name="id" th:value="*{id}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">调整单编号:</label> + <div class="col-sm-8"> + <input id="cyclecountAdjustCode" name="cyclecountAdjustCode" th:value="*{cyclecountAdjustCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">货主编码:</label> + <div class="col-sm-8"> + <input id="companyCode" name="companyCode" th:value="*{companyCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">盘点单编号:</label> + <div class="col-sm-8"> + <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="*{cyclecountHeadCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">物料编码:</label> + <div class="col-sm-8"> + <input id="materialCode" name="materialCode" th:value="*{materialCode}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">库位编码:</label> + <div class="col-sm-8"> + <input id="locationCode" name="locationCode" th:value="*{locationCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">容器编号:</label> + <div class="col-sm-8"> + <input id="containerCode" name="containerCode" th:value="*{containerCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">入库单编码:</label> + <div class="col-sm-8"> + <input id="receiptCode" name="receiptCode" th:value="*{receiptCode}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + <!--<div class="form-group"> + <label class="col-sm-3 control-label">重量kg:</label> + <div class="col-sm-8"> + <input id="weight" name="weight" th:value="*{weight}" class="form-control" type="text" readonly="readonly"> + </div> + </div>--> + <div class="form-group"> + <label class="col-sm-3 control-label">库存id:</label> + <div class="col-sm-8"> + <input id="inventoryId" name="inventoryId" th:value="*{inventoryId}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">库存状态:</label> + <div class="col-sm-8"> + <select id="inventoryStatus" name="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}" disabled="disabled"> + <option th:each="dict : ${inventoryStatus}" th:field="*{inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> + </select> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">系统数量:</label> + <div class="col-sm-8"> + <input id="systemQty" name="systemQty" th:value="*{systemQty}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">实际数量:</label> + <div class="col-sm-8"> + <input id="countedQty" name="countedQty" th:value="*{countedQty}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">差异数量:</label> + <div class="col-sm-8"> + <input id="gapQty" name="gapQty" th:value="*{gapQty}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">调整数量:</label> + <div class="col-sm-8"> + <input id="adjustQty" name="adjustQty" class="form-control" type="text" placeholder="填写物料的差异数值" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">批次:</label> + <div class="col-sm-8"> + <input id="batch" name="batch" th:value="*{batch}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">批号:</label> + <div class="col-sm-8"> + <input id="lot" name="lot" th:value="*{lot}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">项目号:</label> + <div class="col-sm-8"> + <input id="project" name="project" th:value="*{project}" class="form-control"readonly="readonly"> + </div> + </div> + <!--<div class="form-group"> + <label class="col-sm-3 control-label">生产日期:</label> + <div class="col-sm-8"> + <input id="manufactureDate" name="manufactureDate" th:value="*{manufactureDate}" class="form-control" type="text" readonly="readonly"> + </div> + </div>--> + <div class="form-group"> + <label class="col-sm-3 control-label">失效日期:</label> + <div class="col-sm-8"> + <input id="expirationDate" name="expirationDate" th:value="*{expirationDate}" class="form-control" type="text"readonly="readonly"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-success">确认</button><!--只调整数量 adjustUpdate--> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> +<div th:include="include::footer"></div> +<script type="text/javascript"> + var prefix = ctx + "inventory/cyclecountAdjustDetail" + $("#form-cyclecountAdjustDetail-AdjustEdit").validate({ + rules:{ + adjustQty:{ + required:true, + }, + //必填判定 + }, + submitHandler: function(form) { + $.operate.save(prefix + "/editAdjustSave", $('#form-cyclecountAdjustDetail-AdjustEdit').serialize()); + } + }); + /*时间弹框*/ + $(function () { + layui.use('laydate', function() { + var laydate = layui.laydate; + laydate.render({ elem: '#manufactureDate',max: 0, theme: 'molv' ,type: 'datetime'}); + laydate.render({ elem: '#expirationDate',min: 0, theme: 'molv' ,type: 'datetime'}); + }); + }) + +</script> +</body> +</html> diff --git a/src/main/resources/templates/inventory/adjustHeader/add.html b/src/main/resources/templates/inventory/adjustHeader/add.html new file mode 100644 index 0000000..74ede88 --- /dev/null +++ b/src/main/resources/templates/inventory/adjustHeader/add.html @@ -0,0 +1,167 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> + <div class="wrapper wrapper-content animated fadeInRight ibox-content"> + + <form class="form-horizontal m" id="form-cyclecountAdjustDetail-addAdjust" > + <input type="hidden" id="cyclecountAdjustId" name="cyclecountAdjustId" th:value="${cyclecountAdjustId}"> + + <div class="form-group"> + <label class="col-sm-3 control-label">调整单编号:</label> + <div class="col-sm-8"> + <input id="code" name="code" th:value="${code}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">货主编码:</label> + <div class="col-sm-8"> + <input id="companyId" name="companyId" type="hidden" th:value="*{companyId}"> + <input id="companyCode" name="companyCode" th:value="${companyCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">盘点单编号:</label> + <div class="col-sm-8"> + <input id="cyclecountHeadCode" name="cyclecountHeadCode" th:value="${cyclecountHeadCode}" class="form-control" type="text" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">物料编码:</label> + <div class="col-sm-8"> + <input id="materialCode" name="materialCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">库位编码:</label> + <div class="col-sm-8"> + <input id="locationCode" name="locationCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">容器编号:</label> + <div class="col-sm-8"> + <input id="containerCode" name="containerCode" class="form-control" type="text" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">库存状态:</label> + <div class="col-sm-8"> + <select id="inventoryStatus" name="inventoryStatus" class="form-control" th:with="inventoryStatus=${@dict.getType('inventoryStatus')}"> + <option th:each="dict : ${inventoryStatus}" th:text="${dict['dictLabel']}" th:value="${dict['dictValue']}"></option> + </select> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">系统数量:</label> + <div class="col-sm-8"> + <input id="systemQty" name="systemQty" value="0" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" readonly="readonly"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">实际数量:</label> + <div class="col-sm-8"> + <input id="countedQty" name="countedQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">差异数量:</label> + <div class="col-sm-8"> + <input id="gapQty" name="gapQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">调整数量:</label> + <div class="col-sm-8"> + <input id="adjustQty" name="adjustQty" class="form-control" type="text" onkeyup="this.value=this.value.replace(/[^\-?\d.]/g,'')"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">批次:</label> + <div class="col-sm-8"> + <input id="batch" name="batch" class="form-control" type="text" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">批号:</label> + <div class="col-sm-8"> + <input id="lot" name="lot" class="form-control" type="text" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">项目号:</label> + <div class="col-sm-8"> + <input id="project" name="project" class="form-control" type="text" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">生产日期:</label> + <div class="col-sm-8"> + <input id="manufactureDate" name="manufactureDate" class="form-control" type="text" > + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">失效日期:</label> + <div class="col-sm-8"> + <input id="expirationDate" name="expirationDate" class="form-control" type="text"> + </div> + </div> + + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button><!--盘有 adjustInsert--> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> + </div> + <div th:include="include::footer"></div> + <script type="text/javascript"> + var prefix = ctx + "inventory/cyclecountAdjustDetail" + + $("#form-cyclecountAdjustDetail-addAdjust").validate({ + rules:{ + materialCode:{ + required:true, + }, + containerCode:{ + required:true, + }, + locationCode:{ + required:true, + }, + systemQty:{ + required:true, + }, + countedQty:{ + required:true, + }, + gapQty:{ + required:true, + }, + adjustQty:{ + required:true, + }, + + //必须填值判定 + }, + submitHandler: function(form) { + $.operate.save(prefix + "/addAdjust", $('#form-cyclecountAdjustDetail-addAdjust').serialize()); + } + }); + + /*时间弹框*/ + $(function () { + layui.use('laydate', function() { + var laydate = layui.laydate; + laydate.render({ elem: '#manufactureDate',max: 0, theme: 'molv' ,type: 'datetime'}); + laydate.render({ elem: '#expirationDate',min: 0, theme: 'molv' ,type: 'datetime'}); + }); + }) + + </script> +</body> +</html> diff --git a/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html b/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html index 150fac2..e214421 100644 --- a/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html +++ b/src/main/resources/templates/inventory/adjustHeader/adjustHeader.html @@ -67,6 +67,16 @@ </div> </form> </div> + <div class="btn-group hidden-xs" id="toolbar" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" + shiro:hasPermission="inventory:cycleCount:add"> + <i class="fa fa-plus"></i> 新增 + </a> + <!--<a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" + shiro:hasPermission="inventory:cycleCount:remove"> + <i class="fa fa-trash-o"></i> 删除 + </a>--> + </div> <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> </div> @@ -82,7 +92,7 @@ var upload = [[${@permission.hasPermi('inventoryHeader:adjustHeader:upload')}]]; var report = [[${@permission.hasPermi('inventoryHeader:adjustHeader:report')}]]; var datas = [[${@dict.getType('sys_normal_disable')}]]; - var status2 = [[${@dict.getType('adjustType')}]]; + var type2 = [[${@dict.getType('adjustType')}]]; $(function () { var options = { @@ -121,10 +131,10 @@ field: 'cycleCountCode', title: '盘点单编码' }, - { + /*{ field: 'problemType', title: '调整类型' - }, + },*/ { field: 'referCode', title: '关联上游单编码' @@ -138,9 +148,10 @@ title: '调整类型', align: 'center', formatter: function (value, row, index) { - return $.table.selectDictLabel(status2, value); + return $.table.selectDictLabel(type2, value); }, - sortable: true + visible: true, + //sortable: true }, { @@ -170,7 +181,7 @@ var actions = []; actions.push('<a class="btn btn-success btn-xs ' + report + '" href="#" onclick="cyclecountPrint(\'' + row.id + '\')"><i class="fa fa-print"></i>打印</a> '); actions.push('<a class="btn btn-info btn-xs ' + upload + ' " href="#" onclick="upLoad(\'' + row.code + '\',\'' + row.sourceCode + '\')"><i class="fa fa-edit"></i>上传</a> '); - /* actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> ');*/ + actions.push('<a class="btn btn-danger btn-xs " href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a> '); actions.push('<a style="background: #b5bdc0" class="btn btn-default btn-xs " href="#" onclick="detail(\'' + row.id + '\',\'' + row.code + '\')"><i class="fa fa-list-ul"></i>明细</a>'); return actions.join(''); } diff --git a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html index 1e1edd9..4543db6 100644 --- a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html +++ b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html @@ -195,7 +195,6 @@ { field : 'code', title : '入库单号', - visible:false }, { field : 'companyCode', @@ -214,8 +213,8 @@ formatter: function(value, row, index) { var actions = []; $.each(receiptTypes, function(index, dict) { - if (dict.code == value) { - actions.push("<span class='badge badge-info'>" + dict.name + "</span>"); + if (dict.dictValue == value) { + actions.push("<span class='badge badge-info'>" + dict.dictLabel + "</span>"); return false; } }); diff --git a/src/main/resources/templates/receipt/receiving/receiving.html b/src/main/resources/templates/receipt/receiving/receiving.html index ad14c2d..c60622a 100644 --- a/src/main/resources/templates/receipt/receiving/receiving.html +++ b/src/main/resources/templates/receipt/receiving/receiving.html @@ -47,10 +47,22 @@ </div> </form> </div> + <div class="col-sm-12 select-info table-striped-left" style="padding-top: 20px;"> <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> </div> <div class="col-sm-12 select-info table-striped-right"> + <div class="btn-group hidden-xs" id="toolbar1" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add"> + <i class="fa fa-map-pin"></i> 定位 + </a> + <a class="btn btn-outline btn-info btn-rounded" onclick="cancelPositioning()" shiro:hasPermission="receipt:receiptDetail:remove"> + <i class="fa fa-times"></i> 取消定位 + </a> + <a class="btn btn-outline btn-danger btn-rounded" onclick="batRemove()" shiro:hasPermission="receipt:receiptDetail:remove"> + <i class="fa fa-trash-o"></i> 取消收货 + </a> + </div> <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table> </div> </div> @@ -255,19 +267,20 @@ clickToSelect: true, showColumns:true, //列选择 // detailView:true, + toolbar: "#toolbar1", showExport: true, //导出 exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 modalName: "入库组盘", iconSize: "outline", - toolbar: "#toolbar", + toolbar: "#toolbar1", contentType: "application/x-www-form-urlencoded", onRefresh: function(){ list_receiptInfo($("#code").val()); }, columns: [ - // { - // checkbox: true - // }, + { + checkbox: true + }, { field : 'id', title : '组盘明细id', @@ -371,52 +384,58 @@ function remove(id) { $.modal.confirm("确定删除该组盘?", function() { var url = ctx + "receipt/receiptContainerDetail/remove"; - var data = { "id": id }; + var data = { "ids": id }; $.operate.submitAndCallback(url, "post", "json", data, initTable); }); } - // var url = location.search; //获取url中"?"符后的字串 - // var theRequest = new Object(); - // if ( url.indexOf( "?" ) != -1 ) { - // var str = url.substr( 1 ); //substr()方法返回从参数值开始到结束的字符串; - // var strs = str.split( "&" ); - // for ( var i = 0; i < strs.length; i++ ) { - // theRequest[ strs[ i ].split( "=" )[ 0 ] ] = ( strs[ i ].split( "=" )[ 1 ] ); - // }} - // // console.log(theRequest.code); - // $("#code").val(theRequest.code); - // list_select(theRequest.code); - // function open(title, url, width, height){ - // if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { - // width = 'auto'; - // height = 'auto'; - // } - // if (title==null){ - // title = false; - // } - // if (url==null){ - // url="404.html"; - // } - // if ($.common.isEmpty(width)) { - // width = 800; - // // width = ($(window).width() - 100); - // } - // if ($.common.isEmpty(height)) { - // height = ($(window).height() - 50); - // } - // layer.open({ - // type: 2, - // area: [width + 'px', height + 'px'], - // fix: false, - // //不固定 - // maxmin: true, - // shade: 0.3, - // title: title, - // content: url - // // shadeClose: true, //点击遮罩关闭层 - // }) - // } + function positioning() { + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + var url = ctx+"receipt/receiptContainerHeader/position"; + var ids = ""; + for (var i = 0; i<rows.length; i++){ + ids += rows[i].receiptContainerId; + ids += ","; + } + var data = { "ids": ids }; + $.operate.submit(url, "post", "json", data); + } + + function cancelPositioning() { + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + var url = ctx+"receipt/receiptContainerHeader/cancelPosition"; + var ids = ""; + for (var i = 0; i<rows.length; i++){ + ids += rows[i].receiptContainerId; + ids += ","; + } + var data = { "ids": ids }; + $.operate.submit(url, "post", "json", data); + } + + function batRemove() { + let rows = $("#bootstrap-table1").bootstrapTable('getSelections'); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + var url = ctx+"receipt/receiptContainerDetail/remove"; + var ids = ""; + for (var i = 0; i<rows.length; i++){ + ids += rows[i].receiptContainerId; + ids += ","; + } + var data = { "ids": ids }; + $.operate.submit(url, "post", "json", data); + } </script> </body> </html> \ No newline at end of file diff --git a/src/main/resources/templates/shipment/shipmentHeader/addWave.html b/src/main/resources/templates/shipment/shipmentHeader/addWave.html new file mode 100644 index 0000000..fd1e891 --- /dev/null +++ b/src/main/resources/templates/shipment/shipmentHeader/addWave.html @@ -0,0 +1,70 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m"> + <div class="form-group"> + <label class="col-sm-3 control-label">请选择:</label> + <div class="col-sm-8"> + <select id="code" class="form-control"></select> + </div> + </div> + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <input type="button" onclick="reSubmit()" class="btn btn-primary" value="提交"> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> + +<div th:include="include :: footer"></div> +</body> +<script type="text/javascript"> + let prefix = ctx + "shipment/shipmentHeader"; + let url = location.search; + if (url.indexOf("?") !== -1){ + var ids=url.substr(url.indexOf("?")+5); + } + $(function () { + $.ajax({ + url:prefix+'/waveList', + type:'post', + success:function (res) { + if (res.code === 200) { + $("#code").children().remove(); + for (let i = 0; i < res.data.length; i++) { + $("#code").append("<option value='"+res.data[i].code+"'>"+res.data[i].name+"</option>") + } + } + else { + $.modal.msgError(res.msg); + } + } + }) + }); + function reSubmit() { + let code=$("#code option:selected").val(); + $.ajax({ + url:prefix+'/addWave', + type:'post', + data:{ + ids:ids, + code:code + }, + success:function (res) { + if (res.code === 200) { + $.modal.msgSuccess("成功!"); + $.modal.close(); + window.parent.loadDetail(); + } + else { + $.modal.msgError(res.msg); + } + } + }) + } +</script> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html index 76a0701..ecc1659 100644 --- a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html +++ b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html @@ -91,10 +91,10 @@ <!--shiro:hasPermission="shipment:bill:analysis">--> <!--<i class="fa fa-plus"></i> 订单分析--> <!--</a>--> - <!--<a class="btn btn-outline btn-success btn-rounded" onclick="wave()"--> - <!--shiro:hasPermission="shipment:bill:analysis">--> - <!--<i class="fa fa-plus"></i> 加入波次--> - <!--</a>--> + <a class="btn btn-outline btn-success btn-rounded" onclick="wave()" + shiro:hasPermission="shipment:bill:wave"> + <i class="fa fa-plus"></i> 加入波次 + </a> </div> <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> </div> @@ -705,23 +705,23 @@ }) }); - // function addzone() { - // let url=prefix_detail+'/addZoneCode?ids='; - // let rows=$("#bootstrap-table-detail").bootstrapTable('getSelections'); - // if (rows.length === 0) { - // $.modal.msgWarning("请至少选择一条记录"); - // } - // else { - // let ids = ""; - // for(let i=0; i<rows.length; i++) { - // ids = ids + rows[i].id + "," - // } - // ids = ids.substring(0, ids.length-1); - // url=url+ids; - // $.modal.open("分配库区",url,800,250) - // } - // } - // + function wave() { + let url=prefix+'/wave?ids='; + let rows=$("#bootstrap-table").bootstrapTable('getSelections'); + if (rows.length === 0) { + $.modal.msgWarning("请至少选择一条记录"); + } + else { + let ids = ""; + for(let i=0; i<rows.length; i++) { + ids = ids + rows[i].id + "," + } + ids = ids.substring(0, ids.length-1); + url=url+ids; + $.modal.open("加入波次",url,800,250) + } + } + // //自动分配库区 // function autoZone() { // let code=$("#shipmentCode").val(); diff --git a/src/main/resources/templates/shipment/wave/wave.html b/src/main/resources/templates/shipment/wave/wave.html index aa6207f..9b41e4b 100644 --- a/src/main/resources/templates/shipment/wave/wave.html +++ b/src/main/resources/templates/shipment/wave/wave.html @@ -30,8 +30,14 @@ </form> </div> <div class="btn-group hidden-xs" id="toolbar" role="group"> - <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="shipment:wave:add"> - <i class="fa fa-plus"></i> 新增 + <!--<a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()" shiro:hasPermission="shipment:wave:add">--> + <!--<i class="fa fa-plus"></i> 新增--> + <!--</a>--> + <a class="btn btn-outline btn-success btn-rounded" onclick="startWave()" shiro:hasPermission="shipment:wave:startWave"> + <i class="fa fa-plus"></i> 开始波次 + </a> + <a class="btn btn-outline btn-success btn-rounded" onclick="freed()" shiro:hasPermission="shipment:wave:freed"> + <i class="fa fa-plus"></i> 释放 </a> <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="shipment:wave:remove"> <i class="fa fa-trash-o"></i> 删除 @@ -200,7 +206,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); + // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); } @@ -208,6 +214,23 @@ }; $.table.init(options); }); + + + //开始波次 + function startWave() { + var rows = $("#bootstrap-table").bootstrapTable('getSelections'); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } + var url = prefix + "/startWave"; + var data = { + "ids": rows.map(function (v) { + return v.id; + }).join(',') + }; + localSubmit(url, "post", "json", data); + } </script> </body> </html> \ No newline at end of file