Browse Source

BOM资料查询返回值增加productDTO

chenw 7 years ago
parent
commit
ca0c214fc3

+ 12 - 0
applications/document/document-dto/src/main/java/com/usoftchina/saas/document/entities/BomDetail.java

@@ -1,6 +1,8 @@
 package com.usoftchina.saas.document.entities;
 
 import com.usoftchina.saas.base.entity.CommonBaseEntity;
+import com.usoftchina.saas.document.dto.ProductDTO;
+
 import java.io.Serializable;
 
 public class BomDetail extends CommonBaseEntity implements Serializable {
@@ -30,6 +32,16 @@ public class BomDetail extends CommonBaseEntity implements Serializable {
 
     private String bd_text5;
 
+    private ProductDTO productDTO;
+
+    public ProductDTO getProductDTO() {
+        return productDTO;
+    }
+
+    public void setProductDTO(ProductDTO productDTO) {
+        this.productDTO = productDTO;
+    }
+
     public Long getBd_bomid() {
         return bd_bomid;
     }

+ 3 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BomServiceImpl.java

@@ -112,8 +112,11 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
         if(id == null || id <= 0){
             throw new BizException(BizExceptionCode.ILLEGAL_ID);
         }
+        String code = getMapper().selectByPrimaryKey(id).getBo_mothercode();
         getMapper().deleteByPrimaryKey(id);
         bomDetailMapper.deleteByFK(id);
+        //记录LOG
+        messageLogService.delete(generateMsgObj(id, code));
     }
 
     @Override

+ 32 - 1
applications/document/document-server/src/main/resources/mapper/BomDetailMapper.xml

@@ -19,6 +19,37 @@
     <result column="bd_text3" property="bd_text3" jdbcType="VARCHAR" />
     <result column="bd_text4" property="bd_text4" jdbcType="VARCHAR" />
     <result column="bd_text5" property="bd_text5" jdbcType="VARCHAR" />
+    <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
+        <id column="pr_id" property="id" jdbcType="INTEGER" />
+        <result column="pr_code" property="pr_code" jdbcType="VARCHAR" />
+        <result column="pr_detail" property="pr_detail" jdbcType="VARCHAR" />
+        <result column="pr_spec" property="pr_spec" jdbcType="VARCHAR" />
+        <result column="pr_unit" property="pr_unit" jdbcType="VARCHAR" />
+        <result column="pr_kind" property="pr_kind" jdbcType="VARCHAR" />
+        <result column="pr_orispeccode" property="pr_orispeccode" jdbcType="VARCHAR" />
+        <result column="pr_whid" property="pr_whid" jdbcType="INTEGER" />
+        <result column="pr_whcode" property="pr_whcode" jdbcType="VARCHAR" />
+        <result column="pr_whname" property="pr_whname" jdbcType="VARCHAR" />
+        <result column="pr_zxbzs" property="pr_zxbzs" jdbcType="INTEGER" />
+        <result column="pr_leadtime" property="pr_leadtime" jdbcType="INTEGER" />
+        <result column="pr_brand" property="pr_brand" jdbcType="VARCHAR" />
+        <result column="pr_standardprice" property="pr_standardprice" jdbcType="DOUBLE" />
+        <result column="pr_purcprice" property="pr_purcprice" jdbcType="DOUBLE" />
+        <result column="pr_saleprice" property="pr_saleprice" jdbcType="DOUBLE" />
+        <result column="pr_vendid" property="pr_vendid" jdbcType="INTEGER" />
+        <result column="pr_vendcode" property="pr_vendcode" jdbcType="VARCHAR" />
+        <result column="pr_vendname" property="pr_vendname" jdbcType="VARCHAR" />
+        <result column="pr_docdate" property="pr_docdate" jdbcType="TIMESTAMP" />
+        <result column="pr_recordmanid" property="pr_recordmanid" jdbcType="INTEGER" />
+        <result column="pr_recordman" property="pr_recordman" jdbcType="VARCHAR" />
+        <result column="pr_status" property="pr_status" jdbcType="VARCHAR" />
+        <result column="pr_statuscode" property="pr_statuscode" jdbcType="VARCHAR" />
+        <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+        <result column="pr_text1" property="pr_text1" jdbcType="VARCHAR" />
+        <result column="pr_text2" property="pr_text2" jdbcType="VARCHAR" />
+        <result column="pr_text3" property="pr_text3" jdbcType="VARCHAR" />
+        <result column="pr_text4" property="pr_text4" jdbcType="VARCHAR" />
+    </association>
   </resultMap>
   <sql id="Base_Column_List" >
     bd_id, bd_bomid, bd_detno, bd_sonid, bd_soncode, bd_unit, bd_baseqty, bd_replace, 
@@ -308,6 +339,6 @@
     WHERE BD_BOMID=#{id}
   </delete>
   <select id="selectByFK" resultMap="BaseResultMap">
-    SELECT * FROM BOMDETAIL WHERE BD_BOMID = #{id}
+    SELECT * FROM BOMDETAIL LEFT JOIN PRODUCT ON PR_ID=BD_SONID WHERE BD_BOMID = #{id}
   </select>
 </mapper>