Browse Source

增加录入名称

guq 7 years ago
parent
commit
c6567ed4aa

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaleMapper.java

@@ -40,4 +40,6 @@ public interface SaleMapper extends CommonBaseMapper<Sale> {
     void updateNetTotal(Long id);
 
     Integer checkSendStatus(Long id);
+
+    void updateCreator(@Param("userId") Long userId, @Param("userName") String userName, @Param("id") Long id);
 }

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleServiceImpl.java

@@ -100,6 +100,7 @@ public class SaleServiceImpl implements SaleService{
         Long companyId = BaseContextHolder.getCompanyId();
         //人员Id
         Long userId = BaseContextHolder.getUserId();
+        String name = BaseContextHolder.getUserName();
         //获取主表信息
         SaleDTO main = formdata.getMain();
         List<SaleDetailDTO> items = formdata.getItems();
@@ -125,6 +126,7 @@ public class SaleServiceImpl implements SaleService{
             //插入操作
             saleMapper.insertSelective(sale);
             sa_id = sale.getId();
+            saleMapper.updateCreator(userId, name, sa_id);
             //添加从表传输对象
             for (SaleDetailDTO item : items) {
                 SaleDetail detail = BeanMapper.map(item, SaleDetail.class);

+ 5 - 0
applications/sale/sale-server/src/main/resources/mapper/SaleMapper.xml

@@ -33,6 +33,8 @@
     <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
     <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
     <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP"/>
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     sa_id, sa_code, sa_custid, sa_custcode, sa_custname, sa_toplace, sa_total, sa_totalupper, 
@@ -419,4 +421,7 @@
     select count(1) from saledetail where sd_said = #{id}
     and ifnull(sd_yqty, 0) > 0;
   </select>
+  <update id="updateCreator">
+    update sale set creatorId = #{userId} , creatorName=#{userName} where sa_id=#{id}
+  </update>
 </mapper>

+ 18 - 0
framework/core/src/main/java/com/usoftchina/saas/base/entity/CommonBaseEntity.java

@@ -16,6 +16,24 @@ public abstract class CommonBaseEntity extends BaseEntity<Long> {
     protected Long creatorId;
     protected Date updateTime;
     protected Long updaterId;
+    protected String creatorName;
+    protected String updaterName;
+
+    public String getCreatorName() {
+        return creatorName;
+    }
+
+    public void setCreatorName(String creatorName) {
+        this.creatorName = creatorName;
+    }
+
+    public String getUpdaterName() {
+        return updaterName;
+    }
+
+    public void setUpdaterName(String updaterName) {
+        this.updaterName = updaterName;
+    }
 
     @Override
     public Long getId() {