diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java index 7f124c70..465137ed 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrintLogController.java @@ -1,5 +1,6 @@ package com.foreverwin.mesnac.common.controller; +import cn.hutool.core.date.DateUtil; import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.R; import com.foreverwin.modular.core.util.FrontPage; @@ -49,6 +50,32 @@ public class PrintLogController { return R.ok(result); } + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @PostMapping("/getPrintLogListByCondition") + public R getPrintLogListByCondition(@RequestBody PrintLog printLog){ + List result; + try { + String site = CommonMethods.getSite(); + printLog.setSite(site); + if (printLog.getStartFromDate_S() != null) { + printLog.setStartFromDate(DateUtil.parse(printLog.getStartFromDate_S())); + } + if (printLog.getStartToDate_S() != null) { + printLog.setStartToDate(DateUtil.parse(printLog.getStartToDate_S())); + } + result = printLogService.getPrintLogListByCondition(printLog); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + + return R.ok(result); + } + @ResponseBody @PostMapping("/labelPrint") public R labelPrint(@RequestBody List requestList) { diff --git a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java index 2ef737bb..3c6eebdb 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java @@ -80,16 +80,16 @@ public class PrinterController { printer.setCreatedDateTime(nowDate); printer.setModifiedDateTime(nowDate); printerService.save(printer); + return R.ok("保存成功"); } else { printerModel.setDescription(printer.getDescription()); printerModel.setModifiedDateTime(nowDate); printerService.updateById(printerModel); + return R.ok("修改成功"); } } catch (Exception e) { return R.failed(e.getMessage()); } - - return R.ok(); } @ResponseBody @PostMapping("/delPrinter") diff --git a/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java index 731257ce..9e527a85 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrintLogMapper.java @@ -4,6 +4,8 @@ import com.foreverwin.mesnac.common.model.PrintLog; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; +import java.util.List; + /** *

* Mapper 接口 @@ -15,4 +17,11 @@ import org.springframework.stereotype.Repository; @Repository public interface PrintLogMapper extends BaseMapper { + /** + * 条件查询标签打印所有数据 + * @param printLog + * @return + */ + List getPrintLogListByCondition(PrintLog printLog); + } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java b/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java index d2dd6de1..463c8fba 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/model/PrintLog.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.annotation.TableId; import java.time.LocalDateTime; import com.baomidou.mybatisplus.annotation.TableField; import java.io.Serializable; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; /** @@ -124,6 +126,45 @@ public class PrintLog extends Model { @TableField(value = "ITEM_DESCRIPTION", exist = false) private String itemDescription; + private String startFromDate_S; + @TableField(exist = false) + private String startToDate_S; + @TableField(exist = false) + private Date startFromDate; + @TableField(exist = false) + private Date startToDate; + + public String getStartFromDate_S() { + return startFromDate_S; + } + + public void setStartFromDate_S(String startFromDate_S) { + this.startFromDate_S = startFromDate_S; + } + + public String getStartToDate_S() { + return startToDate_S; + } + + public void setStartToDate_S(String startToDate_S) { + this.startToDate_S = startToDate_S; + } + + public Date getStartFromDate() { + return startFromDate; + } + + public void setStartFromDate(Date startFromDate) { + this.startFromDate = startFromDate; + } + + public Date getStartToDate() { + return startToDate; + } + + public void setStartToDate(Date startToDate) { + this.startToDate = startToDate; + } public String getHandle() { return handle; diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java index 01c5b584..6a773739 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/PrintLogService.java @@ -30,4 +30,11 @@ public interface PrintLogService extends IService { * @param printList */ void labelPrint(String site, String user, List printList); + + /** + * 查询标签打印所有数据 + * @param printLog + * @return + */ + List getPrintLogListByCondition(PrintLog printLog); } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java index b49c4d50..904b3532 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrintLogServiceImpl.java @@ -101,4 +101,9 @@ public class PrintLogServiceImpl extends ServiceImpl i printLogService.updateBatchById(printLogList); } + + @Override + public List getPrintLogListByCondition(PrintLog printLog) { + return printLogMapper.getPrintLogListByCondition(printLog); + } } \ No newline at end of file diff --git a/common/src/main/resources/mapper/PrintLogMapper.xml b/common/src/main/resources/mapper/PrintLogMapper.xml index cd250134..5207ba14 100644 --- a/common/src/main/resources/mapper/PrintLogMapper.xml +++ b/common/src/main/resources/mapper/PrintLogMapper.xml @@ -537,4 +537,32 @@ + + + + + + diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java index 61b47712..10471452 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/CallItemController.java @@ -162,11 +162,15 @@ public class CallItemController { try { String site = CommonMethods.getSite(); String user = CommonMethods.getUser(); - callItemService.callOrConfirmItemPda(site, user, callItemList.get(0).getCallStatus() ,callItemList); + String status = callItemList.get(0).getStatus(); + callItemService.callOrConfirmItemPda(site, user, status ,callItemList); + if (status.equals("802")){ + return R.ok("叫料成功"); + } + return R.ok("确认到料成功"); } catch (Exception e) { return R.failed(e.getMessage()); } - return R.ok("叫料成功"); } @@ -230,9 +234,7 @@ public class CallItemController { @PostMapping("/refreshCallItemPda") public R refreshCallItemPda(@RequestBody List callItemList) { try { - String site = CommonMethods.getSite(); - String user = CommonMethods.getUser(); - callItemService.refreshCallItemPda(site, user, callItemList); + callItemService.refreshCallItemPda(callItemList); } catch (Exception e) { return R.failed(e.getMessage()); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java index cb1c7abf..c7b19d4c 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/CallItemMapper.java @@ -49,7 +49,7 @@ public interface CallItemMapper extends BaseMapper { */ void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); - void findRefreshCallItemPda(@Param("list") List list); + List findRefreshCallItemPda(@Param("list") List list); void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java index 00bd8193..f9180589 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/CallItemService.java @@ -114,11 +114,9 @@ public interface CallItemService extends IService { /** * 刷新叫料明细PDA - * @param site - * @param user * @param callItemList */ - void refreshCallItemPda(String site, String user, List callItemList); + void refreshCallItemPda(List callItemList); /** * 刷新需求时间 diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java index 5311e584..3727f4f2 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/CallItemServiceImpl.java @@ -39,6 +39,8 @@ public class CallItemServiceImpl extends ServiceImpl i @Autowired private CallItemMapper callItemMapper; + @Autowired + private CallItemService callItemService; @Override public void sfcDispatchCallItem(String site, String user, List sfcDispatchList) { @@ -271,8 +273,31 @@ public class CallItemServiceImpl extends ServiceImpl i } @Override - public void refreshCallItemPda(String site, String user, List callItemList) { - + public void refreshCallItemPda(List callItemList) { + List callItems = new ArrayList<>(); + List list = new ArrayList<>(); + for (CallItem callItem:callItemList) { + String handle = callItem.getHandle(); + list.add(handle); + CallItem call = new CallItem(); + call.setHandle(handle); + callItems.add(call); + } + List itemList = callItemMapper.findRefreshCallItemPda(list); + + Boolean bl = false; + for (int i = 0; i < callItemList.size(); i++) { + BigDecimal oldQty = callItemList.get(i).getRequiredQty(); + BigDecimal newQty = itemList.get(i).getRequiredQty(); + if (oldQty.compareTo(newQty) == -1){ + callItems.get(i).setStatus(Constants.CALL_ITEM_STATUS_NEW); + callItems.get(i).setRequiredQty(newQty); + bl = true; + } + } + if (bl){ + callItemService.updateBatchById(callItems); + } } @Override @@ -329,7 +354,17 @@ public class CallItemServiceImpl extends ServiceImpl i continue; } - if ("GB".equals(itemGroup) && blankingSize.contains("*")) { + if (StringUtil.isBlank(blankingSize)) { + callItem.setSizeReqQty(callItem.getRequiredQty()); + compQtyMap.put(component, callItem.getRequiredQty()); + continue; + } + + if ("GB".equals(itemGroup)) { + if (!blankingSize.contains("*")) { + continue; + } + String []size = blankingSize.split("\\*"); if (size != null && size.length >= 2) { int sizeLength = size.length; @@ -342,7 +377,13 @@ public class CallItemServiceImpl extends ServiceImpl i compQtyMap.put(component, (compQtyMap.get(component) != null ? compQtyMap.get(component).add(sizeReqQty) : sizeReqQty)); } } else { - String []size = blankingSize.split("\\*"); + String[] size = new String[1]; + if (blankingSize.contains("*")) { + size = blankingSize.split("\\*"); + } else { + size[0] = blankingSize; + } + if (size != null && size.length >= 1) { int sizeLength = size.length; BigDecimal length = new BigDecimal(size[sizeLength-1]); diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 0132e1fb..8d486a7c 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -834,7 +834,7 @@ - UPDATE Z_CALL_ITEM SET CALL_STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} + UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} WHERE HANDLE IN #{item} @@ -979,7 +979,7 @@ diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java index abc1cc9d..5ac59e01 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/ResrceController.java @@ -1,19 +1,16 @@ package com.foreverwin.mesnac.meapi.controller; -import com.foreverwin.mesnac.meapi.util.StringUtils; -import com.foreverwin.modular.core.util.R; -import com.foreverwin.modular.core.util.FrontPage; -import com.foreverwin.modular.core.util.CommonMethods; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import org.springframework.web.bind.annotation.RequestMapping; +import com.foreverwin.mesnac.meapi.model.Resrce; +import com.foreverwin.mesnac.meapi.service.ResrceService; +import com.foreverwin.mesnac.meapi.util.StringUtils; +import com.foreverwin.modular.core.util.CommonMethods; +import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.modular.core.util.R; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import com.foreverwin.mesnac.meapi.service.ResrceService; -import com.foreverwin.mesnac.meapi.model.Resrce; - -import java.util.ArrayList; import java.util.List; /** @@ -98,9 +95,7 @@ public class ResrceController { queryWrapper.setEntity(resrce); if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { queryWrapper - .like(Resrce.HANDLE, frontPage.getGlobalQuery()) - .or().like(Resrce.SITE, frontPage.getGlobalQuery()) - .or().like(Resrce.RESRCE, frontPage.getGlobalQuery()) + .like(Resrce.RESRCE, frontPage.getGlobalQuery()) .or().like(Resrce.DESCRIPTION, frontPage.getGlobalQuery()) .or().like(Resrce.STATUS_BO, frontPage.getGlobalQuery()) .or().like(Resrce.PROCESS_RESOURCE, frontPage.getGlobalQuery()) diff --git a/meapi/src/main/resources/mapper/ResrceMapper.xml b/meapi/src/main/resources/mapper/ResrceMapper.xml index 4bb9b417..beea997e 100644 --- a/meapi/src/main/resources/mapper/ResrceMapper.xml +++ b/meapi/src/main/resources/mapper/ResrceMapper.xml @@ -284,7 +284,7 @@ - AND ${ew.sqlSegment} + ${ew.sqlSegment}