From 96369b1a62a2218dfa27ef7dbe3e8c25649e2ed9 Mon Sep 17 00:00:00 2001 From: philip <244793088@qq.com> Date: Thu, 12 Aug 2021 16:01:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=89=8D=E5=87=86=E5=A4=87=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=A3=80=E7=B4=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/mapper/ProdReadyTaskMapper.java | 2 +- .../impl/ProdReadyTaskServiceImpl.java | 8 +- .../resources/mapper/ProdReadyTaskMapper.xml | 1 + .../controller/ItemBatchController.java | 28 +- .../mesnac/meapi/mapper/UserGroupMapper.java | 1 + .../meapi/service/UserGroupService.java | 2 + .../service/impl/UserGroupServiceImpl.java | 7 +- .../main/resources/mapper/UserGroupMapper.xml | 5 + .../controller/AccessoryLogController.java | 128 +++++ .../production/mapper/AccessoryLogMapper.java | 18 + .../mesnac/production/model/AccessoryLog.java | 280 ++++++++++ .../service/AccessoryLogService.java | 28 + .../service/impl/AccessoryLogServiceImpl.java | 46 ++ .../service/impl/PodTemplateServiceImpl.java | 4 +- .../resources/mapper/AccessoryLogMapper.xml | 482 ++++++++++++++++++ 15 files changed, 1025 insertions(+), 15 deletions(-) create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/controller/AccessoryLogController.java create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/mapper/AccessoryLogMapper.java create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/model/AccessoryLog.java create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/AccessoryLogService.java create mode 100644 production/src/main/java/com/foreverwin/mesnac/production/service/impl/AccessoryLogServiceImpl.java create mode 100644 production/src/main/resources/mapper/AccessoryLogMapper.xml diff --git a/common/src/main/java/com/foreverwin/mesnac/common/mapper/ProdReadyTaskMapper.java b/common/src/main/java/com/foreverwin/mesnac/common/mapper/ProdReadyTaskMapper.java index 1110e9c9..d061af62 100644 --- a/common/src/main/java/com/foreverwin/mesnac/common/mapper/ProdReadyTaskMapper.java +++ b/common/src/main/java/com/foreverwin/mesnac/common/mapper/ProdReadyTaskMapper.java @@ -20,7 +20,7 @@ import java.util.Map; @Repository public interface ProdReadyTaskMapper extends BaseMapper { - List getTaskList(@Param("entity")ProdReadyTask prodReadyTask, @Param("locale") String locale); + List getTaskList(@Param("entity")ProdReadyTask prodReadyTask, @Param("locale") String locale,@Param("admin") Integer admin,@Param("user") String user); ProdReadyTask loadProExecute(@Param("site")String site, @Param("taskBo")String taskBo, @Param("locale") String language); 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 5bba7756..c9dbc86f 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 @@ -23,6 +23,7 @@ import com.foreverwin.mesnac.common.util.ActiveMQUtil; import com.foreverwin.mesnac.common.util.DateUtil; import com.foreverwin.mesnac.common.util.StringUtil; import com.foreverwin.mesnac.meapi.dto.BomComponentDto; +import com.foreverwin.mesnac.meapi.mapper.UserGroupMapper; import com.foreverwin.mesnac.meapi.mapper.WorkCenterMapper; import com.foreverwin.mesnac.meapi.model.*; import com.foreverwin.mesnac.meapi.service.*; @@ -82,6 +83,8 @@ public class ProdReadyTaskServiceImpl extends ServiceImpl getTaskList(ProdReadyTask prodReadyTask) { - return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage()); + String user = CommonMethods.getUser(); + String site = CommonMethods.getSite(); + Integer admin = userGroupMapper.getUserGroupByUser(HandleEnum.USER.getHandle(site, user), new UserGroupBOHandle(site, "ADMINISTRATORS").getValue()); + return prodReadyTaskMapper.getTaskList(prodReadyTask, LocaleContextHolder.getLocale().getLanguage(),admin,user); } @Override diff --git a/common/src/main/resources/mapper/ProdReadyTaskMapper.xml b/common/src/main/resources/mapper/ProdReadyTaskMapper.xml index 662c74e7..e0d8ccc8 100644 --- a/common/src/main/resources/mapper/ProdReadyTaskMapper.xml +++ b/common/src/main/resources/mapper/ProdReadyTaskMapper.xml @@ -637,6 +637,7 @@ LEFT JOIN ITEM_T ITT ON ITT.ITEM_BO = I.HANDLE AND ITT.LOCALE =#{locale} JOIN RESRCE RES ON RES.RESRCE = zprt.RESRCE AND RES.SITE = zprt.SITE WHERE ZPRT.SITE=#{entity.site} + AND ZSD.EMPLOYEE LIKE '%${user}%' AND ZPRT.WORK_CENTER=#{entity.workCenter} AND ZPRT.RESRCE=#{entity.resrce} AND ZSD.DISPATCH_NO=#{entity.dispatchNo} diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/ItemBatchController.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/ItemBatchController.java index 4270fdc0..69b4277c 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/ItemBatchController.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/controller/ItemBatchController.java @@ -1,24 +1,24 @@ package com.foreverwin.mesnac.dispatch.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.foreverwin.mesnac.common.erp.ZprodordconfStruIn; import com.foreverwin.mesnac.common.erp.ZprodordconfStruOut; import com.foreverwin.mesnac.common.erp.holders.TableOfZprodordconfStruInHolder; import com.foreverwin.mesnac.common.erp.holders.TableOfZprodordconfStruOutHolder; import com.foreverwin.mesnac.common.util.ERPAPI; -import com.foreverwin.modular.core.util.R; -import com.foreverwin.modular.core.util.FrontPage; +import com.foreverwin.mesnac.dispatch.model.ItemBatch; +import com.foreverwin.mesnac.dispatch.service.ItemBatchService; 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.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.dispatch.service.ItemBatchService; -import com.foreverwin.mesnac.dispatch.model.ItemBatch; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.RestController; import java.math.BigDecimal; -import java.util.List; /** * @@ -32,6 +32,14 @@ public class ItemBatchController { @Autowired public ItemBatchService itemBatchService; + @ResponseBody + @GetMapping("/getItemBatch") + public R getItemBatch(ItemBatch itemBatch){ + QueryWrapper queryWrapper=new QueryWrapper<>(); + itemBatch.setSite(CommonMethods.getSite()); + queryWrapper.setEntity(itemBatch); + return R.ok(itemBatchService.list(queryWrapper)); + } /** * 分页查询数据 * diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java index b6259730..2fe80980 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/mapper/UserGroupMapper.java @@ -26,4 +26,5 @@ public interface UserGroupMapper extends BaseMapper { UserGroup getCustomFieldByGroup(@Param("site")String site, @Param("userGroup")String userGroup); + Integer getUserGroupByUser(@Param("userBO")String userBO,@Param("userGroupBO")String userGroupBO); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java index e5f1a6ba..dfcf201a 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/UserGroupService.java @@ -25,4 +25,6 @@ public interface UserGroupService extends IService { IPage selectPage(FrontPage frontPage, UserGroup userGroup); List selectList(UserGroup userGroup); + + Integer getUserGroupByUser(String userBO,String userGroupBO); } \ No newline at end of file diff --git a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java index ddb7b841..4207fb3d 100644 --- a/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java +++ b/meapi/src/main/java/com/foreverwin/mesnac/meapi/service/impl/UserGroupServiceImpl.java @@ -12,9 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.transaction.annotation.Transactional; import java.util.List; + /** *

