From 5f5d7234dd98684c286e5984ffa78b5bc3c3e1cb Mon Sep 17 00:00:00 2001 From: admin <15939171744@163.com> Date: 星期五, 22 十一月 2024 09:37:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- billion-main/src/main/resources/mapper/om/OmOrderSchedulingMapper.xml | 105 ++ billion-ui/src/api/main/om/info.js | 51 + billion-admin/src/main/resources/application.yml | 4 billion-main/src/main/java/com/billion/main/om/service/IOmProductionOrderInfoService.java | 63 + billion-main/src/main/java/com/billion/main/om/mapper/OmProductionOrderInfoMapper.java | 64 + billion-ui/src/views/main/om/info/index.vue | 506 +++++++++++++ billion-main/src/main/java/com/billion/main/common/BaseEntity.java | 10 billion-main/src/main/java/com/billion/main/om/domain/OmOrderScheduling.java | 58 + billion-main/src/main/java/com/billion/main/om/service/IOmOrderSchedulingService.java | 64 + billion-framework/src/main/java/com/billion/framework/config/MybatisPlusConfig.java | 8 billion-main/src/main/java/com/billion/main/om/service/impl/OmOrderSchedulingServiceImpl.java | 123 +++ billion-main/src/main/java/com/billion/main/om/controller/OmOrderSchedulingController.java | 98 ++ billion-ui/src/api/main/om/scheduling.js | 44 + billion-framework/src/main/java/com/billion/framework/config/MyMetaObjectHandler.java | 74 ++ billion-main/src/main/java/com/billion/main/common/Constant.java | 7 billion-ui/src/views/main/om/scheduling/index.vue | 424 +++++++++++ billion-main/src/main/java/com/billion/main/da/controller/DaParamCollectionController.java | 3 billion-main/src/main/java/com/billion/main/om/domain/OmProductionOrderInfo.java | 57 + billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml | 112 +++ billion-main/src/main/java/com/billion/main/om/controller/OmProductionOrderInfoController.java | 106 ++ billion-main/src/main/java/com/billion/main/om/service/impl/OmProductionOrderInfoServiceImpl.java | 126 +++ billion-main/src/main/java/com/billion/main/om/mapper/OmOrderSchedulingMapper.java | 64 + 22 files changed, 2,167 insertions(+), 4 deletions(-) diff --git a/billion-admin/src/main/resources/application.yml b/billion-admin/src/main/resources/application.yml index 61c74a1..f798e77 100644 --- a/billion-admin/src/main/resources/application.yml +++ b/billion-admin/src/main/resources/application.yml @@ -141,9 +141,9 @@ capitalMode: false logicDeleteField: del_flag # 閫昏緫宸插垹闄ゅ�� - logicDeleteValue: 1 + logicDeleteValue: "1" # 閫昏緫鏈垹闄ゅ�� - logicNotDeleteValue: 0 + logicNotDeleteValue: "0" insertStrategy: NOT_NULL updateStrategy: NOT_NULL diff --git a/billion-framework/src/main/java/com/billion/framework/config/MyMetaObjectHandler.java b/billion-framework/src/main/java/com/billion/framework/config/MyMetaObjectHandler.java new file mode 100644 index 0000000..4629157 --- /dev/null +++ b/billion-framework/src/main/java/com/billion/framework/config/MyMetaObjectHandler.java @@ -0,0 +1,74 @@ +package com.billion.framework.config; + +import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler; +import com.billion.common.core.domain.model.LoginUser; +import com.billion.common.utils.SecurityUtils; +import com.billion.common.utils.StringUtils; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.ibatis.reflection.MetaObject; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 绠�浠嬭鏄�:Mybatis-Plus閰嶇疆 + * + * @author: Eric + * @date: 2024-11-20 15:46:49 + * @version: 1.0 + */ +@Component +public class MyMetaObjectHandler implements MetaObjectHandler{ + + @Override + public void insertFill(MetaObject metaObject) { + // 妫�鏌ユ槸鍚︽湁鍚嶄负createTime鐨勫瓧娈碉紝濡傛灉鏈夊垯璁剧疆褰撳墠鏃堕棿 + boolean hasCreateTime = metaObject.hasSetter("createTime"); + if (hasCreateTime) { + metaObject.setValue("createTime", new Date()); + } + + // 妫�鏌ユ槸鍚︽湁鍚嶄负updateTime鐨勫瓧娈碉紝濡傛灉鏈夊垯璁剧疆褰撳墠鏃堕棿 + boolean hasUpdateTime = metaObject.hasSetter("updateTime"); + if (hasUpdateTime) { + metaObject.setValue("updateTime", new Date()); + } + + LoginUser securityUser = SecurityUtils.getLoginUser(); + if (ObjectUtils.isNotEmpty(securityUser)){ + String username = securityUser.getUsername(); + if (StringUtils.isNoneBlank(username)){ + boolean hasCreateBy = metaObject.hasSetter("createBy"); + if (hasCreateBy){ + metaObject.setValue("createBy", username); + } + boolean hasUpdateBy = metaObject.hasSetter("updateBy"); + if (hasUpdateBy){ + metaObject.setValue("updateBy", username); + } + } + } + + } + + @Override + public void updateFill(MetaObject metaObject) { + // 妫�鏌ユ槸鍚︽湁鍚嶄负updateTime鐨勫瓧娈碉紝濡傛灉鏈夊垯璁剧疆褰撳墠鏃堕棿 + boolean hasUpdateTime = metaObject.hasSetter("updateTime"); + if (hasUpdateTime) { + metaObject.setValue("updateTime", new Date()); + } + + LoginUser securityUser = SecurityUtils.getLoginUser(); + if (ObjectUtils.isNotEmpty(securityUser)){ + String username = securityUser.getUsername(); + if (StringUtils.isNoneBlank(username)){ + boolean hasUpdateBy = metaObject.hasSetter("updateBy"); + if (hasUpdateBy){ + metaObject.setValue("updateBy", username); + } + } + } + } +} diff --git a/billion-framework/src/main/java/com/billion/framework/config/MybatisPlusConfig.java b/billion-framework/src/main/java/com/billion/framework/config/MybatisPlusConfig.java index 8624f3e..3ea6776 100644 --- a/billion-framework/src/main/java/com/billion/framework/config/MybatisPlusConfig.java +++ b/billion-framework/src/main/java/com/billion/framework/config/MybatisPlusConfig.java @@ -1,6 +1,7 @@ package com.billion.framework.config; import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor; @@ -31,6 +32,13 @@ return interceptor; } + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MyMetaObjectHandler()); // 璁剧疆MetaObjectHandler + return globalConfig; + } + /** * 鍒嗛〉鎻掍欢锛岃嚜鍔ㄨ瘑鍒暟鎹簱绫诲瀷 https://baomidou.com/guide/interceptor-pagination.html */ diff --git a/billion-main/src/main/java/com/billion/main/common/BaseEntity.java b/billion-main/src/main/java/com/billion/main/common/BaseEntity.java index 48f8fb5..6c475e4 100644 --- a/billion-main/src/main/java/com/billion/main/common/BaseEntity.java +++ b/billion-main/src/main/java/com/billion/main/common/BaseEntity.java @@ -1,6 +1,9 @@ package com.billion.main.common; +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableLogic; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; @@ -18,20 +21,25 @@ private Long id; /** 鍒涘缓鑰� */ + @TableField(fill = FieldFill.INSERT) private String createBy; /** 鍒涘缓鏃堕棿 */ + @TableField(fill = FieldFill.INSERT) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 鏇存柊鑰� */ + @TableField(fill = FieldFill.INSERT_UPDATE) private String updateBy; /** 鏇存柊鏃堕棿 */ + @TableField(fill = FieldFill.INSERT_UPDATE) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; - private Integer deleted; + @TableLogic + private String delFlag; } diff --git a/billion-main/src/main/java/com/billion/main/common/Constant.java b/billion-main/src/main/java/com/billion/main/common/Constant.java index ed04164..b5fea09 100644 --- a/billion-main/src/main/java/com/billion/main/common/Constant.java +++ b/billion-main/src/main/java/com/billion/main/common/Constant.java @@ -10,4 +10,11 @@ public class Constant { + /** + * 宸ュ崟鐘舵�侊紙1鏈紑濮�2鐢熶骇涓�3宸插畬鎴�4宸插叧闂級 + */ + public static final String ORDER_STATUS_NOT_START = "1"; + public static final String ORDER_STATUS_IN_PRODUCT = "2"; + public static final String ORDER_STATUS_FINISHED = "3"; + public static final String ORDER_STATUS_CLOSED = "4"; } diff --git a/billion-main/src/main/java/com/billion/main/da/controller/DaParamCollectionController.java b/billion-main/src/main/java/com/billion/main/da/controller/DaParamCollectionController.java index bd155b6..de0e16b 100644 --- a/billion-main/src/main/java/com/billion/main/da/controller/DaParamCollectionController.java +++ b/billion-main/src/main/java/com/billion/main/da/controller/DaParamCollectionController.java @@ -2,6 +2,8 @@ import java.util.List; import javax.servlet.http.HttpServletResponse; + +import com.billion.main.da.service.IDaParamCollectionService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -17,7 +19,6 @@ import com.billion.common.core.domain.AjaxResult; import com.billion.common.enums.BusinessType; import com.billion.main.da.domain.DaParamCollection; -import com.billion.main.da.service.IDaParamCollectionService; import com.billion.common.utils.poi.ExcelUtil; import com.billion.common.core.page.TableDataInfo; diff --git a/billion-main/src/main/java/com/billion/main/om/controller/OmOrderSchedulingController.java b/billion-main/src/main/java/com/billion/main/om/controller/OmOrderSchedulingController.java new file mode 100644 index 0000000..3cc3237 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/controller/OmOrderSchedulingController.java @@ -0,0 +1,98 @@ +package com.billion.main.om.controller; + +import com.billion.common.annotation.Log; +import com.billion.common.core.controller.BaseController; +import com.billion.common.core.domain.AjaxResult; +import com.billion.common.core.page.TableDataInfo; +import com.billion.common.enums.BusinessType; +import com.billion.common.utils.poi.ExcelUtil; +import com.billion.main.om.domain.OmOrderScheduling; +import com.billion.main.om.service.IOmOrderSchedulingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 璁㈠崟鎺掍骇Controller + * + * @author Billion + * @date 2024-11-20 + */ +@RestController +@RequestMapping("/main/scheduling") +public class OmOrderSchedulingController extends BaseController +{ + @Autowired + private IOmOrderSchedulingService omOrderSchedulingService; + + /** + * 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:list')") + @GetMapping("/list") + public TableDataInfo list(OmOrderScheduling omOrderScheduling) + { + startPage(); + List<OmOrderScheduling> list = omOrderSchedulingService.selectOmOrderSchedulingList(omOrderScheduling); + return getDataTable(list); + } + + /** + * 瀵煎嚭璁㈠崟鎺掍骇鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:export')") + @Log(title = "璁㈠崟鎺掍骇", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, OmOrderScheduling omOrderScheduling) + { + List<OmOrderScheduling> list = omOrderSchedulingService.selectOmOrderSchedulingList(omOrderScheduling); + ExcelUtil<OmOrderScheduling> util = new ExcelUtil<OmOrderScheduling>(OmOrderScheduling.class); + util.exportExcel(response, list, "璁㈠崟鎺掍骇鏁版嵁"); + } + + /** + * 鑾峰彇璁㈠崟鎺掍骇璇︾粏淇℃伅 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(omOrderSchedulingService.selectOmOrderSchedulingById(id)); + } + + /** + * 鏂板璁㈠崟鎺掍骇 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:add')") + @Log(title = "璁㈠崟鎺掍骇", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody OmOrderScheduling omOrderScheduling) + { + return toAjax(omOrderSchedulingService.insertOmOrderScheduling(omOrderScheduling)); + } + + /** + * 淇敼璁㈠崟鎺掍骇 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:edit')") + @Log(title = "璁㈠崟鎺掍骇", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody OmOrderScheduling omOrderScheduling) + { + return toAjax(omOrderSchedulingService.updateOmOrderScheduling(omOrderScheduling)); + } + + /** + * 鍒犻櫎璁㈠崟鎺掍骇 + */ + @PreAuthorize("@ss.hasPermi('main:scheduling:remove')") + @Log(title = "璁㈠崟鎺掍骇", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(omOrderSchedulingService.deleteOmOrderSchedulingByIds(ids)); + } +} diff --git a/billion-main/src/main/java/com/billion/main/om/controller/OmProductionOrderInfoController.java b/billion-main/src/main/java/com/billion/main/om/controller/OmProductionOrderInfoController.java new file mode 100644 index 0000000..510304b --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/controller/OmProductionOrderInfoController.java @@ -0,0 +1,106 @@ +package com.billion.main.om.controller; + +import com.billion.common.annotation.Log; +import com.billion.common.core.controller.BaseController; +import com.billion.common.core.domain.AjaxResult; +import com.billion.common.core.domain.R; +import com.billion.common.core.page.TableDataInfo; +import com.billion.common.enums.BusinessType; +import com.billion.common.utils.poi.ExcelUtil; +import com.billion.main.om.domain.OmProductionOrderInfo; +import com.billion.main.om.service.IOmProductionOrderInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 鐢熶骇宸ュ崟Controller + * + * @author Billion + * @date 2024-11-20 + */ +@RestController +@RequestMapping("/main/info") +public class OmProductionOrderInfoController extends BaseController +{ + @Autowired + private IOmProductionOrderInfoService OmProductionOrderInfoService; + + /** + * 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('main:info:list')") + @GetMapping("/list") + public TableDataInfo list(OmProductionOrderInfo OmProductionOrderInfo) + { + startPage(); + List<OmProductionOrderInfo> list = OmProductionOrderInfoService.selectOmProductionOrderInfoList(OmProductionOrderInfo); + return getDataTable(list); + } + + @GetMapping("/getOrderList") + public R getOrderList(){ + List<String> collect = OmProductionOrderInfoService.list().stream().map(OmProductionOrderInfo::getWorkOrderNo).collect(Collectors.toList()); + return R.ok(collect); + } + + /** + * 瀵煎嚭鐢熶骇宸ュ崟鍒楄〃 + */ + @PreAuthorize("@ss.hasPermi('main:info:export')") + @Log(title = "鐢熶骇宸ュ崟", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, OmProductionOrderInfo OmProductionOrderInfo) + { + List<OmProductionOrderInfo> list = OmProductionOrderInfoService.selectOmProductionOrderInfoList(OmProductionOrderInfo); + ExcelUtil<OmProductionOrderInfo> util = new ExcelUtil<OmProductionOrderInfo>(OmProductionOrderInfo.class); + util.exportExcel(response, list, "鐢熶骇宸ュ崟鏁版嵁"); + } + + /** + * 鑾峰彇鐢熶骇宸ュ崟璇︾粏淇℃伅 + */ + @PreAuthorize("@ss.hasPermi('main:info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(OmProductionOrderInfoService.selectOmProductionOrderInfoById(id)); + } + + /** + * 鏂板鐢熶骇宸ュ崟 + */ + @PreAuthorize("@ss.hasPermi('main:info:add')") + @Log(title = "鐢熶骇宸ュ崟", businessType = BusinessType.INSERT) + @PostMapping + public void add(@RequestBody OmProductionOrderInfo OmProductionOrderInfo) + { + OmProductionOrderInfoService.insertOmProductionOrderInfo(OmProductionOrderInfo); + } + + /** + * 淇敼鐢熶骇宸ュ崟 + */ + @PreAuthorize("@ss.hasPermi('main:info:edit')") + @Log(title = "鐢熶骇宸ュ崟", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody OmProductionOrderInfo OmProductionOrderInfo) + { + return toAjax(OmProductionOrderInfoService.updateOmProductionOrderInfo(OmProductionOrderInfo)); + } + + /** + * 鍒犻櫎鐢熶骇宸ュ崟 + */ + @PreAuthorize("@ss.hasPermi('main:info:remove')") + @Log(title = "鐢熶骇宸ュ崟", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(OmProductionOrderInfoService.deleteOmProductionOrderInfoByIds(ids)); + } +} diff --git a/billion-main/src/main/java/com/billion/main/om/domain/OmOrderScheduling.java b/billion-main/src/main/java/com/billion/main/om/domain/OmOrderScheduling.java new file mode 100644 index 0000000..5280618 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/domain/OmOrderScheduling.java @@ -0,0 +1,58 @@ +package com.billion.main.om.domain; + +import com.billion.common.annotation.Excel; +import com.billion.common.core.domain.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 璁㈠崟鎺掍骇瀵硅薄 om_order_scheduling + * + * @author Billion + * @date 2024-11-20 + */ +@Data +public class OmOrderScheduling extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** ID */ + private Long id; + + /** 宸ュ崟缂栧彿 */ + @Excel(name = "宸ュ崟缂栧彿") + private String workOrderNo; + + /** 鎬绘垚搴忓垪鍙� */ + @Excel(name = "鎬绘垚搴忓垪鍙�") + private String sfcCode; + + /** 浜у搧缂栫爜 */ + @Excel(name = "浜у搧缂栫爜") + private String productCode; + + /** 涓婄嚎鏃堕棿 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "涓婄嚎鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date onlineTime; + + /** 涓嬬嚎鏃堕棿 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "涓嬬嚎鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date offlineTime; + + /** 璐ㄩ噺鐘舵��(1鍚堟牸锛�2涓嶅悎鏍�) */ + @Excel(name = "璐ㄩ噺鐘舵��(1鍚堟牸锛�2涓嶅悎鏍�)") + private String qualityStatus; + + /** 鐘舵��(1鏈紑濮嬶紝2鎵ц涓紝3宸插畬鎴�) */ + @Excel(name = "鐘舵��(1鏈紑濮嬶紝2鎵ц涓紝3宸插畬鎴�)") + private String status; + + /** 澶囨敞 */ + @Excel(name = "澶囨敞") + private String remarks; + +} diff --git a/billion-main/src/main/java/com/billion/main/om/domain/OmProductionOrderInfo.java b/billion-main/src/main/java/com/billion/main/om/domain/OmProductionOrderInfo.java new file mode 100644 index 0000000..6857122 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/domain/OmProductionOrderInfo.java @@ -0,0 +1,57 @@ +package com.billion.main.om.domain; + +import com.billion.common.annotation.Excel; +import com.billion.main.common.BaseEntity; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 鐢熶骇宸ュ崟瀵硅薄 om_production_order_info + * + * @author Billion + * @date 2024-11-20 + */ +@Data +public class OmProductionOrderInfo extends BaseEntity +{ + /** 宸ュ崟缂栧彿 */ + @Excel(name = "宸ュ崟缂栧彿") + private String workOrderNo; + + /** 璁㈠崟缂栧彿 */ + @Excel(name = "璁㈠崟缂栧彿") + private String salesOrderCode; + + /** 浜у搧缂栧彿 */ + @Excel(name = "浜у搧缂栧彿") + private String productCode; + + /** 浜х嚎缂栧彿 */ + @Excel(name = "浜х嚎缂栧彿") + private String lineCode; + + /** 璁″垝鏁伴噺 */ + @Excel(name = "璁″垝鏁伴噺") + private Long planQty; + + /** 璁″垝寮�濮嬫椂闂� */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "璁″垝寮�濮嬫椂闂�", width = 30, dateFormat = "yyyy-MM-dd") + private Date planStartTime; + + /** 璁″垝缁撴潫鏃堕棿 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "璁″垝缁撴潫鏃堕棿", width = 30, dateFormat = "yyyy-MM-dd") + private Date planEndTime; + + /** 宸ュ崟鐘舵�侊紙1鏈紑濮�2鐢熶骇涓�3宸插畬鎴�4宸插叧闂級 */ + @Excel(name = "宸ュ崟鐘舵��", readConverterExp = "1=鏈紑濮�2鐢熶骇涓�3宸插畬鎴�4宸插叧闂�") + private String orderStatus; + + /** 澶囨敞 */ + @Excel(name = "澶囨敞") + private String remarks; + +} diff --git a/billion-main/src/main/java/com/billion/main/om/mapper/OmOrderSchedulingMapper.java b/billion-main/src/main/java/com/billion/main/om/mapper/OmOrderSchedulingMapper.java new file mode 100644 index 0000000..007a301 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/mapper/OmOrderSchedulingMapper.java @@ -0,0 +1,64 @@ +package com.billion.main.om.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.billion.main.om.domain.OmOrderScheduling; + +import java.util.List; + +/** + * 璁㈠崟鎺掍骇Mapper鎺ュ彛 + * + * @author Billion + * @date 2024-11-20 + */ +public interface OmOrderSchedulingMapper extends BaseMapper<OmOrderScheduling> +{ + /** + * 鏌ヨ璁㈠崟鎺掍骇 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 璁㈠崟鎺掍骇 + */ + public OmOrderScheduling selectOmOrderSchedulingById(Long id); + + /** + * 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 璁㈠崟鎺掍骇闆嗗悎 + */ + public List<OmOrderScheduling> selectOmOrderSchedulingList(OmOrderScheduling omOrderScheduling); + + /** + * 鏂板璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + public int insertOmOrderScheduling(OmOrderScheduling omOrderScheduling); + + /** + * 淇敼璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + public int updateOmOrderScheduling(OmOrderScheduling omOrderScheduling); + + /** + * 鍒犻櫎璁㈠崟鎺掍骇 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 缁撴灉 + */ + public int deleteOmOrderSchedulingById(Long id); + + /** + * 鎵归噺鍒犻櫎璁㈠崟鎺掍骇 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteOmOrderSchedulingByIds(Long[] ids); +} diff --git a/billion-main/src/main/java/com/billion/main/om/mapper/OmProductionOrderInfoMapper.java b/billion-main/src/main/java/com/billion/main/om/mapper/OmProductionOrderInfoMapper.java new file mode 100644 index 0000000..00b8ddf --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/mapper/OmProductionOrderInfoMapper.java @@ -0,0 +1,64 @@ +package com.billion.main.om.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.billion.main.om.domain.OmProductionOrderInfo; + +import java.util.List; + +/** + * 鐢熶骇宸ュ崟Mapper鎺ュ彛 + * + * @author Billion + * @date 2024-11-20 + */ +public interface OmProductionOrderInfoMapper extends BaseMapper<OmProductionOrderInfo> +{ + /** + * 鏌ヨ鐢熶骇宸ュ崟 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 鐢熶骇宸ュ崟 + */ + public OmProductionOrderInfo selectOmProductionOrderInfoById(Long id); + + /** + * 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 + * + * @param omProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 鐢熶骇宸ュ崟闆嗗悎 + */ + public List<OmProductionOrderInfo> selectOmProductionOrderInfoList(OmProductionOrderInfo omProductionOrderInfo); + + /** + * 鏂板鐢熶骇宸ュ崟 + * + * @param omProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 缁撴灉 + */ + public int insertOmProductionOrderInfo(OmProductionOrderInfo omProductionOrderInfo); + + /** + * 淇敼鐢熶骇宸ュ崟 + * + * @param omProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 缁撴灉 + */ + public int updateOmProductionOrderInfo(OmProductionOrderInfo omProductionOrderInfo); + + /** + * 鍒犻櫎鐢熶骇宸ュ崟 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 缁撴灉 + */ + public int deleteOmProductionOrderInfoById(Long id); + + /** + * 鎵归噺鍒犻櫎鐢熶骇宸ュ崟 + * + * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteOmProductionOrderInfoByIds(Long[] ids); +} diff --git a/billion-main/src/main/java/com/billion/main/om/service/IOmOrderSchedulingService.java b/billion-main/src/main/java/com/billion/main/om/service/IOmOrderSchedulingService.java new file mode 100644 index 0000000..e41a1b3 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/service/IOmOrderSchedulingService.java @@ -0,0 +1,64 @@ +package com.billion.main.om.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.billion.main.om.domain.OmOrderScheduling; + +import java.util.List; + +/** + * 璁㈠崟鎺掍骇Service鎺ュ彛 + * + * @author Billion + * @date 2024-11-20 + */ +public interface IOmOrderSchedulingService extends IService<OmOrderScheduling> +{ + /** + * 鏌ヨ璁㈠崟鎺掍骇 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 璁㈠崟鎺掍骇 + */ + public OmOrderScheduling selectOmOrderSchedulingById(Long id); + + /** + * 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 璁㈠崟鎺掍骇闆嗗悎 + */ + public List<OmOrderScheduling> selectOmOrderSchedulingList(OmOrderScheduling omOrderScheduling); + + /** + * 鏂板璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + public int insertOmOrderScheduling(OmOrderScheduling omOrderScheduling); + + /** + * 淇敼璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + public int updateOmOrderScheduling(OmOrderScheduling omOrderScheduling); + + /** + * 鎵归噺鍒犻櫎璁㈠崟鎺掍骇 + * + * @param ids 闇�瑕佸垹闄ょ殑璁㈠崟鎺掍骇涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteOmOrderSchedulingByIds(Long[] ids); + + /** + * 鍒犻櫎璁㈠崟鎺掍骇淇℃伅 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 缁撴灉 + */ + public int deleteOmOrderSchedulingById(Long id); +} diff --git a/billion-main/src/main/java/com/billion/main/om/service/IOmProductionOrderInfoService.java b/billion-main/src/main/java/com/billion/main/om/service/IOmProductionOrderInfoService.java new file mode 100644 index 0000000..2933786 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/service/IOmProductionOrderInfoService.java @@ -0,0 +1,63 @@ +package com.billion.main.om.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.billion.main.om.domain.OmProductionOrderInfo; + +import java.util.List; + +/** + * 鐢熶骇宸ュ崟Service鎺ュ彛 + * + * @author Billion + * @date 2024-11-20 + */ +public interface IOmProductionOrderInfoService extends IService<OmProductionOrderInfo> +{ + /** + * 鏌ヨ鐢熶骇宸ュ崟 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 鐢熶骇宸ュ崟 + */ + public OmProductionOrderInfo selectOmProductionOrderInfoById(Long id); + + /** + * 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 + * + * @param OmProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 鐢熶骇宸ュ崟闆嗗悎 + */ + public List<OmProductionOrderInfo> selectOmProductionOrderInfoList(OmProductionOrderInfo OmProductionOrderInfo); + + /** + * 鏂板鐢熶骇宸ュ崟 + * + * @param OmProductionOrderInfo 鐢熶骇宸ュ崟 + */ + public void insertOmProductionOrderInfo(OmProductionOrderInfo OmProductionOrderInfo); + + /** + * 淇敼鐢熶骇宸ュ崟 + * + * @param OmProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 缁撴灉 + */ + public int updateOmProductionOrderInfo(OmProductionOrderInfo OmProductionOrderInfo); + + /** + * 鎵归噺鍒犻櫎鐢熶骇宸ュ崟 + * + * @param ids 闇�瑕佸垹闄ょ殑鐢熶骇宸ュ崟涓婚敭闆嗗悎 + * @return 缁撴灉 + */ + public int deleteOmProductionOrderInfoByIds(Long[] ids); + + /** + * 鍒犻櫎鐢熶骇宸ュ崟淇℃伅 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 缁撴灉 + */ + public int deleteOmProductionOrderInfoById(Long id); +} diff --git a/billion-main/src/main/java/com/billion/main/om/service/impl/OmOrderSchedulingServiceImpl.java b/billion-main/src/main/java/com/billion/main/om/service/impl/OmOrderSchedulingServiceImpl.java new file mode 100644 index 0000000..ff9edec --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/service/impl/OmOrderSchedulingServiceImpl.java @@ -0,0 +1,123 @@ +package com.billion.main.om.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.billion.common.core.domain.entity.SysUser; +import com.billion.common.core.domain.model.LoginUser; +import com.billion.common.exception.ServiceException; +import com.billion.common.utils.SecurityUtils; +import com.billion.main.om.domain.OmOrderScheduling; +import com.billion.main.om.mapper.OmOrderSchedulingMapper; +import com.billion.main.om.service.IOmOrderSchedulingService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.text.MessageFormat; +import java.util.Date; +import java.util.List; + +/** + * 璁㈠崟鎺掍骇Service涓氬姟灞傚鐞� + * + * @author Billion + * @date 2024-11-20 + */ +@Service +public class OmOrderSchedulingServiceImpl extends ServiceImpl<OmOrderSchedulingMapper, OmOrderScheduling> implements IOmOrderSchedulingService +{ + @Resource + private OmOrderSchedulingMapper omOrderSchedulingMapper; + + /** + * 鏌ヨ璁㈠崟鎺掍骇 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 璁㈠崟鎺掍骇 + */ + @Override + public OmOrderScheduling selectOmOrderSchedulingById(Long id) + { + return omOrderSchedulingMapper.selectOmOrderSchedulingById(id); + } + + /** + * 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 璁㈠崟鎺掍骇 + */ + @Override + public List<OmOrderScheduling> selectOmOrderSchedulingList(OmOrderScheduling omOrderScheduling) + { + return omOrderSchedulingMapper.selectOmOrderSchedulingList(omOrderScheduling); + } + + /** + * 鏂板璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + @Override + public int insertOmOrderScheduling(OmOrderScheduling omOrderScheduling) + { + List<OmOrderScheduling> list = this.list(new LambdaQueryWrapper<OmOrderScheduling>().eq(OmOrderScheduling::getSfcCode, omOrderScheduling.getSfcCode())); + if (CollUtil.isNotEmpty(list)){ + throw new ServiceException(MessageFormat.format("宸插瓨鍦ㄦ�绘垚搴忓垪鍙蜂负{0}鐨勬暟鎹�",omOrderScheduling.getSfcCode())); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + SysUser user = loginUser.getUser(); + omOrderScheduling.setCreateTime(new Date()); + omOrderScheduling.setUpdateTime(new Date()); + omOrderScheduling.setCreateBy(user.getUserName()); + omOrderScheduling.setUpdateBy(user.getUserName()); + return omOrderSchedulingMapper.insertOmOrderScheduling(omOrderScheduling); + } + + /** + * 淇敼璁㈠崟鎺掍骇 + * + * @param omOrderScheduling 璁㈠崟鎺掍骇 + * @return 缁撴灉 + */ + @Override + public int updateOmOrderScheduling(OmOrderScheduling omOrderScheduling) + { + List<OmOrderScheduling> list = this.list(new LambdaQueryWrapper<OmOrderScheduling>() + .eq(OmOrderScheduling::getSfcCode, omOrderScheduling.getSfcCode()) + .notIn(OmOrderScheduling::getId,omOrderScheduling.getId())); + if (CollUtil.isNotEmpty(list)){ + throw new ServiceException(MessageFormat.format("宸插瓨鍦ㄦ�绘垚搴忓垪鍙蜂负{0}鐨勬暟鎹�",omOrderScheduling.getSfcCode())); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + SysUser user = loginUser.getUser(); + omOrderScheduling.setUpdateTime(new Date()); + omOrderScheduling.setUpdateBy(user.getUserName()); + return omOrderSchedulingMapper.updateOmOrderScheduling(omOrderScheduling); + } + + /** + * 鎵归噺鍒犻櫎璁㈠崟鎺掍骇 + * + * @param ids 闇�瑕佸垹闄ょ殑璁㈠崟鎺掍骇涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteOmOrderSchedulingByIds(Long[] ids) + { + return omOrderSchedulingMapper.deleteOmOrderSchedulingByIds(ids); + } + + /** + * 鍒犻櫎璁㈠崟鎺掍骇淇℃伅 + * + * @param id 璁㈠崟鎺掍骇涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteOmOrderSchedulingById(Long id) + { + return omOrderSchedulingMapper.deleteOmOrderSchedulingById(id); + } +} diff --git a/billion-main/src/main/java/com/billion/main/om/service/impl/OmProductionOrderInfoServiceImpl.java b/billion-main/src/main/java/com/billion/main/om/service/impl/OmProductionOrderInfoServiceImpl.java new file mode 100644 index 0000000..0a24522 --- /dev/null +++ b/billion-main/src/main/java/com/billion/main/om/service/impl/OmProductionOrderInfoServiceImpl.java @@ -0,0 +1,126 @@ +package com.billion.main.om.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.billion.common.core.domain.entity.SysUser; +import com.billion.common.core.domain.model.LoginUser; +import com.billion.common.exception.ServiceException; +import com.billion.common.utils.SecurityUtils; +import com.billion.main.common.BaseEntity; +import com.billion.main.om.domain.OmProductionOrderInfo; +import com.billion.main.om.mapper.OmProductionOrderInfoMapper; +import com.billion.main.om.service.IOmProductionOrderInfoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +/** + * 鐢熶骇宸ュ崟Service涓氬姟灞傚鐞� + * + * @author Billion + * @date 2024-11-20 + */ +@Service +public class OmProductionOrderInfoServiceImpl extends ServiceImpl<OmProductionOrderInfoMapper, OmProductionOrderInfo> implements IOmProductionOrderInfoService +{ + @Resource + private OmProductionOrderInfoMapper OmProductionOrderInfoMapper; + + /** + * 鏌ヨ鐢熶骇宸ュ崟 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 鐢熶骇宸ュ崟 + */ + @Override + public OmProductionOrderInfo selectOmProductionOrderInfoById(Long id) + { + return OmProductionOrderInfoMapper.selectOmProductionOrderInfoById(id); + } + + /** + * 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 + * + * @param OmProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 鐢熶骇宸ュ崟 + */ + @Override + public List<OmProductionOrderInfo> selectOmProductionOrderInfoList(OmProductionOrderInfo OmProductionOrderInfo) + { + return OmProductionOrderInfoMapper.selectOmProductionOrderInfoList(OmProductionOrderInfo); + } + + /** + * 鏂板鐢熶骇宸ュ崟 + * + * @param omProductionOrderInfo 鐢熶骇宸ュ崟 + */ + @Override + public void insertOmProductionOrderInfo(OmProductionOrderInfo omProductionOrderInfo) + { + List<OmProductionOrderInfo> checkList = this.list(new LambdaQueryWrapper<OmProductionOrderInfo>().eq(OmProductionOrderInfo::getWorkOrderNo, omProductionOrderInfo.getWorkOrderNo())); + if (CollUtil.isNotEmpty(checkList)){ + throw new ServiceException("宸插瓨鍦ㄥ伐鍗曠紪鍙蜂负"+omProductionOrderInfo.getWorkOrderNo()+"鐨勬暟鎹�"); + } + this.save(omProductionOrderInfo); + +// LoginUser loginUser = SecurityUtils.getLoginUser(); +// SysUser user = loginUser.getUser(); +// OmProductionOrderInfo.setCreateTime(new Date()); +// OmProductionOrderInfo.setUpdateTime(new Date()); +// OmProductionOrderInfo.setCreateBy(user.getUserName()); +// OmProductionOrderInfo.setUpdateBy(user.getUserName()); +// OmProductionOrderInfo.setOrderStatus(Constant.ORDER_STATUS_NOT_START); +// return OmProductionOrderInfoMapper.insertOmProductionOrderInfo(OmProductionOrderInfo); + } + + /** + * 淇敼鐢熶骇宸ュ崟 + * + * @param omProductionOrderInfo 鐢熶骇宸ュ崟 + * @return 缁撴灉 + */ + @Override + public int updateOmProductionOrderInfo(OmProductionOrderInfo omProductionOrderInfo) + { + List<OmProductionOrderInfo> checkList = this.list(new LambdaQueryWrapper<OmProductionOrderInfo>() + .eq(OmProductionOrderInfo::getWorkOrderNo, omProductionOrderInfo.getWorkOrderNo()) + .notIn(BaseEntity::getId,omProductionOrderInfo.getId())); +// .stream().filter(x -> !x.getId().equals(omProductionOrderInfo.getId())) +// .collect(Collectors.toList()); + if (CollUtil.isNotEmpty(checkList)){ + throw new ServiceException("宸插瓨鍦ㄥ伐鍗曠紪鍙蜂负"+omProductionOrderInfo.getWorkOrderNo()+"鐨勬暟鎹�"); + } + LoginUser loginUser = SecurityUtils.getLoginUser(); + SysUser user = loginUser.getUser(); + omProductionOrderInfo.setUpdateTime(new Date()); + omProductionOrderInfo.setUpdateBy(user.getUserName()); + return OmProductionOrderInfoMapper.updateOmProductionOrderInfo(omProductionOrderInfo); + } + + /** + * 鎵归噺鍒犻櫎鐢熶骇宸ュ崟 + * + * @param ids 闇�瑕佸垹闄ょ殑鐢熶骇宸ュ崟涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteOmProductionOrderInfoByIds(Long[] ids) + { + return OmProductionOrderInfoMapper.deleteOmProductionOrderInfoByIds(ids); + } + + /** + * 鍒犻櫎鐢熶骇宸ュ崟淇℃伅 + * + * @param id 鐢熶骇宸ュ崟涓婚敭 + * @return 缁撴灉 + */ + @Override + public int deleteOmProductionOrderInfoById(Long id) + { + return OmProductionOrderInfoMapper.deleteOmProductionOrderInfoById(id); + } +} diff --git a/billion-main/src/main/resources/mapper/om/OmOrderSchedulingMapper.xml b/billion-main/src/main/resources/mapper/om/OmOrderSchedulingMapper.xml new file mode 100644 index 0000000..3b9a192 --- /dev/null +++ b/billion-main/src/main/resources/mapper/om/OmOrderSchedulingMapper.xml @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.billion.main.om.mapper.OmOrderSchedulingMapper"> + + <resultMap type="OmOrderScheduling" id="OmOrderSchedulingResult"> + <result property="id" column="id" /> + <result property="workOrderNo" column="work_order_no" /> + <result property="sfcCode" column="sfc_code" /> + <result property="productCode" column="product_code" /> + <result property="onlineTime" column="online_time" /> + <result property="offlineTime" column="offline_time" /> + <result property="qualityStatus" column="quality_status" /> + <result property="status" column="status" /> + <result property="createBy" column="create_by" /> + <result property="createTime" column="create_time" /> + <result property="updateBy" column="update_by" /> + <result property="updateTime" column="update_time" /> + <result property="remarks" column="remarks" /> + </resultMap> + + <sql id="selectOmOrderSchedulingVo"> + select id, work_order_no, sfc_code, product_code, online_time, offline_time, quality_status, status, create_by, create_time, update_by, update_time, remarks from om_order_scheduling + </sql> + + <select id="selectOmOrderSchedulingList" parameterType="OmOrderScheduling" resultMap="OmOrderSchedulingResult"> + <include refid="selectOmOrderSchedulingVo"/> + <where> + <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if> + <if test="sfcCode != null and sfcCode != ''"> and sfc_code = #{sfcCode}</if> + <if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if> + <if test="params.beginOnlineTime != null and params.beginOnlineTime != '' and params.endOnlineTime != null and params.endOnlineTime != ''"> and online_time between #{params.beginOnlineTime} and #{params.endOnlineTime}</if> + <if test="params.beginOfflineTime != null and params.beginOfflineTime != '' and params.endOfflineTime != null and params.endOfflineTime != ''"> and offline_time between #{params.beginOfflineTime} and #{params.endOfflineTime}</if> + <if test="status != null and status != ''"> and status = #{status}</if> + </where> + </select> + + <select id="selectOmOrderSchedulingById" parameterType="Long" resultMap="OmOrderSchedulingResult"> + <include refid="selectOmOrderSchedulingVo"/> + where id = #{id} + </select> + + <insert id="insertOmOrderScheduling" parameterType="OmOrderScheduling"> + insert into om_order_scheduling + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">work_order_no,</if> + <if test="sfcCode != null and sfcCode != ''">sfc_code,</if> + <if test="productCode != null and productCode != ''">product_code,</if> + <if test="onlineTime != null">online_time,</if> + <if test="offlineTime != null">offline_time,</if> + <if test="qualityStatus != null">quality_status,</if> + <if test="status != null">status,</if> + <if test="createBy != null">create_by,</if> + <if test="createTime != null">create_time,</if> + <if test="updateBy != null">update_by,</if> + <if test="updateTime != null">update_time,</if> + <if test="remarks != null">remarks,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">#{workOrderNo},</if> + <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if> + <if test="productCode != null and productCode != ''">#{productCode},</if> + <if test="onlineTime != null">#{onlineTime},</if> + <if test="offlineTime != null">#{offlineTime},</if> + <if test="qualityStatus != null">#{qualityStatus},</if> + <if test="status != null">#{status},</if> + <if test="createBy != null">#{createBy},</if> + <if test="createTime != null">#{createTime},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="remarks != null">#{remarks},</if> + </trim> + </insert> + + <update id="updateOmOrderScheduling" parameterType="OmOrderScheduling"> + update om_order_scheduling + <trim prefix="SET" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">work_order_no = #{workOrderNo},</if> + <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if> + <if test="productCode != null and productCode != ''">product_code = #{productCode},</if> + <if test="onlineTime != null">online_time = #{onlineTime},</if> + <if test="offlineTime != null">offline_time = #{offlineTime},</if> + <if test="qualityStatus != null">quality_status = #{qualityStatus},</if> + <if test="status != null">status = #{status},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="remarks != null">remarks = #{remarks},</if> + </trim> + where id = #{id} + </update> + + <delete id="deleteOmOrderSchedulingById" parameterType="Long"> + delete from om_order_scheduling where id = #{id} + </delete> + + <delete id="deleteOmOrderSchedulingByIds" parameterType="String"> + delete from om_order_scheduling where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </delete> +</mapper> \ No newline at end of file diff --git a/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml new file mode 100644 index 0000000..1fc153e --- /dev/null +++ b/billion-main/src/main/resources/mapper/om/OmProductionOrderInfoMapper.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.billion.main.om.mapper.OmProductionOrderInfoMapper"> + + <resultMap type="OmProductionOrderInfo" id="OmProductionOrderInfoResult"> + <result property="id" column="id" /> + <result property="workOrderNo" column="work_order_no" /> + <result property="salesOrderCode" column="sales_order_code" /> + <result property="productCode" column="product_code" /> + <result property="lineCode" column="line_code" /> + <result property="planQty" column="plan_qty" /> + <result property="planStartTime" column="plan_start_time" /> + <result property="planEndTime" column="plan_end_time" /> + <result property="orderStatus" column="order_status" /> + <result property="createTime" column="create_time" /> + <result property="updateTime" column="update_time" /> + <result property="createBy" column="create_by" /> + <result property="updateBy" column="update_by" /> + <result property="remarks" column="remarks" /> + <result property="delFlag" column="del_flag" /> + </resultMap> + + <sql id="selectOmProductionOrderInfoVo"> + select id, work_order_no, sales_order_code, product_code, line_code, plan_qty, plan_start_time, plan_end_time, order_status, create_time, update_time, create_by, update_by, remarks, del_flag from om_production_order_info + </sql> + + <select id="selectOmProductionOrderInfoList" parameterType="OmProductionOrderInfo" resultMap="OmProductionOrderInfoResult"> + <include refid="selectOmProductionOrderInfoVo"/> + <where> + <if test="workOrderNo != null and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if> + <if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if> + <if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if> + <if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if> + and del_flag = "0" + </where> + </select> + + <select id="selectOmProductionOrderInfoById" parameterType="Long" resultMap="OmProductionOrderInfoResult"> + <include refid="selectOmProductionOrderInfoVo"/> + where id = #{id} and del_flag = "0" + </select> + + <insert id="insertOmProductionOrderInfo" parameterType="OmProductionOrderInfo" useGeneratedKeys="true" keyProperty="id"> + insert into om_production_order_info + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">work_order_no,</if> + <if test="salesOrderCode != null and salesOrderCode != ''">sales_order_code,</if> + <if test="productCode != null and productCode != ''">product_code,</if> + <if test="lineCode != null and lineCode != ''">line_code,</if> + <if test="planQty != null">plan_qty,</if> + <if test="planStartTime != null">plan_start_time,</if> + <if test="planEndTime != null">plan_end_time,</if> + <if test="orderStatus != null">order_status,</if> + <if test="createTime != null">create_time,</if> + <if test="updateTime != null">update_time,</if> + <if test="createBy != null">create_by,</if> + <if test="updateBy != null">update_by,</if> + <if test="remarks != null">remarks,</if> + <if test="delFlag != null">del_flag,</if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">#{workOrderNo},</if> + <if test="salesOrderCode != null and salesOrderCode != ''">#{salesOrderCode},</if> + <if test="productCode != null and productCode != ''">#{productCode},</if> + <if test="lineCode != null and lineCode != ''">#{lineCode},</if> + <if test="planQty != null">#{planQty},</if> + <if test="planStartTime != null">#{planStartTime},</if> + <if test="planEndTime != null">#{planEndTime},</if> + <if test="orderStatus != null">#{orderStatus},</if> + <if test="createTime != null">#{createTime},</if> + <if test="updateTime != null">#{updateTime},</if> + <if test="createBy != null">#{createBy},</if> + <if test="updateBy != null">#{updateBy},</if> + <if test="remarks != null">#{remarks},</if> + <if test="delFlag != null">#{delFlag},</if> + </trim> + </insert> + + <update id="updateOmProductionOrderInfo" parameterType="OmProductionOrderInfo"> + update om_production_order_info + <trim prefix="SET" suffixOverrides=","> + <if test="workOrderNo != null and workOrderNo != ''">work_order_no = #{workOrderNo},</if> + <if test="salesOrderCode != null and salesOrderCode != ''">sales_order_code = #{salesOrderCode},</if> + <if test="productCode != null and productCode != ''">product_code = #{productCode},</if> + <if test="lineCode != null and lineCode != ''">line_code = #{lineCode},</if> + <if test="planQty != null">plan_qty = #{planQty},</if> + <if test="planStartTime != null">plan_start_time = #{planStartTime},</if> + <if test="planEndTime != null">plan_end_time = #{planEndTime},</if> + <if test="orderStatus != null">order_status = #{orderStatus},</if> + <if test="createTime != null">create_time = #{createTime},</if> + <if test="updateTime != null">update_time = #{updateTime},</if> + <if test="createBy != null">create_by = #{createBy},</if> + <if test="updateBy != null">update_by = #{updateBy},</if> + <if test="remarks != null">remarks = #{remarks},</if> + <if test="delFlag != null">del_flag = #{delFlag},</if> + </trim> + where id = #{id} + </update> + + <update id="deleteOmProductionOrderInfoById" parameterType="Long"> + update om_production_order_info set del_flag = "1" where id = #{id} + </update> + + <update id="deleteOmProductionOrderInfoByIds" parameterType="String"> + update om_production_order_info set del_flag = "1" where id in + <foreach item="id" collection="array" open="(" separator="," close=")"> + #{id} + </foreach> + </update> +</mapper> \ No newline at end of file diff --git a/billion-ui/src/api/main/om/info.js b/billion-ui/src/api/main/om/info.js new file mode 100644 index 0000000..65a04e2 --- /dev/null +++ b/billion-ui/src/api/main/om/info.js @@ -0,0 +1,51 @@ +import request from '@/utils/request' + +// 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 +export function listInfo(query) { + return request({ + url: '/main/info/list', + method: 'get', + params: query + }) +} + +export function getOrderList() { + return request({ + url: '/main/info/getOrderList', + method: 'get', + }) +} + +// 鏌ヨ鐢熶骇宸ュ崟璇︾粏 +export function getInfo(id) { + return request({ + url: '/main/info/' + id, + method: 'get' + }) +} + +// 鏂板鐢熶骇宸ュ崟 +export function addInfo(data) { + return request({ + url: '/main/info', + method: 'post', + data: data + }) +} + +// 淇敼鐢熶骇宸ュ崟 +export function updateInfo(data) { + return request({ + url: '/main/info', + method: 'put', + data: data + }) +} + +// 鍒犻櫎鐢熶骇宸ュ崟 +export function delInfo(id) { + return request({ + url: '/main/info/' + id, + method: 'delete' + }) +} diff --git a/billion-ui/src/api/main/om/scheduling.js b/billion-ui/src/api/main/om/scheduling.js new file mode 100644 index 0000000..b17790b --- /dev/null +++ b/billion-ui/src/api/main/om/scheduling.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 +export function listScheduling(query) { + return request({ + url: '/main/scheduling/list', + method: 'get', + params: query + }) +} + +// 鏌ヨ璁㈠崟鎺掍骇璇︾粏 +export function getScheduling(id) { + return request({ + url: '/main/scheduling/' + id, + method: 'get' + }) +} + +// 鏂板璁㈠崟鎺掍骇 +export function addScheduling(data) { + return request({ + url: '/main/scheduling', + method: 'post', + data: data + }) +} + +// 淇敼璁㈠崟鎺掍骇 +export function updateScheduling(data) { + return request({ + url: '/main/scheduling', + method: 'put', + data: data + }) +} + +// 鍒犻櫎璁㈠崟鎺掍骇 +export function delScheduling(id) { + return request({ + url: '/main/scheduling/' + id, + method: 'delete' + }) +} diff --git a/billion-ui/src/views/main/om/info/index.vue b/billion-ui/src/views/main/om/info/index.vue new file mode 100644 index 0000000..01e055c --- /dev/null +++ b/billion-ui/src/views/main/om/info/index.vue @@ -0,0 +1,506 @@ +<template> + <div class="app-container"> + <div> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> + <el-input + v-model="queryParams.workOrderNo" + placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="璁㈠崟缂栧彿" prop="salesOrderCode"> + <el-input + v-model="queryParams.salesOrderCode" + placeholder="璇疯緭鍏ヨ鍗曠紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="浜у搧缂栧彿" prop="productCode"> + <el-input + v-model="queryParams.productCode" + placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="宸ュ崟鐘舵��" prop="orderStatus"> + <el-select v-model="queryParams.orderStatus" placeholder="璇烽�夋嫨宸ュ崟鐘舵��" clearable> + <el-option + v-for="dict in dict.type.order_status" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item style="float: right; margin-right: 90px"> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + </div> + + + <div style="width: 600px"> + <el-row :gutter="10" class="mb8" > + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['main:info:add']" + >鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['main:info:edit']" + >淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['main:info:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['main:info:export']" + >瀵煎嚭</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-receiving" + size="mini" + @click="handleReceive" + >鎺ユ敹宸ュ崟</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" + plain + :disabled="multiple" + icon="el-icon-magic-stick" + size="mini" + @click="handleCreate" + >鐢熸垚</el-button> + </el-col> + <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> + </el-row> + </div> + + + <el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo"> + <template slot-scope="scope"> + <a style="color: #7099F9" @click="orderDetail(scope.row.workOrderNo)" >{{scope.row.workOrderNo}} + </a> +<!-- <div @click="orderDetail(scope.row.workOrderNo)">{{scope.row.workOrderNo}}</div>--> + </template> + </el-table-column> + <el-table-column label="璁㈠崟缂栧彿" align="center" prop="salesOrderCode" /> + <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode" /> + <el-table-column label="浜х嚎缂栧彿" align="center" prop="lineCode" /> + <el-table-column label="璁″垝鏁伴噺" align="center" prop="planQty" /> + <el-table-column label="璁″垝寮�濮嬫椂闂�" align="center" prop="planStartTime" width="120"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span> + </template> + </el-table-column> + <el-table-column label="璁″垝缁撴潫鏃堕棿" align="center" prop="planEndTime" width="120"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span> + </template> + </el-table-column> + <el-table-column label="宸ュ崟鐘舵��" align="center" prop="orderStatus"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/> + </template> + </el-table-column> + <el-table-column label="鏇存柊鏃堕棿" align="center" prop="updateTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="鏇存柊鐢ㄦ埛" align="center" prop="updateBy" /> + <el-table-column label="澶囨敞" width="180px" show-overflow-tooltip align="center" prop="remarks" /> +<!-- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">--> +<!-- <template slot-scope="scope">--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="text"--> +<!-- icon="el-icon-edit"--> +<!-- @click="handleUpdate(scope.row)"--> +<!-- v-hasPermi="['main:info:edit']"--> +<!-- >淇敼</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="text"--> +<!-- icon="el-icon-delete"--> +<!-- @click="handleDelete(scope.row)"--> +<!-- v-hasPermi="['main:info:remove']"--> +<!-- >鍒犻櫎</el-button>--> +<!-- </template>--> +<!-- </el-table-column>--> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 娣诲姞鎴栦慨鏀圭敓浜у伐鍗曞璇濇 --> + <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> + <el-input v-model="form.workOrderNo" placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" /> + </el-form-item> + <el-form-item label="璁㈠崟缂栧彿" prop="salesOrderCode"> + <el-input v-model="form.salesOrderCode" placeholder="璇疯緭鍏ヨ鍗曠紪鍙�" /> + </el-form-item> + <el-form-item label="浜у搧缂栧彿" prop="productCode"> + <el-input v-model="form.productCode" placeholder="璇疯緭鍏ヤ骇鍝佺紪鍙�" /> + </el-form-item> + <el-form-item label="浜х嚎缂栧彿" prop="lineCode"> + <el-input v-model="form.lineCode" placeholder="璇疯緭鍏ヤ骇绾跨紪鍙�" /> + </el-form-item> + <el-form-item label="璁″垝鏁伴噺" prop="planQty"> + <el-input v-model="form.planQty" placeholder="璇疯緭鍏ヨ鍒掓暟閲�" /> + </el-form-item> + <el-form-item label="璁″垝寮�濮嬫椂闂�" prop="planStartTime"> + <el-date-picker clearable + v-model="form.planStartTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="璇烽�夋嫨璁″垝寮�濮嬫椂闂�"> + </el-date-picker> + </el-form-item> + <el-form-item label="璁″垝缁撴潫鏃堕棿" prop="planEndTime"> + <el-date-picker clearable + v-model="form.planEndTime" + type="date" + value-format="yyyy-MM-dd" + placeholder="璇烽�夋嫨璁″垝缁撴潫鏃堕棿"> + </el-date-picker> + </el-form-item> + <el-form-item label="宸ュ崟鐘舵��" prop="orderStatus" v-if = updateFlag> + <el-radio-group v-model="form.orderStatus"> + <el-radio + v-for="dict in dict.type.order_status" + :key="dict.value" + :label="dict.value" + >{{dict.label}}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="澶囨敞" prop="remarks"> + <el-input + type="textarea" + placeholder="璇疯緭鍏ュ娉�" + v-model="form.remarks" + maxlength="30" + show-word-limit + > + </el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + <el-dialog + title="宸ュ崟璇︽儏" + :visible.sync="detailVisible" + width="80%" + center> + <el-table v-loading="detailLoading" :data="schedulingList"> + <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo" /> + <el-table-column label="鎬绘垚搴忓垪鍙�" width="180px" align="center" prop="sfcCode" /> + <el-table-column label="浜у搧缂栫爜" align="center" prop="productCode" /> + <el-table-column label="涓婄嚎鏃堕棿" align="center" prop="onlineTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.onlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="涓嬬嚎鏃堕棿" align="center" prop="offlineTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.offlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="璐ㄩ噺鐘舵��" align="center" prop="qualityStatus"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.product_status" :value="scope.row.qualityStatus"/> + </template> + </el-table-column> + <el-table-column label="鐘舵��" align="center" prop="status"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.status" :value="scope.row.status"/> + </template> + </el-table-column> + <el-table-column label="鏇存柊鐢ㄦ埛" align="center" prop="updateBy" /> + <el-table-column label="鏇存柊鏃堕棿" align="center" prop="updateTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="澶囨敞" width="180px" show-overflow-tooltip align="center" prop="remarks" /> + </el-table> + + <pagination + v-show="detailTotal>0" + :total="detailTotal" + :page.sync="queryDetailParams.pageNum" + :limit.sync="queryDetailParams.pageSize" + @pagination="getDetail" + /> + <span slot="footer" class="dialog-footer"> +<!-- <el-button @click="detailVisible = false">鍙� 娑�</el-button>--> +<!-- <el-button type="primary" @click="detailVisible = false">纭� 瀹�</el-button>--> + </span> + </el-dialog> + </div> + +</template> + +<script> +import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/main/om/info"; +import {listScheduling} from "@/api/main/om/scheduling"; + +export default { + name: "Info", + dicts: ['order_status','product_status', 'status'], + data() { + return { + schedulingList: [], + detailVisible : false, + addFlag : false, + updateFlag : false, + // 閬僵灞� + loading: true, + detailLoading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 鐢熶骇宸ュ崟琛ㄦ牸鏁版嵁 + infoList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + workOrderNo: null, + salesOrderCode: null, + productCode: null, + orderStatus: null, + }, + queryDetailParams: { + pageNum: 1, + pageSize: 10, + workOrderNo: null, + }, + detailTotal: 0, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + workOrderNo: [ + { required: true, message: "宸ュ崟缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + ], + salesOrderCode: [ + { required: true, message: "璁㈠崟缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + ], + productCode: [ + { required: true, message: "浜у搧缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + ], + lineCode: [ + { required: true, message: "浜х嚎缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + ], + planQty: [ + { required: true, message: "璁″垝鏁伴噺涓嶈兘涓虹┖", trigger: "blur" } + ], + planStartTime: [ + { required: true, message: "璁″垝寮�濮嬫椂闂翠笉鑳戒负绌�", trigger: "blur" } + ], + planEndTime: [ + { required: true, message: "璁″垝缁撴潫鏃堕棿涓嶈兘涓虹┖", trigger: "blur" } + ], + } + }; + }, + created() { + this.getList(); + }, + methods: { + orderDetail(workOrderNo){ + console.log('000',workOrderNo) + this.detailVisible = true + this.queryDetailParams.params = {} + this.queryDetailParams.workOrderNo = workOrderNo + this.getDetail() + }, + getDetail(){ + listScheduling(this.queryDetailParams).then(response => { + this.schedulingList = response.rows; + this.detailTotal = response.total; + this.detailLoading = false; + }); + }, + handleReceive(){ + this.$message({ + message: "閰嶇疆鎺ユ敹鏂规硶", + type: "info" + }) + }, + handleCreate(){ + this.$message({ + message: "閰嶇疆鐢熸垚鏂规硶", + type: "info" + }) + }, + /** 鏌ヨ鐢熶骇宸ュ崟鍒楄〃 */ + getList() { + this.loading = true; + listInfo(this.queryParams).then(response => { + this.infoList = response.rows; + this.detailTotal = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + workOrderNo: null, + salesOrderCode: null, + productCode: null, + lineCode: null, + planQty: null, + planStartTime: null, + planEndTime: null, + orderStatus: null, + createTime: null, + updateTime: null, + createBy: null, + updateBy: null, + remarks: null, + delFlag: null, + }; + this.resetForm("form"); + this.addFlag = false + this.updateFlag = false + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + console.log('111') + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.addFlag = true + this.open = true; + this.title = "娣诲姞鐢熶骇宸ュ崟"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + this.updateFlag = true + const id = row.id || this.ids + getInfo(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼鐢熶骇宸ュ崟"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateInfo(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addInfo(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎锛�').then(function() { + return delInfo(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('main/info/export', { + ...this.queryParams + }, `info_${new Date().getTime()}.xlsx`) + } + } +}; +</script> diff --git a/billion-ui/src/views/main/om/scheduling/index.vue b/billion-ui/src/views/main/om/scheduling/index.vue new file mode 100644 index 0000000..81cc5b4 --- /dev/null +++ b/billion-ui/src/views/main/om/scheduling/index.vue @@ -0,0 +1,424 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> + <el-input + v-model="queryParams.workOrderNo" + placeholder="璇疯緭鍏ュ伐鍗曠紪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鎬绘垚搴忓垪鍙�" prop="sfcCode"> + <el-input + v-model="queryParams.sfcCode" + placeholder="璇疯緭鍏ユ�绘垚搴忓垪鍙�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="浜у搧缂栫爜" prop="productCode"> + <el-input + v-model="queryParams.productCode" + placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" + clearable + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鐘舵��" prop="status"> + <el-select v-model="queryParams.status" placeholder="璇烽�夋嫨鐘舵��" clearable> + <el-option + v-for="dict in dict.type.status" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <el-form-item label="涓婄嚎鏃堕棿"> + <el-date-picker + v-model="daterangeOnlineTime" + style="width: 340px" + value-format="yyyy-MM-dd HH:mm:ss" + type="datetimerange" + range-separator="-" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + ></el-date-picker> + </el-form-item> + <el-form-item label="涓嬬嚎鏃堕棿" prop="offlineTime"> + <el-date-picker + v-model="daterangeOfflineTime" + style="width: 340px" + value-format="yyyy-MM-dd HH:mm:ss" + type="datetimerange" + range-separator="-" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + ></el-date-picker> + </el-form-item> + + <el-form-item style="float: right; margin-right: 90px"> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8" > + <el-col :span="1.5"> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['main:scheduling:add']" + >鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="success" + plain + icon="el-icon-edit" + size="mini" + :disabled="single" + @click="handleUpdate" + v-hasPermi="['main:scheduling:edit']" + >淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + plain + icon="el-icon-delete" + size="mini" + :disabled="multiple" + @click="handleDelete" + v-hasPermi="['main:scheduling:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + @click="handleExport" + v-hasPermi="['main:scheduling:export']" + >瀵煎嚭</el-button> + </el-col> +<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> + </el-row> + + <el-table v-loading="loading" :data="schedulingList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo" /> + <el-table-column label="鎬绘垚搴忓垪鍙�" width="180px" align="center" prop="sfcCode" /> + <el-table-column label="浜у搧缂栫爜" align="center" prop="productCode" /> + <el-table-column label="涓婄嚎鏃堕棿" align="center" prop="onlineTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.onlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="涓嬬嚎鏃堕棿" align="center" prop="offlineTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.offlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="璐ㄩ噺鐘舵��" align="center" prop="qualityStatus"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.product_status" :value="scope.row.qualityStatus"/> + </template> + </el-table-column> + <el-table-column label="鐘舵��" align="center" prop="status"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.status" :value="scope.row.status"/> + </template> + </el-table-column> + <el-table-column label="鏇存柊鐢ㄦ埛" align="center" prop="updateBy" /> + <el-table-column label="鏇存柊鏃堕棿" align="center" prop="updateTime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> + </template> + </el-table-column> + <el-table-column label="澶囨敞" width="180px" show-overflow-tooltip align="center" prop="remarks" /> +<!-- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">--> +<!-- <template slot-scope="scope">--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="text"--> +<!-- icon="el-icon-edit"--> +<!-- @click="handleUpdate(scope.row)"--> +<!-- v-hasPermi="['main:scheduling:edit']"--> +<!-- >淇敼</el-button>--> +<!-- <el-button--> +<!-- size="mini"--> +<!-- type="text"--> +<!-- icon="el-icon-delete"--> +<!-- @click="handleDelete(scope.row)"--> +<!-- v-hasPermi="['main:scheduling:remove']"--> +<!-- >鍒犻櫎</el-button>--> +<!-- </template>--> +<!-- </el-table-column>--> + </el-table> + + <pagination + v-show="total>0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + + <!-- 娣诲姞鎴栦慨鏀硅鍗曟帓浜у璇濇 --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> + <el-select v-model="form.workOrderNo" filterable placeholder="璇烽�夋嫨宸ュ崟缂栧彿" style="width: 360px"> + <el-option + v-for="item in workOrderNoOptions" + :key="item.value" + :label="item" + :value="item"> + </el-option> + </el-select> + </el-form-item> + + <el-form-item label="鎬绘垚搴忓垪鍙�" prop="sfcCode"> + <el-input v-model="form.sfcCode" placeholder="璇疯緭鍏ユ�绘垚搴忓垪鍙�" /> + </el-form-item> + <el-form-item label="浜у搧缂栫爜" prop="productCode"> + <el-input v-model="form.productCode" placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" /> + </el-form-item> + + <el-form-item label="璐ㄩ噺鐘舵��" prop="qualityStatus" v-if = updateFlag> + <el-radio-group v-model="form.qualityStatus"> + <el-radio + v-for="dict in dict.type.product_status" + :key="dict.value" + :label="dict.value" + >{{dict.label}}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="鐘舵��" prop="status" v-if = updateFlag> + <el-radio-group v-model="form.status"> + <el-radio + v-for="dict in dict.type.status" + :key="dict.value" + :label="dict.value" + >{{dict.label}}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="澶囨敞" prop="remarks"> + <el-input + type="textarea" + placeholder="璇疯緭鍏ュ娉�" + v-model="form.remarks" + maxlength="30" + show-word-limit + > + </el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + </div> +</template> + +<script> +import { listScheduling, getScheduling, delScheduling, addScheduling, updateScheduling } from "@/api/main/om/scheduling"; +import {getOrderList} from "@/api/main/om/info"; + +export default { + name: "Scheduling", + dicts: ['product_status', 'status'], + data() { + return { + workOrderNoOptions: [], + addFlag : false, + updateFlag : false, + // 閬僵灞� + loading: true, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 璁㈠崟鎺掍骇琛ㄦ牸鏁版嵁 + schedulingList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 澶囨敞鏃堕棿鑼冨洿 + daterangeOnlineTime: [], + daterangeOfflineTime: [], + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + workOrderNo: null, + sfcCode: null, + productCode: null, + onlineTime: null, + offlineTime: null, + status: null, + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + workOrderNo: [ + { required: true, message: "宸ュ崟缂栧彿涓嶈兘涓虹┖", trigger: "change" } + ], + sfcCode: [ + { required: true, message: "鎬绘垚搴忓垪鍙蜂笉鑳戒负绌�", trigger: "blur" } + ], + productCode: [ + { required: true, message: "浜у搧缂栫爜涓嶈兘涓虹┖", trigger: "blur" } + ], + } + }; + }, + created() { + this.getList(); + }, + methods: { + getOrderList(){ + getOrderList().then(res => { + console.log('res',res) + if (res.code === 200){ + this.workOrderNoOptions = res.data + console.log('this.workOrderNoOptions',this.workOrderNoOptions) + } + }) + }, + /** 鏌ヨ璁㈠崟鎺掍骇鍒楄〃 */ + getList() { + this.loading = true; + this.queryParams.params = {}; + if (null != this.daterangeOnlineTime && '' != this.daterangeOnlineTime) { + this.queryParams.params["beginOnlineTime"] = this.daterangeOnlineTime[0]; + this.queryParams.params["endOnlineTime"] = this.daterangeOnlineTime[1]; + } + if (null != this.daterangeOfflineTime && '' != this.daterangeOfflineTime) { + this.queryParams.params["beginOfflineTime"] = this.daterangeOfflineTime[0]; + this.queryParams.params["endOfflineTime"] = this.daterangeOfflineTime[1]; + } + listScheduling(this.queryParams).then(response => { + this.schedulingList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + workOrderNo: null, + sfcCode: null, + productCode: null, + onlineTime: null, + offlineTime: null, + qualityStatus: null, + status: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null, + remarks: null + }; + this.resetForm("form"); + this.addFlag = false + this.updateFlag = false + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.daterangeOnlineTime = []; + this.daterangeOfflineTime = []; + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length!==1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.getOrderList() + this.addFlag = true + this.open = true; + this.title = "娣诲姞璁㈠崟鎺掍骇"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + this.updateFlag = true + const id = row.id || this.ids + getScheduling(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼璁㈠崟鎺掍骇"; + }); + this.getOrderList() + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateScheduling(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addScheduling(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎锛�').then(function() { + return delScheduling(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + this.download('main/scheduling/export', { + ...this.queryParams + }, `scheduling_${new Date().getTime()}.xlsx`) + } + } +}; +</script> -- Gitblit v1.9.3