Prechádzať zdrojové kódy

计划订单query查询化学成分信息

@zhangxiaoyu122 3 rokov pred
rodič
commit
e3418f6d65

+ 12 - 0
src/main/java/com/steerinfo/ems/emsgmpcjh/controller/EmsGmPcJhController.java

@@ -3,6 +3,8 @@ package com.steerinfo.ems.emsgmpcjh.controller;
 import com.steerinfo.auth.utils.JwtUtil;
 import com.steerinfo.ems.Utils.DateUtils;
 import com.steerinfo.ems.Utils.ExcelToolUtils;
+import com.steerinfo.ems.chemicalconstituents.model.ChemicalConstituents;
+import com.steerinfo.ems.chemicalconstituents.service.IChemicalConstituentsService;
 import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
 import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
 import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
@@ -55,6 +57,8 @@ public class EmsGmPcJhController extends BaseRESTfulController {
     EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
     @Autowired
     IEmsWebsocketLogService emsWebsocketLogService;
+    @Autowired
+    IChemicalConstituentsService chemicalConstituentsService;
 
     @ApiOperation(value="获取列表", notes="分页查询")
     @ApiImplicitParams({
@@ -86,6 +90,14 @@ public class EmsGmPcJhController extends BaseRESTfulController {
             parmas.put("lengthTimesWidth", grades);
         }
         PageList<EmsGmPcJh> list = emsGmPcJhService.queryForPage(parmas, pageNum, pageSize);
+        //化学成分信息列表
+        for(Object list1:list.getList()){
+            EmsGmPcJh d = (EmsGmPcJh) list1;
+            List<ChemicalConstituents> dataByGmid = chemicalConstituentsService.getDataByGmid(d.getId());
+            if(dataByGmid.size()>0){
+                d.setDataByGmid(dataByGmid);
+            }
+        }
         return success(list);
     }
 

+ 16 - 1
src/main/java/com/steerinfo/ems/emsgmpcjh/model/EmsGmPcJh.java

@@ -1,12 +1,15 @@
 package com.steerinfo.ems.emsgmpcjh.model;
 
 import com.alibaba.fastjson.annotation.JSONField;
+import com.hnshituo.orm.annotation.Transient;
+import com.steerinfo.ems.chemicalconstituents.model.ChemicalConstituents;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import java.util.List;
 
 @ApiModel(value="国贸排产计划表")
 public class EmsGmPcJh implements IBasePO<String> {
@@ -112,6 +115,18 @@ public class EmsGmPcJh implements IBasePO<String> {
     @ApiModelProperty(value = "国贸审核时间",required = false)
     private Date   gmReviewerTime;
 
+    //化学成分信息
+    @Transient
+    private List<ChemicalConstituents> dataByGmid;
+
+    public List<ChemicalConstituents> getDataByGmid() {
+        return dataByGmid;
+    }
+
+    public void setDataByGmid(List<ChemicalConstituents> dataByGmid) {
+        this.dataByGmid = dataByGmid;
+    }
+
     public String getGmReviewer() {
         return gmReviewer;
     }
@@ -460,4 +475,4 @@ public class EmsGmPcJh implements IBasePO<String> {
         sb.append("]");
         return sb.toString();
     }
-}
+}