Browse Source

设置点位

laoyao 3 years ago
parent
commit
26c3fe8e8b

+ 6 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/dao/MMeterialReceiveLogMapper.java

@@ -1,7 +1,12 @@
 package com.github.zuihou.business.productionReadyCenter.dao;
 
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
 import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
+import com.github.zuihou.business.productionReadyCenter.entity.Plate;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -15,5 +20,5 @@ import org.springframework.stereotype.Repository;
  */
 @Repository
 public interface MMeterialReceiveLogMapper extends SuperMapper<MMeterialReceiveLog> {
-
+    IPage<MMeterialReceiveLog> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<MMeterialReceiveLog> queryWrapper);
 }

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/MMeterialReceiveLogService.java

@@ -1,7 +1,13 @@
 package com.github.zuihou.business.productionReadyCenter.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperService;
+import com.github.zuihou.business.productionReadyCenter.dto.MMeterialReceiveLogSaveDTO;
+import com.github.zuihou.business.productionReadyCenter.dto.MMeterialSaveDTO;
+import com.github.zuihou.business.productionReadyCenter.entity.MMeterial;
 import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
+import com.github.zuihou.business.productionReadyCenter.entity.Plate;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
 /**
  * <p>
@@ -14,5 +20,7 @@ import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveL
  */
 public interface MMeterialReceiveLogService extends SuperService<MMeterialReceiveLog> {
 
+    IPage<MMeterialReceiveLog> pageList(IPage page, LbqWrapper<MMeterialReceiveLog> wrapper);
+    MMeterialReceiveLog save(MMeterialReceiveLogSaveDTO data);
 
 }

+ 17 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/MMeterialReceiveLogServiceImpl.java

@@ -1,12 +1,18 @@
 package com.github.zuihou.business.productionReadyCenter.service.impl;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.productionReadyCenter.dao.MMeterialReceiveLogMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.PlateMapper;
+import com.github.zuihou.business.productionReadyCenter.dto.MMeterialReceiveLogSaveDTO;
 import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
+import com.github.zuihou.business.productionReadyCenter.entity.MToolClamp;
 import com.github.zuihou.business.productionReadyCenter.entity.Plate;
 import com.github.zuihou.business.productionReadyCenter.service.MMeterialReceiveLogService;
 import com.github.zuihou.business.productionReadyCenter.service.PlateService;
+import com.github.zuihou.common.constant.CodeRuleModule;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.utils.BeanPlusUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -23,5 +29,15 @@ import org.springframework.stereotype.Service;
 @Service
 public class MMeterialReceiveLogServiceImpl extends SuperServiceImpl<MMeterialReceiveLogMapper, MMeterialReceiveLog> implements MMeterialReceiveLogService {
 
-   
+    @Override
+    public IPage<MMeterialReceiveLog> pageList(IPage page, LbqWrapper<MMeterialReceiveLog> wrapper) {
+        return baseMapper.pageList(page, wrapper);
+    }
+
+    @Override
+    public MMeterialReceiveLog save(MMeterialReceiveLogSaveDTO data) {
+        MMeterialReceiveLog module = BeanPlusUtil.toBean(data, MMeterialReceiveLog.class);
+        save(module);
+        return module;
+    }
 }

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/MachineCuttingToolServiceImpl.java

