Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

huangx 7 years ago
parent
commit
d177238b2e

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/BomMapper.java

@@ -28,4 +28,6 @@ public interface BomMapper extends CommonBaseMapper<Bom> {
     List<Bom> getListData(@Param("condition") String condition, @Param("companyId") Long companyId);
     List<Bom> getListData(@Param("condition") String condition, @Param("companyId") Long companyId);
 
 
     int getCountFromMake(Long id);
     int getCountFromMake(Long id);
+
+    void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long id);
 }
 }

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

@@ -44,6 +44,8 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
     public DocBaseDTO saveData(BomList bomList) {
     public DocBaseDTO saveData(BomList bomList) {
         Long id = bomList.getMain().getId();
         Long id = bomList.getMain().getId();
         Long companyId = BaseContextHolder.getCompanyId();
         Long companyId = BaseContextHolder.getCompanyId();
+        Long userId = BaseContextHolder.getUserId();
+        String userName = BaseContextHolder.getUserName();
         Bom bom = bomList.getMain();
         Bom bom = bomList.getMain();
         List<BomDetail> bomDetailList = bomList.getItems();
         List<BomDetail> bomDetailList = bomList.getItems();
         DocBaseDTO docBaseDTO = null;
         DocBaseDTO docBaseDTO = null;
@@ -56,6 +58,9 @@ public class BomServiceImpl extends CommonBaseServiceImpl<BomMapper, Bom> implem
                 bom.setCompanyId(companyId);
                 bom.setCompanyId(companyId);
                 //保存BOM
                 //保存BOM
                 getMapper().insertSelective(bom);
                 getMapper().insertSelective(bom);
+                id = bom.getId();
+                //录入人
+                getMapper().updateCreator(userId, userName, id);
                 if (bomDetailList.size() > 0) {
                 if (bomDetailList.size() > 0) {
                     //赋值BD_BOMID
                     //赋值BD_BOMID
                     for (BomDetail bomDetail : bomDetailList) {
                     for (BomDetail bomDetail : bomDetailList) {

+ 27 - 5
applications/document/document-server/src/main/resources/mapper/BomMapper.xml

@@ -14,7 +14,14 @@
     <result column="bo_recorddate" property="bo_recorddate" jdbcType="TIMESTAMP" />
     <result column="bo_recorddate" property="bo_recorddate" jdbcType="TIMESTAMP" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="companyId" property="companyId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
     <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+
+
+
     <result column="bo_text1" property="bo_text1" jdbcType="VARCHAR" />
     <result column="bo_text1" property="bo_text1" jdbcType="VARCHAR" />
     <result column="bo_text2" property="bo_text2" jdbcType="VARCHAR" />
     <result column="bo_text2" property="bo_text2" jdbcType="VARCHAR" />
     <result column="bo_text3" property="bo_text3" jdbcType="VARCHAR" />
     <result column="bo_text3" property="bo_text3" jdbcType="VARCHAR" />
@@ -27,8 +34,8 @@
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List" >
   <sql id="Base_Column_List" >
     bo_id, bo_motherid, bo_mothercode, bo_mothername, bo_version, bo_status, bo_statuscode, 
     bo_id, bo_motherid, bo_mothercode, bo_mothername, bo_version, bo_status, bo_statuscode, 
-    bo_recorderid, bo_recorder, bo_recorddate, companyId, updaterId, updateTime, bo_text1, 
-    bo_text2, bo_text3, bo_text4, bo_text5
+    bo_recorderid, bo_recorder, bo_recorddate, companyId, updaterId,updaterName,updateTime, bo_text1,
+    bo_text2, bo_text3, bo_text4, bo_text5,creatorName,creatorId,createTime
   </sql>
   </sql>
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
     select 
     select 
@@ -116,6 +123,12 @@
       <if test="bo_text5 != null" >
       <if test="bo_text5 != null" >
         bo_text5,
         bo_text5,
       </if>
       </if>
+      <if test="bo_text5 != null" >
+        bo_text5,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
     <trim prefix="values (" suffix=")" suffixOverrides="," >
       <if test="bo_motherid != null" >
       <if test="bo_motherid != null" >
@@ -169,6 +182,9 @@
       <if test="bo_text5 != null" >
       <if test="bo_text5 != null" >
         #{bo_text5,jdbcType=VARCHAR},
         #{bo_text5,jdbcType=VARCHAR},
       </if>
       </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP}
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bom" >
   <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Bom" >
@@ -273,7 +289,13 @@
     </where>
     </where>
     ORDER BY BO_ID DESC
     ORDER BY BO_ID DESC
   </select>
   </select>
-    <select id="getCountFromMake" parameterType="java.lang.Long" resultType="int">
-        SELECT COUNT(*) FROM MAKE WHERE MA_PRODID = #{id}
-    </select>
+  <select id="getCountFromMake" parameterType="java.lang.Long" resultType="int">
+      SELECT COUNT(*) FROM MAKE WHERE MA_PRODID = #{id}
+  </select>
+
+  <update id="updateCreator">
+    update bom set creatorId = #{userId} , creatorName=#{userName} where bo_id=#{id}
+  </update>
+
+
 </mapper>
 </mapper>