From 43afbafc667c32f04f14f896cef37f4905441bdc Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Wed, 11 Aug 2021 16:32:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BA=A7=E5=89=8D=E5=87=86=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mesnac/common/service/impl/ProdReadyTaskServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java index 048a8df8..5bba7756 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/ProdReadyTaskServiceImpl.java @@ -523,12 +523,12 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl Date: Wed, 11 Aug 2021 16:51:26 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/PrinterController.java | 93 +++++++++++++ .../mesnac/common/enums/HandleEnum.java | 2 + .../mesnac/common}/mapper/PrinterMapper.java | 6 +- .../mesnac/common}/model/Printer.java | 11 +- .../common}/service/PrinterService.java | 6 +- .../service/impl/PrinterServiceImpl.java | 10 +- .../main/resources/mapper/PrinterMapper.xml | 34 ++--- integration/pom.xml | 4 +- .../meapi/controller/PrinterController.java | 130 ------------------ 9 files changed, 131 insertions(+), 165 deletions(-) create mode 100644 common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java rename {meapi/src/main/java/com/foreverwin/mesnac/meapi => common/src/main/java/com/foreverwin/mesnac/common}/mapper/PrinterMapper.java (67%) rename {meapi/src/main/java/com/foreverwin/mesnac/meapi => common/src/main/java/com/foreverwin/mesnac/common}/model/Printer.java (91%) rename {meapi/src/main/java/com/foreverwin/mesnac/meapi => common/src/main/java/com/foreverwin/mesnac/common}/service/PrinterService.java (81%) rename {meapi/src/main/java/com/foreverwin/mesnac/meapi => common/src/main/java/com/foreverwin/mesnac/common}/service/impl/PrinterServiceImpl.java (83%) rename {meapi => common}/src/main/resources/mapper/PrinterMapper.xml (94%) delete mode 100644 meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/PrinterController.java 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 new file mode 100644 index 00000000..17e6ee63 --- /dev/null +++ b/common/src/main/java/com/foreverwin/mesnac/common/controller/PrinterController.java @@ -0,0 +1,93 @@ +package com.foreverwin.mesnac.common.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.foreverwin.mesnac.common.enums.HandleEnum; +import com.foreverwin.mesnac.common.model.Printer; +import com.foreverwin.modular.core.util.CommonMethods; +import com.foreverwin.modular.core.util.R; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import com.foreverwin.mesnac.common.service.PrinterService; +import java.time.LocalDateTime; +import java.util.List; + +/** + * + * @author Leon.L + * @since 2021-08-11 + */ +@RestController +@RequestMapping("/PRINTER") +public class PrinterController { + + @Autowired + public PrinterService printerService; + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getPrinterList(Printer printer){ + List result; + try { + String site = CommonMethods.getSite(); + printer.setSite(site); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(printer); + result = printerService.list(queryWrapper); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + + return R.ok(result); + } + + @ResponseBody + @GetMapping("/getPrinter") + public R savePrinter(String printer) { + Printer result = null; + try { + String site = CommonMethods.getSite(); + String handle = HandleEnum.PRINT.getHandle(site, printer); + result = printerService.getById(handle); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + + return R.ok(result); + } + + @ResponseBody + @PostMapping("/savePrinter") + public R savePrinter(Printer printer) { + try { + LocalDateTime nowDate = LocalDateTime.now(); + String site = CommonMethods.getSite(); + + String handle = HandleEnum.PRINT.getHandle(site, printer.getPrinter()); + Printer printerModel = printerService.getById(handle); + if (printerModel == null) { + printer.setHandle(handle); + printer.setSite(site); + printer.setCreatedDateTime(nowDate); + printer.setModifiedDateTime(nowDate); + printerService.save(printer); + } else { + printerModel.setDescription(printer.getDescription()); + printerModel.setModifiedDateTime(nowDate); + printerService.updateById(printerModel); + } + } catch (Exception e) { + return R.failed(e.getMessage()); + } + + return R.ok(); + } +} \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java index 7a72e34a..3e3b1ca7 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java @@ -20,6 +20,8 @@ public enum HandleEnum { /**物料清单**/ BOM("BOMBO:","BOMBO:{0},{1},{2},{3}"), + PRINT("PrintBO:", "StatusBO:{0},{1}"), + /**叫料**/ CALL_ITEM("CallItemBO:", "CallItemBO:{0},{1}"), diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/PrinterMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrinterMapper.java similarity index 67% rename from meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/PrinterMapper.java rename to common/src/main/java/com/foreverwin/mesnac/common/mapper/PrinterMapper.java index da30ef1c..c5884313 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/PrinterMapper.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/PrinterMapper.java @@ -1,6 +1,6 @@ -package com.foreverwin.mesnac.meapi.mapper; +package com.foreverwin.mesnac.common.mapper; -import com.foreverwin.mesnac.meapi.model.Printer; +import com.foreverwin.mesnac.common.model.Printer; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.springframework.stereotype.Repository; @@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository; *

* * @author Leon.L - * @since 2021-07-22 + * @since 2021-08-11 */ @Repository public interface PrinterMapper extends BaseMapper { diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/Printer.java b/common/src/main/java/com/foreverwin/mesnac/common/model/Printer.java similarity index 91% rename from meapi/src/main/java/com/foreverwin/mesnac/meapi/model/Printer.java rename to common/src/main/java/com/foreverwin/mesnac/common/model/Printer.java index dde11f5f..3c07a59f 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/model/Printer.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/model/Printer.java @@ -1,7 +1,8 @@ -package com.foreverwin.mesnac.meapi.model; +package com.foreverwin.mesnac.common.model; import java.io.Serializable; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.extension.activerecord.Model; import java.time.LocalDateTime; @@ -15,15 +16,15 @@ import com.baomidou.mybatisplus.annotation.IdType; *

* * @author Leon.L - * @since 2021-07-22 + * @since 2021-08-11 */ -@TableName("PRINTER") +@TableName("Z_PRINTER") public class Printer extends Model { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @TableField("HANDLE") + @TableId(value = "HANDLE", type = IdType.INPUT) private String handle; @TableField("SITE") private String site; diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/PrinterService.java b/common/src/main/java/com/foreverwin/mesnac/common/service/PrinterService.java similarity index 81% rename from meapi/src/main/java/com/foreverwin/mesnac/meapi/service/PrinterService.java rename to common/src/main/java/com/foreverwin/mesnac/common/service/PrinterService.java index 0e63e6a4..50d35fbc 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/PrinterService.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/PrinterService.java @@ -1,7 +1,7 @@ -package com.foreverwin.mesnac.meapi.service; +package com.foreverwin.mesnac.common.service; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.foreverwin.mesnac.meapi.model.Printer; +import com.foreverwin.mesnac.common.model.Printer; import com.baomidou.mybatisplus.extension.service.IService; import com.foreverwin.modular.core.util.FrontPage; @@ -13,7 +13,7 @@ import java.util.List; *

* * @author Leon.L - * @since 2021-07-22 + * @since 2021-08-11 */ public interface PrinterService extends IService { diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/PrinterServiceImpl.java b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrinterServiceImpl.java similarity index 83% rename from meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/PrinterServiceImpl.java rename to common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrinterServiceImpl.java index 3d461f85..c8ac3174 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/PrinterServiceImpl.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/service/impl/PrinterServiceImpl.java @@ -1,11 +1,11 @@ -package com.foreverwin.mesnac.meapi.service.impl; +package com.foreverwin.mesnac.common.service.impl; import com.foreverwin.modular.core.util.FrontPage; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.foreverwin.mesnac.meapi.model.Printer; -import com.foreverwin.mesnac.meapi.mapper.PrinterMapper; -import com.foreverwin.mesnac.meapi.service.PrinterService; +import com.foreverwin.mesnac.common.model.Printer; +import com.foreverwin.mesnac.common.mapper.PrinterMapper; +import com.foreverwin.mesnac.common.service.PrinterService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; @@ -18,7 +18,7 @@ import java.util.List; *

* * @author Leon.L - * @since 2021-07-22 + * @since 2021-08-11 */ @Service @Transactional(rollbackFor = Exception.class) diff --git a/meapi/src/main/resources/mapper/PrinterMapper.xml b/common/src/main/resources/mapper/PrinterMapper.xml similarity index 94% rename from meapi/src/main/resources/mapper/PrinterMapper.xml rename to common/src/main/resources/mapper/PrinterMapper.xml index 503ec683..08976fde 100644 --- a/meapi/src/main/resources/mapper/PrinterMapper.xml +++ b/common/src/main/resources/mapper/PrinterMapper.xml @@ -1,9 +1,9 @@ - + - + @@ -22,7 +22,7 @@ - SELECT FROM PRINTER + SELECT FROM Z_PRINTER HANDLE=#{ew.handle} @@ -51,7 +51,7 @@ - - INSERT INTO PRINTER + + INSERT INTO Z_PRINTER HANDLE, SITE, @@ -222,8 +222,8 @@ - - INSERT INTO PRINTER + + INSERT INTO Z_PRINTER VALUES @@ -244,7 +244,7 @@ - UPDATE PRINTER + UPDATE Z_PRINTER HANDLE=#{et.handle}, SITE=#{et.site}, PRINTER=#{et.printer}, @@ -276,7 +276,7 @@ - DELETE FROM PRINTER + DELETE FROM Z_PRINTER @@ -289,7 +289,7 @@ - DELETE FROM PRINTER + DELETE FROM Z_PRINTER diff --git a/integration/pom.xml b/integration/pom.xml index 640557f7..deeb8a22 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -36,11 +36,11 @@ com.foreverwin.mesnac - dispatch + common com.foreverwin.mesnac - common + dispatch \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/PrinterController.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/PrinterController.java deleted file mode 100644 index d189884d..00000000 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/controller/PrinterController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.foreverwin.mesnac.meapi.controller; - -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 org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import com.foreverwin.mesnac.meapi.service.PrinterService; -import com.foreverwin.mesnac.meapi.model.Printer; -import java.util.List; - -/** - * - * @author Leon.L - * @since 2021-07-22 - */ -@RestController -@RequestMapping("/PRINTER") -public class PrinterController { - - @Autowired - public PrinterService printerService; - - /** - * 根据id查询 - * - * @param id 主键 - * @return - */ - @ResponseBody - @GetMapping("/{id:.+}") - public R getPrinterById(@PathVariable String id) { - return R.ok( printerService.getById(id)); - } - - /** - * 查询所有数据 - * - * @return - */ - @ResponseBody - @GetMapping("") - public R getPrinterList(Printer printer){ - List result; - try { - String site = CommonMethods.getSite(); - printer.setSite(site); - - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.setEntity(printer); - result = printerService.list(queryWrapper); - } catch (Exception e) { - return R.failed(e.getMessage()); - } - - return R.ok(result); - } - - /** - * 分页查询数据 - * - * @param frontPage 分页信息 - * @return - */ - @ResponseBody - @GetMapping("/page") - public R page(FrontPage frontPage, Printer printer){ - IPage result; - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.setEntity(printer); - if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { - //TODO modify global query - queryWrapper.lambda().and(wrapper -> wrapper - .like(Printer::getHandle, frontPage.getGlobalQuery()) - .or().like(Printer::getSite, frontPage.getGlobalQuery()) - .or().like(Printer::getPrinter, frontPage.getGlobalQuery()) - .or().like(Printer::getDescription, frontPage.getGlobalQuery()) - .or().like(Printer::getEnabled, frontPage.getGlobalQuery()) - ); - } - result = printerService.page(frontPage.getPagePlus(), queryWrapper); - return R.ok(result); - } - - /** - * 新增 - * @param printer 传递的实体 - * @return null 失败 实体成功 - */ - @PostMapping - public R save(@RequestBody Printer printer) { - return R.ok(printerService.save(printer)); - } - - /** - * 修改 - * @param printer 传递的实体 - * @return null 失败 实体成功 - */ - @PutMapping - public R updateById(@RequestBody Printer printer) { - return R.ok(printerService.updateById(printer)); - } - - /** - * 根据id删除对象 - * @param id 实体ID - * @return 0 失败 1 成功 - */ - @ResponseBody - @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") - public R removeById(@PathVariable("id") String id){ - return R.ok(printerService.removeById(id)); - } - - /** - * 批量删除对象 - * @param ids 实体集合ID - * @return 0 失败 1 成功 - */ - @ResponseBody - @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") - public R removeByIds(List ids){ - return R.ok(printerService.removeByIds(ids)); - } -} \ No newline at end of file From 49ca453631f70827ffb4caae3c7032146c2baa32 Mon Sep 17 00:00:00 2001 From: zpl Date: Wed, 11 Aug 2021 16:57:08 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8F=AB=E6=96=99PDA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CallItemController.java | 36 ++++++++++++++++++ .../dispatch/mapper/CallItemMapper.java | 11 ++++++ .../dispatch/service/CallItemService.java | 16 ++++++++ .../service/impl/CallItemServiceImpl.java | 15 ++++++++ .../main/resources/mapper/CallItemMapper.xml | 37 +++++++++++++++---- 5 files changed, 108 insertions(+), 7 deletions(-) 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 437da2fe..61b47712 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 @@ -151,6 +151,24 @@ public class CallItemController { return R.ok("叫料操作成功"); } + /** + * 生产叫料pda + * @param callItemList + * @return + */ + @ResponseBody + @PostMapping("/callOrConfirmItemPda") + public R callOrConfirmItemPda(@RequestBody List callItemList) { + try { + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + callItemService.callOrConfirmItemPda(site, user, callItemList.get(0).getCallStatus() ,callItemList); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + return R.ok("叫料成功"); + } + @ResponseBody @PostMapping("/confirmReceive") @@ -203,6 +221,24 @@ public class CallItemController { return R.ok("刷新叫料明细成功"); } + /** + * 刷新叫料数据 + * @param callItemList + * @return + */ + @ResponseBody + @PostMapping("/refreshCallItemPda") + public R refreshCallItemPda(@RequestBody List callItemList) { + try { + String site = CommonMethods.getSite(); + String user = CommonMethods.getUser(); + callItemService.refreshCallItemPda(site, user, callItemList); + } catch (Exception e) { + return R.failed(e.getMessage()); + } + return R.ok("刷新叫料明细成功"); + } + @ResponseBody @PostMapping("/refreshRequiredTime") public R refreshRequiredTime(@RequestBody List callItemNoList) { 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 4506b694..cb1c7abf 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 @@ -40,6 +40,17 @@ public interface CallItemMapper extends BaseMapper { void updateCallItemStatusByDispatchBo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); + /** + * PDA生产叫料--修改叫料状态 + * @param status + * @param user + * @param dateTime + * @param list + */ + void updateCallItemStatusByHandle(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); + + void findRefreshCallItemPda(@Param("list") List list); + void updateCallItemStatusByCallItemNo(@Param("status") String status, @Param("user") String user, @Param("dateTime") LocalDateTime dateTime, @Param("list") List list); void refreshRequiredTime(@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 03e2fd95..00bd8193 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 @@ -76,6 +76,14 @@ public interface CallItemService extends IService { */ void callItem(String site, String user, List callItemList); + /** + * 叫料PDA + * @param site + * @param user + * @param callItemList + */ + void callOrConfirmItemPda(String site, String user, String status ,List callItemList); + /** * 确认到料 * ----需要校验叫料明细行中不允许存在叫料类型为材料,且组件物料类型为原材料的行 @@ -104,6 +112,14 @@ public interface CallItemService extends IService { */ void refreshCallItem(String site, String user, List callItemList); + /** + * 刷新叫料明细PDA + * @param site + * @param user + * @param callItemList + */ + void refreshCallItemPda(String site, String user, 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 e8a4f5fb..6e945aa4 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 @@ -154,6 +154,16 @@ public class CallItemServiceImpl extends ServiceImpl i this.updateCallItemStatusByDispatchBo(Constants.CALL_ITEM_STATUS_CALLED, user, dispatchBoList); } + @Override + public void callOrConfirmItemPda(String site, String user,String status ,List callItemList) { + LocalDateTime dateTime = LocalDateTime.now(); + List list = new ArrayList<>(); + for (CallItem callItem : callItemList) { + list.add(callItem.getHandle()); + } + callItemMapper.updateCallItemStatusByHandle(status, user, dateTime, list); + } + @Override public void confirmReceive(String site, String user, List callItemList) { if (callItemList == null || callItemList.size() <= 0) { @@ -259,6 +269,11 @@ public class CallItemServiceImpl extends ServiceImpl i } } + @Override + public void refreshCallItemPda(String site, String user, List callItemList) { + + } + @Override public void refreshRequiredTime(String site, String user, List callItemNoList) { if (callItemNoList == null || callItemNoList.size() <= 0) { diff --git a/dispatch/src/main/resources/mapper/CallItemMapper.xml b/dispatch/src/main/resources/mapper/CallItemMapper.xml index 14036eec..0132e1fb 100644 --- a/dispatch/src/main/resources/mapper/CallItemMapper.xml +++ b/dispatch/src/main/resources/mapper/CallItemMapper.xml @@ -833,6 +833,14 @@ + + UPDATE Z_CALL_ITEM SET CALL_STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} + WHERE HANDLE IN + + #{item} + + + UPDATE Z_CALL_ITEM SET STATUS = #{status}, MODIFY_USER = #{user}, MODIFIED_DATE_TIME = #{dateTime} WHERE STATUS != '804' AND CALL_ITEM_NO IN @@ -971,10 +979,10 @@ + From 338a4fbe40ae77062f9caf137b0313a2375efd77 Mon Sep 17 00:00:00 2001 From: zpl Date: Wed, 11 Aug 2021 17:45:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/PrinterController.java | 21 ++++++++++++++++++- .../mesnac/common/enums/HandleEnum.java | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) 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 17e6ee63..2ef737bb 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 @@ -4,6 +4,7 @@ package com.foreverwin.mesnac.common.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.foreverwin.mesnac.common.enums.HandleEnum; import com.foreverwin.mesnac.common.model.Printer; +import com.foreverwin.modular.core.exception.BusinessException; import com.foreverwin.modular.core.util.CommonMethods; import com.foreverwin.modular.core.util.R; import org.springframework.web.bind.annotation.RequestMapping; @@ -66,7 +67,7 @@ public class PrinterController { @ResponseBody @PostMapping("/savePrinter") - public R savePrinter(Printer printer) { + public R savePrinter(@RequestBody Printer printer) { try { LocalDateTime nowDate = LocalDateTime.now(); String site = CommonMethods.getSite(); @@ -90,4 +91,22 @@ public class PrinterController { return R.ok(); } + @ResponseBody + @PostMapping("/delPrinter") + public R delPrinter(Printer printer) { + try { + String site = CommonMethods.getSite(); + + String handle = HandleEnum.PRINT.getHandle(site, printer.getPrinter()); + Printer printerModel = printerService.getById(handle); + if (printerModel == null) { + throw BusinessException.build("请先检索再删除!"); + } else { + printerService.removeById(printerModel); + } + } catch (Exception e) { + return R.failed(e.getMessage()); + } + return R.ok(); + } } \ No newline at end of file diff --git a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java index 3e3b1ca7..1b0dbb2f 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/enums/HandleEnum.java @@ -20,7 +20,7 @@ public enum HandleEnum { /**物料清单**/ BOM("BOMBO:","BOMBO:{0},{1},{2},{3}"), - PRINT("PrintBO:", "StatusBO:{0},{1}"), + PRINT("PrintBO:", "PrintBO:{0},{1}"), /**叫料**/ CALL_ITEM("CallItemBO:", "CallItemBO:{0},{1}"),