- * 服务实现类 + * 服务实现类 *

* * @author robert @@ -42,5 +43,9 @@ public class UserGroupServiceImpl extends ServiceImpl + + diff --git a/production/src/main/java/com/foreverwin/mesnac/production/controller/AccessoryLogController.java b/production/src/main/java/com/foreverwin/mesnac/production/controller/AccessoryLogController.java new file mode 100644 index 00000000..6113085f --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/controller/AccessoryLogController.java @@ -0,0 +1,128 @@ +package com.foreverwin.mesnac.production.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.production.model.AccessoryLog; +import com.foreverwin.mesnac.production.service.AccessoryLogService; +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 java.util.List; + +/** + * + * @author Philip + * @since 2021-08-12 + */ +@RestController +@RequestMapping("/Z-ACCESSORY-LOG") +public class AccessoryLogController { + + @Autowired + public AccessoryLogService accessoryLogService; + + /** + * 根据id查询 + * + * @param id 主键 + * @return + */ + @ResponseBody + @GetMapping("/{id:.+}") + public R getAccessoryLogById(@PathVariable String id) { + return R.ok( accessoryLogService.getById(id)); + } + + /** + * 查询所有数据 + * + * @return + */ + @ResponseBody + @GetMapping("") + public R getAccessoryLogList(AccessoryLog accessoryLog){ + List result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(accessoryLog); + result = accessoryLogService.list(queryWrapper); + return R.ok(result); + } + + /** + * 分页查询数据 + * + * @param frontPage 分页信息 + * @return + */ + @ResponseBody + @GetMapping("/page") + public R page(FrontPage frontPage, AccessoryLog accessoryLog){ + IPage result; + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(accessoryLog); + if (frontPage.getGlobalQuery() != null && !"".equals(frontPage.getGlobalQuery().trim())) { + //TODO modify global query + queryWrapper.lambda().and(wrapper -> wrapper + .like(AccessoryLog::getHandle, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getSite, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getWorkCenter, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getShopOrder, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getSfc, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getOperation, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getStepId, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getResrce, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getLabel, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getBatch, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getItem, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getRevision, frontPage.getGlobalQuery()) + .or().like(AccessoryLog::getCreateUser, frontPage.getGlobalQuery()) + ); + } + result = accessoryLogService.page(frontPage.getPagePlus(), queryWrapper); + return R.ok(result); + } + + /** + * 新增 + * @param accessoryLog 传递的实体 + * @return null 失败 实体成功 + */ + @PostMapping + public R save(@RequestBody AccessoryLog accessoryLog) { + return R.ok(accessoryLogService.save(accessoryLog)); + } + + /** + * 修改 + * @param accessoryLog 传递的实体 + * @return null 失败 实体成功 + */ + @PutMapping + public R updateById(@RequestBody AccessoryLog accessoryLog) { + return R.ok(accessoryLogService.updateById(accessoryLog)); + } + + /** + * 根据id删除对象 + * @param id 实体ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.DELETE, value = "/{id:.+}") + public R removeById(@PathVariable("id") String id){ + return R.ok(accessoryLogService.removeById(id)); + } + + /** + * 批量删除对象 + * @param ids 实体集合ID + * @return 0 失败 1 成功 + */ + @ResponseBody + @RequestMapping(method = RequestMethod.POST, value = "/delete-batch") + public R removeByIds(List ids){ + return R.ok(accessoryLogService.removeByIds(ids)); + } +} \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/mapper/AccessoryLogMapper.java b/production/src/main/java/com/foreverwin/mesnac/production/mapper/AccessoryLogMapper.java new file mode 100644 index 00000000..980b27ce --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/mapper/AccessoryLogMapper.java @@ -0,0 +1,18 @@ +package com.foreverwin.mesnac.production.mapper; + +import com.foreverwin.mesnac.production.model.AccessoryLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 辅料使用记录表 Mapper 接口 + *

+ * + * @author Philip + * @since 2021-08-12 + */ +@Repository +public interface AccessoryLogMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/model/AccessoryLog.java b/production/src/main/java/com/foreverwin/mesnac/production/model/AccessoryLog.java new file mode 100644 index 00000000..a6f19ad3 --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/model/AccessoryLog.java @@ -0,0 +1,280 @@ +package com.foreverwin.mesnac.production.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.activerecord.Model; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 辅料使用记录表 + *

+ * + * @author Philip + * @since 2021-08-12 + */ + +@TableName("Z_ACCESSORY_LOG") + +public class AccessoryLog extends Model { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "HANDLE", type = IdType.INPUT) + private String handle; + /** + * 站点 + */ + @TableField("SITE") + private String site; + /** + * 车间 + */ + @TableField("WORK_CENTER") + private String workCenter; + /** + * 工单 + */ + @TableField("SHOP_ORDER") + private String shopOrder; + /** + * 产品条码 + */ + @TableField("SFC") + private String sfc; + /** + * 工序 + */ + @TableField("OPERATION") + private String operation; + /** + * 步骤 + */ + @TableField("STEP_ID") + private String stepId; + /** + * 资源 + */ + @TableField("RESRCE") + private String resrce; + /** + * 标签 + */ + @TableField("LABEL") + private String label; + /** + * 批次 + */ + @TableField("BATCH") + private String batch; + /** + * 物料 + */ + @TableField("ITEM") + private String item; + /** + * 物料版本 + */ + @TableField("REVISION") + private String revision; + /** + * 使用数量 + */ + @TableField("QTY") + private Double qty; + /** + * 创建人 + */ + @TableField("CREATE_USER") + private String createUser; + /** + * 创建时间 + */ + @TableField("CREATED_DATE_TIME") + private LocalDateTime createdDateTime; + + + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public String getSite() { + return site; + } + + public void setSite(String site) { + this.site = site; + } + + public String getWorkCenter() { + return workCenter; + } + + public void setWorkCenter(String workCenter) { + this.workCenter = workCenter; + } + + public String getShopOrder() { + return shopOrder; + } + + public void setShopOrder(String shopOrder) { + this.shopOrder = shopOrder; + } + + public String getSfc() { + return sfc; + } + + public void setSfc(String sfc) { + this.sfc = sfc; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getStepId() { + return stepId; + } + + public void setStepId(String stepId) { + this.stepId = stepId; + } + + public String getResrce() { + return resrce; + } + + public void setResrce(String resrce) { + this.resrce = resrce; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getBatch() { + return batch; + } + + public void setBatch(String batch) { + this.batch = batch; + } + + public String getItem() { + return item; + } + + public void setItem(String item) { + this.item = item; + } + + public String getRevision() { + return revision; + } + + public void setRevision(String revision) { + this.revision = revision; + } + + public Double getQty() { + return qty; + } + + public void setQty(Double qty) { + this.qty = qty; + } + + public String getCreateUser() { + return createUser; + } + + public void setCreateUser(String createUser) { + this.createUser = createUser; + } + + public LocalDateTime getCreatedDateTime() { + return createdDateTime; + } + + public void setCreatedDateTime(LocalDateTime createdDateTime) { + this.createdDateTime = createdDateTime; + } + +public static final String HANDLE = "HANDLE"; + +public static final String SITE = "SITE"; + +public static final String WORK_CENTER = "WORK_CENTER"; + +public static final String SHOP_ORDER = "SHOP_ORDER"; + +public static final String SFC = "SFC"; + +public static final String OPERATION = "OPERATION"; + +public static final String STEP_ID = "STEP_ID"; + +public static final String RESRCE = "RESRCE"; + +public static final String LABEL = "LABEL"; + +public static final String BATCH = "BATCH"; + +public static final String ITEM = "ITEM"; + +public static final String REVISION = "REVISION"; + +public static final String QTY = "QTY"; + +public static final String CREATE_USER = "CREATE_USER"; + +public static final String CREATED_DATE_TIME = "CREATED_DATE_TIME"; + + + @Override + protected Serializable pkVal() { + return this.handle; + } + + @Override + public String toString() { + return "AccessoryLog{" + + "handle = " + handle + + ", site = " + site + + ", workCenter = " + workCenter + + ", shopOrder = " + shopOrder + + ", sfc = " + sfc + + ", operation = " + operation + + ", stepId = " + stepId + + ", resrce = " + resrce + + ", label = " + label + + ", batch = " + batch + + ", item = " + item + + ", revision = " + revision + + ", qty = " + qty + + ", createUser = " + createUser + + ", createdDateTime = " + createdDateTime + + "}"; + } +} \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/AccessoryLogService.java b/production/src/main/java/com/foreverwin/mesnac/production/service/AccessoryLogService.java new file mode 100644 index 00000000..d2da0aaa --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/AccessoryLogService.java @@ -0,0 +1,28 @@ +package com.foreverwin.mesnac.production.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.foreverwin.mesnac.production.model.AccessoryLog; +import com.baomidou.mybatisplus.extension.service.IService; +import com.foreverwin.modular.core.util.FrontPage; + +import java.util.List; + +/** + *

+ * 辅料使用记录表 服务类 + *

+ * + * @author Philip + * @since 2021-08-12 + */ +public interface AccessoryLogService extends IService { + + /** + * 分页查询 + * @param frontPage + * @return + */ + IPage selectPage(FrontPage frontPage, AccessoryLog accessoryLog); + + List selectList(AccessoryLog accessoryLog); +} \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/AccessoryLogServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/AccessoryLogServiceImpl.java new file mode 100644 index 00000000..4df573e1 --- /dev/null +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/AccessoryLogServiceImpl.java @@ -0,0 +1,46 @@ +package com.foreverwin.mesnac.production.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.production.model.AccessoryLog; +import com.foreverwin.mesnac.production.mapper.AccessoryLogMapper; +import com.foreverwin.mesnac.production.service.AccessoryLogService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +/** + *

+ * 辅料使用记录表 服务实现类 + *

+ * + * @author Philip + * @since 2021-08-12 + */ +@Service +@Transactional(rollbackFor = Exception.class) +public class AccessoryLogServiceImpl extends ServiceImpl implements AccessoryLogService { + + + @Autowired + private AccessoryLogMapper accessoryLogMapper; + + @Override + public IPage selectPage(FrontPage frontPage, AccessoryLog accessoryLog) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(accessoryLog); + return super.page(frontPage.getPagePlus(), queryWrapper); + } + + @Override + public List selectList(AccessoryLog accessoryLog) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.setEntity(accessoryLog); + return super.list(queryWrapper); + } + + +} \ No newline at end of file diff --git a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java index 0fb83bc6..1f9e1c00 100644 --- a/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java +++ b/production/src/main/java/com/foreverwin/mesnac/production/service/impl/PodTemplateServiceImpl.java @@ -332,7 +332,7 @@ public class PodTemplateServiceImpl implements PodTemplateService { } } //报工 - //sendErp(postMapList); + sendErp(postMapList); } public void materialConsumption(String site, String operation, String sfcBo, String stepId, String resource) { @@ -468,7 +468,7 @@ public class PodTemplateServiceImpl implements PodTemplateService { struOut.setAufnr(""); struOut.setVornr(""); struOut.setAueru("1"); - struOut.setLmnga(new BigDecimal(1)); + struOut.setLmnga(BigDecimal.ZERO); struOut.setRet(""); struOut.setMsg(""); outs[0] = struOut; diff --git a/production/src/main/resources/mapper/AccessoryLogMapper.xml b/production/src/main/resources/mapper/AccessoryLogMapper.xml new file mode 100644 index 00000000..d1c7e4ab --- /dev/null +++ b/production/src/main/resources/mapper/AccessoryLogMapper.xml @@ -0,0 +1,482 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + HANDLE, SITE, WORK_CENTER, SHOP_ORDER, SFC, OPERATION, STEP_ID, RESRCE, LABEL, BATCH, ITEM, REVISION, QTY, CREATE_USER, CREATED_DATE_TIME + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO Z_ACCESSORY_LOG + + HANDLE, + SITE, + WORK_CENTER, + SHOP_ORDER, + SFC, + OPERATION, + STEP_ID, + RESRCE, + LABEL, + BATCH, + ITEM, + REVISION, + QTY, + CREATE_USER, + CREATED_DATE_TIME, + VALUES + + #{handle}, + #{site}, + #{workCenter}, + #{shopOrder}, + #{sfc}, + #{operation}, + #{stepId}, + #{resrce}, + #{label}, + #{batch}, + #{item}, + #{revision}, + #{qty}, + #{createUser}, + #{createdDateTime}, + + + + + INSERT INTO Z_ACCESSORY_LOG + + + VALUES + + #{handle}, + #{site}, + #{workCenter}, + #{shopOrder}, + #{sfc}, + #{operation}, + #{stepId}, + #{resrce}, + #{label}, + #{batch}, + #{item}, + #{revision}, + #{qty}, + #{createUser}, + #{createdDateTime}, + + + + + + UPDATE Z_ACCESSORY_LOG + SITE=#{et.site}, + WORK_CENTER=#{et.workCenter}, + SHOP_ORDER=#{et.shopOrder}, + SFC=#{et.sfc}, + OPERATION=#{et.operation}, + STEP_ID=#{et.stepId}, + RESRCE=#{et.resrce}, + LABEL=#{et.label}, + BATCH=#{et.batch}, + ITEM=#{et.item}, + REVISION=#{et.revision}, + QTY=#{et.qty}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_ACCESSORY_LOG + SITE=#{et.site}, + WORK_CENTER=#{et.workCenter}, + SHOP_ORDER=#{et.shopOrder}, + SFC=#{et.sfc}, + OPERATION=#{et.operation}, + STEP_ID=#{et.stepId}, + RESRCE=#{et.resrce}, + LABEL=#{et.label}, + BATCH=#{et.batch}, + ITEM=#{et.item}, + REVISION=#{et.revision}, + QTY=#{et.qty}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + WHERE HANDLE=#{et.handle} and ${et.MP_OPTLOCK_VERSION_COLUMN}=#{et.MP_OPTLOCK_VERSION_ORIGINAL} + + + + + UPDATE Z_ACCESSORY_LOG + SITE=#{et.site}, + WORK_CENTER=#{et.workCenter}, + SHOP_ORDER=#{et.shopOrder}, + SFC=#{et.sfc}, + OPERATION=#{et.operation}, + STEP_ID=#{et.stepId}, + RESRCE=#{et.resrce}, + LABEL=#{et.label}, + BATCH=#{et.batch}, + ITEM=#{et.item}, + REVISION=#{et.revision}, + QTY=#{et.qty}, + CREATE_USER=#{et.createUser}, + CREATED_DATE_TIME=#{et.createdDateTime}, + + + + + HANDLE=#{ew.entity.handle} + AND SITE=#{ew.entity.site} + AND WORK_CENTER=#{ew.entity.workCenter} + AND SHOP_ORDER=#{ew.entity.shopOrder} + AND SFC=#{ew.entity.sfc} + AND OPERATION=#{ew.entity.operation} + AND STEP_ID=#{ew.entity.stepId} + AND RESRCE=#{ew.entity.resrce} + AND LABEL=#{ew.entity.label} + AND BATCH=#{ew.entity.batch} + AND ITEM=#{ew.entity.item} + AND REVISION=#{ew.entity.revision} + AND QTY=#{ew.entity.qty} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_ACCESSORY_LOG WHERE HANDLE=#{handle} + + + + DELETE FROM Z_ACCESSORY_LOG + + + + + ${k} = #{cm[${k}]} + + + + + + + + DELETE FROM Z_ACCESSORY_LOG + + + + + HANDLE=#{ew.entity.handle} + + AND SITE=#{ew.entity.site} + AND WORK_CENTER=#{ew.entity.workCenter} + AND SHOP_ORDER=#{ew.entity.shopOrder} + AND SFC=#{ew.entity.sfc} + AND OPERATION=#{ew.entity.operation} + AND STEP_ID=#{ew.entity.stepId} + AND RESRCE=#{ew.entity.resrce} + AND LABEL=#{ew.entity.label} + AND BATCH=#{ew.entity.batch} + AND ITEM=#{ew.entity.item} + AND REVISION=#{ew.entity.revision} + AND QTY=#{ew.entity.qty} + AND CREATE_USER=#{ew.entity.createUser} + AND CREATED_DATE_TIME=#{ew.entity.createdDateTime} + + + ${ew.sqlSegment} + + + + + ${ew.sqlSegment} + + + + + DELETE FROM Z_ACCESSORY_LOG WHERE HANDLE IN ( + #{item} + ) + + + +