@@ -49,7 +49,7 @@ import java.util.Map;
 
 public class MachineCuttingToolServiceImpl extends SuperCacheServiceImpl<MachineCuttingToolMapper, MachineCuttingTool> implements MachineCuttingToolService {
 
-    @Value("${machineCuttingTools.synUrl}")
+//    @Value("${machineCuttingTools.synUrl}")
     private String synUrl;
     @Autowired
     private ProductionresourceviewMapper productionresourceviewMapper;

+ 12 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/MMeterialReceiveLogMapper.xml

@@ -20,8 +20,19 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time,create_user,update_time,update_user,
+        id,create_time,create_user,update_time,update_user,meterialCode,tradeMark,
         meterial_id, furnace_batch_no, bom_batch_no, batch_stand, factory, meterial_batch_no, factory_date
     </sql>
 
+
+    <!-- 分页 -->
+    <select id="pageList" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from (SELECT
+        l.*,m.meterial_code meterialCode,m.trade_mark tradeMark
+        from imcs_m_meterial_receive_log l
+        left join imcs_m_meterial m on l.meterial_id = m.id
+        ) s ${ew.customSqlSegment}
+    </select>
 </mapper>

+ 12 - 1
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionReadyCenter/MMeterialReceiveLogController.java

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.controller.productionReadyCenter;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
@@ -7,8 +8,12 @@ import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.productionReadyCenter.dto.MMeterialReceiveLogPageDTO;
 import com.github.zuihou.business.productionReadyCenter.dto.MMeterialReceiveLogSaveDTO;
 import com.github.zuihou.business.productionReadyCenter.dto.MMeterialReceiveLogUpdateDTO;
+import com.github.zuihou.business.productionReadyCenter.dto.PlatePageDTO;
 import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
+import com.github.zuihou.business.productionReadyCenter.entity.Plate;
 import com.github.zuihou.business.productionReadyCenter.service.MMeterialReceiveLogService;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
@@ -38,7 +43,13 @@ public class MMeterialReceiveLogController extends SuperController<MMeterialRece
 
     @Override
     public void query(PageParams<MMeterialReceiveLogPageDTO> params, IPage<MMeterialReceiveLog> page, Long defSize) {
+        MMeterialReceiveLogPageDTO data = params.getModel();
+        QueryWrap<MMeterialReceiveLog> wrap = handlerWrapper(null, params);
+        LbqWrapper<MMeterialReceiveLog> wrapper = wrap.lambda();
+        MMeterialReceiveLog log = BeanUtil.toBean(data, MMeterialReceiveLog.class);
 
+        wrapper.eq(MMeterialReceiveLog::getMeterialId,log.getMeterialId());
+        baseService.pageList(page, wrapper);
 
     }
 
@@ -50,7 +61,7 @@ public class MMeterialReceiveLogController extends SuperController<MMeterialRece
 
     @Override
     public R<MMeterialReceiveLog> handlerSave(MMeterialReceiveLogSaveDTO model) {
-        MMeterialReceiveLog MMeterialReceiveLog = null;
+        MMeterialReceiveLog MMeterialReceiveLog = baseService.save(model);
         return success(MMeterialReceiveLog);
     }
 

+ 18 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/MMeterialReceiveLog.java

@@ -15,6 +15,8 @@ import javax.validation.constraints.NotNull;
 import org.hibernate.validator.constraints.Length;
 import org.hibernate.validator.constraints.Range;
 import java.time.LocalDateTime;
+import java.util.Date;
+
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
@@ -106,13 +108,27 @@ public class MMeterialReceiveLog extends Entity<Long> {
     @ApiModelProperty(value = "入厂日期")
     @TableField("factory_date")
     @Excel(name = "入厂日期", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
-    private LocalDate factoryDate;
+    private Date factoryDate;
+
+
+    @ApiModelProperty(value = "物料编码")
+    @Length(max = 64, message = "物料编码长度不能超过64")
+    @TableField(exist = false)
+    @Excel(name = "物料编码")
+    private String meterialCode;
+
+
+    @ApiModelProperty(value = "牌号")
+    @Length(max = 64, message = "牌号长度不能超过64")
+    @TableField(exist = false)
+    @Excel(name = "牌号")
+    private String tradeMark;
 
 
     @Builder
     public MMeterialReceiveLog(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, 
                     Long meterialId, String furnaceBatchNo, String bomBatchNo, Integer batchStand, String factory, 
-                    String meterialBatchNo, LocalDate factoryDate) {
+                    String meterialBatchNo, Date factoryDate) {
         this.id = id;
         this.createTime = createTime;
         this.createUser = createUser;