Browse Source

代码更新,自动合并

chenw 7 years ago
parent
commit
6f706b21a9
16 changed files with 1363 additions and 2 deletions
  1. 40 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/ApcheckController.java
  2. 19 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ApcheckMapper.java
  3. 28 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/ApcheckForm.java
  4. 16 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/ApcheckService.java
  5. 58 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/ApcheckServiceImpl.java
  6. 2 0
      applications/money/money-server/src/main/resources/application.yml
  7. 12 0
      applications/money/money-server/src/main/resources/config/application-dev.yml
  8. 446 0
      applications/money/money-server/src/main/resources/mapper/ApcheckMapper.xml
  9. 61 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleDownController.java
  10. 36 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaledownMapper.java
  11. 28 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleDownForm.java
  12. 20 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleDownService.java
  13. 112 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/impl/SaleDownServiceImpl.java
  14. 482 0
      applications/sale/sale-server/src/main/resources/mapper/SaledownMapper.xml
  15. 2 2
      frontend/saas-web/app/view/document/uusetting/UUSetting.js
  16. 1 0
      frontend/saas-web/app/view/document/uusetting/UUSettingWin.js

+ 40 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/controller/ApcheckController.java

@@ -0,0 +1,40 @@
+package com.usoftchina.saas.money.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.mapper.ApcheckMapper;
+import com.usoftchina.saas.money.po.Apcheck;
+import com.usoftchina.saas.money.po.ApcheckForm;
+import com.usoftchina.saas.money.service.ApcheckService;
+import com.usoftchina.saas.page.PageDefault;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: guq
+ * @create: 2019-01-16 08:41
+ **/
+@RestController
+@RequestMapping("/apcheck")
+public class ApcheckController {
+
+    @Autowired
+    private ApcheckService apcheckService;
+
+    @GetMapping("/list")
+    public Result getListData(@PageDefault PageRequest page, ListReqDTO req) {
+        PageInfo<Apcheck> list = apcheckService.getListData(page, req);
+        return Result.success(list);
+    }
+
+    @GetMapping("/read/{id}")
+    public Result getFormData(@PathVariable("id") Long id) {
+        ApcheckForm apcheckForm = apcheckService.getFormData(id);
+        return Result.success(apcheckForm);
+    }
+}

+ 19 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ApcheckMapper.java

@@ -0,0 +1,19 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Apcheck;
+import com.usoftchina.saas.money.po.ApcheckDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-01-16 08:43
+ **/
+public interface ApcheckMapper {
+    public List<Apcheck> selectListByCon(@Param("con") String con, @Param("companyId") Long companyId);
+
+    Apcheck selectByPrimaryKey(Long id);
+
+    List<ApcheckDetail> selectByFK(Long id);
+}

+ 28 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/ApcheckForm.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-01-16 09:13
+ **/
+public class ApcheckForm {
+    private Apcheck main;
+    private List<ApcheckDetail> items;
+
+    public Apcheck getMain() {
+        return main;
+    }
+
+    public void setMain(Apcheck main) {
+        this.main = main;
+    }
+
+    public List<ApcheckDetail> getItems() {
+        return items;
+    }
+
+    public void setItems(List<ApcheckDetail> items) {
+        this.items = items;
+    }
+}

+ 16 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/ApcheckService.java

@@ -0,0 +1,16 @@
+package com.usoftchina.saas.money.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.money.po.Apcheck;
+import com.usoftchina.saas.money.po.ApcheckForm;
+import com.usoftchina.saas.page.PageRequest; /**
+ * @author: guq
+ * @create: 2019-01-16 08:41
+ **/
+public interface ApcheckService {
+    PageInfo<Apcheck> getListData(PageRequest page, ListReqDTO req);
+
+    ApcheckForm getFormData(Long id);
+}

+ 58 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/ApcheckServiceImpl.java

@@ -0,0 +1,58 @@
+package com.usoftchina.saas.money.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.money.mapper.ApcheckMapper;
+import com.usoftchina.saas.money.po.Apcheck;
+import com.usoftchina.saas.money.po.ApcheckDetail;
+import com.usoftchina.saas.money.po.ApcheckForm;
+import com.usoftchina.saas.money.service.ApcheckService;
+import com.usoftchina.saas.page.PageRequest;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-01-16 08:41
+ **/
+@Service
+public class ApcheckServiceImpl implements ApcheckService{
+
+    @Autowired
+    private ApcheckMapper apcheckMapper;
+
+    @Override
+    public PageInfo<Apcheck> getListData(PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        Long companyId = BaseContextHolder.getCompanyId();
+        companyId = 334l;
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+        List<Apcheck> lists= apcheckMapper.selectListByCon(con, companyId);
+        //取分页信息
+        PageInfo<Apcheck> pageInfo = new PageInfo<Apcheck>(lists);
+        return pageInfo;
+    }
+
+    @Override
+    public ApcheckForm getFormData(Long id) {
+        if (null == id || "0".equals(id)) {
+            return null;
+        }
+        ApcheckForm saleFormDTO = new ApcheckForm();
+        //查询主表信息
+        Apcheck main = apcheckMapper.selectByPrimaryKey(id);
+        //查询从表
+        List<ApcheckDetail> items = apcheckMapper.selectByFK(id);
+        saleFormDTO.setMain(main);
+        saleFormDTO.setItems(items);
+        return saleFormDTO;
+    }
+}

+ 2 - 0
applications/money/money-server/src/main/resources/application.yml

@@ -36,6 +36,8 @@ spring:
   sleuth:
     sampler:
       probability: 1.0
+  profiles:
+    active: dev
 eureka:
   instance:
     leaseRenewalIntervalInSeconds: 10

+ 12 - 0
applications/money/money-server/src/main/resources/config/application-dev.yml

@@ -0,0 +1,12 @@
+eureka:
+  instance:
+    leaseRenewalIntervalInSeconds: 10
+    health-check-url-path: /actuator/health
+    status-page-url-path: /actuator/info
+    metadata-map:
+      user.name: ${spring.security.user.name}
+      user.password: ${spring.security.user.password}
+  client:
+    registryFetchIntervalSeconds: 5
+    serviceUrl:
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/

+ 446 - 0
applications/money/money-server/src/main/resources/mapper/ApcheckMapper.xml

@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.money.mapper.ApcheckMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Apcheck" >
+    <id column="ac_id" property="id" jdbcType="INTEGER" />
+    <result column="ac_b2bid" property="ac_b2bid" jdbcType="INTEGER" />
+    <result column="ac_code" property="ac_code" jdbcType="VARCHAR" />
+    <result column="ac_date" property="ac_date" jdbcType="TIMESTAMP" />
+    <result column="ac_apdate" property="ac_apdate" jdbcType="TIMESTAMP" />
+    <result column="ac_fromdate" property="ac_fromdate" jdbcType="TIMESTAMP" />
+    <result column="ac_todate" property="ac_todate" jdbcType="TIMESTAMP" />
+    <result column="ac_venduu" property="ac_venduu" jdbcType="VARCHAR" />
+    <result column="ac_vendid" property="ac_vendid" jdbcType="INTEGER" />
+    <result column="ac_vendcode" property="ac_vendcode" jdbcType="VARCHAR" />
+    <result column="ac_vendname" property="ac_vendname" jdbcType="VARCHAR" />
+    <result column="ac_currency" property="ac_currency" jdbcType="VARCHAR" />
+    <result column="ac_rate" property="ac_rate" jdbcType="DOUBLE" />
+    <result column="ac_checkamount" property="ac_checkamount" jdbcType="DOUBLE" />
+    <result column="ac_confirmstatus" property="ac_confirmstatus" jdbcType="VARCHAR" />
+    <result column="ac_confirmstatuscode" property="ac_confirmstatuscode" jdbcType="VARCHAR" />
+    <result column="ac_confirmdate" property="ac_confirmdate" jdbcType="TIMESTAMP" />
+    <result column="ac_remark" property="ac_remark" jdbcType="VARCHAR" />
+    <result column="ac_sendstatus" property="ac_sendstatus" jdbcType="VARCHAR" />
+    <result column="ac_thisamount" property="ac_thisamount" jdbcType="DOUBLE" />
+    <result column="ac_thisuncheck" property="ac_thisuncheck" jdbcType="DOUBLE" />
+    <result column="ac_thispay" property="ac_thispay" jdbcType="DOUBLE" />
+    <result column="ac_thissend" property="ac_thissend" jdbcType="DOUBLE" />
+    <result column="ac_thischeck" property="ac_thischeck" jdbcType="DOUBLE" />
+    <result column="ac_payamont" property="ac_payamont" jdbcType="DOUBLE" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="BIGINT" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="updaterName" property="updaterName" jdbcType="VARCHAR" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+
+  <resultMap id="detailMap" type="com.usoftchina.saas.money.po.ApcheckDetail">
+    <id column="ad_id" property="id" jdbcType="INTEGER" />
+    <result column="ad_acid" property="ad_acid" jdbcType="INTEGER" />
+    <result column="ad_detno" property="ad_detno" jdbcType="INTEGER" />
+    <result column="ad_inoutno" property="ad_inoutno" jdbcType="VARCHAR" />
+    <result column="ad_pdno" property="ad_pdno" jdbcType="INTEGER" />
+    <result column="ad_prodcode" property="ad_prodcode" jdbcType="VARCHAR" />
+    <result column="ad_pucode" property="ad_pucode" jdbcType="VARCHAR" />
+    <result column="ad_price" property="ad_price" jdbcType="DOUBLE" />
+    <result column="ad_taxrate" property="ad_taxrate" jdbcType="DOUBLE" />
+    <result column="ad_b2bqty" property="ad_b2bqty" jdbcType="DOUBLE" />
+    <result column="companyId" property="companyId" jdbcType="BIGINT" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+  </resultMap>
+
+  <sql id="Base_Column_List" >
+    ac_id, ac_b2bid, ac_code, ac_date, ac_apdate, ac_fromdate, ac_todate, ac_venduu, 
+    ac_vendid, ac_vendcode, ac_vendname, ac_currency, ac_rate, ac_checkamount, ac_confirmstatus, 
+    ac_confirmstatuscode, ac_confirmdate, ac_remark, ac_sendstatus, ac_thisamount, ac_thisuncheck, 
+    ac_thispay, ac_thissend, ac_thischeck, ac_payamont, creatorId, creatorName, companyId, 
+    updaterId, updaterName, updatetime, createTime
+  </sql>
+  <select id="selectListByCon" resultMap="BaseResultMap">
+    select  *  from apcheck
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by ac_id desc
+  </select>
+  <select id="selectByFK" resultMap="detailMap" parameterType="long">
+    select * from apcheckdetail where ad_acid=#{id}
+  </select>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="long" >
+    select 
+    <include refid="Base_Column_List" />
+    from apcheck
+    where ac_id = #{ac_id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from apcheck
+    where ac_id = #{ac_id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.money.po.Apcheck" >
+    insert into apcheck (ac_id, ac_b2bid, ac_code, 
+      ac_date, ac_apdate, ac_fromdate, 
+      ac_todate, ac_venduu, ac_vendid, 
+      ac_vendcode, ac_vendname, ac_currency, 
+      ac_rate, ac_checkamount, ac_confirmstatus, 
+      ac_confirmstatuscode, ac_confirmdate, 
+      ac_remark, ac_sendstatus, ac_thisamount, 
+      ac_thisuncheck, ac_thispay, ac_thissend, 
+      ac_thischeck, ac_payamont, creatorId, 
+      creatorName, companyId, updaterId, 
+      updaterName, updatetime, createTime
+      )
+    values (#{ac_id,jdbcType=INTEGER}, #{ac_b2bid,jdbcType=INTEGER}, #{ac_code,jdbcType=VARCHAR}, 
+      #{ac_date,jdbcType=TIMESTAMP}, #{ac_apdate,jdbcType=TIMESTAMP}, #{ac_fromdate,jdbcType=TIMESTAMP}, 
+      #{ac_todate,jdbcType=TIMESTAMP}, #{ac_venduu,jdbcType=VARCHAR}, #{ac_vendid,jdbcType=INTEGER}, 
+      #{ac_vendcode,jdbcType=VARCHAR}, #{ac_vendname,jdbcType=VARCHAR}, #{ac_currency,jdbcType=VARCHAR}, 
+      #{ac_rate,jdbcType=DOUBLE}, #{ac_checkamount,jdbcType=DOUBLE}, #{ac_confirmstatus,jdbcType=VARCHAR}, 
+      #{ac_confirmstatuscode,jdbcType=VARCHAR}, #{ac_confirmdate,jdbcType=TIMESTAMP}, 
+      #{ac_remark,jdbcType=VARCHAR}, #{ac_sendstatus,jdbcType=VARCHAR}, #{ac_thisamount,jdbcType=DOUBLE}, 
+      #{ac_thisuncheck,jdbcType=DOUBLE}, #{ac_thispay,jdbcType=DOUBLE}, #{ac_thissend,jdbcType=DOUBLE}, 
+      #{ac_thischeck,jdbcType=DOUBLE}, #{ac_payamont,jdbcType=DOUBLE}, #{creatorId,jdbcType=INTEGER}, 
+      #{creatorName,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, #{updaterId,jdbcType=INTEGER}, 
+      #{updaterName,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.money.po.Apcheck" >
+    insert into apcheck
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ac_id != null" >
+        ac_id,
+      </if>
+      <if test="ac_b2bid != null" >
+        ac_b2bid,
+      </if>
+      <if test="ac_code != null" >
+        ac_code,
+      </if>
+      <if test="ac_date != null" >
+        ac_date,
+      </if>
+      <if test="ac_apdate != null" >
+        ac_apdate,
+      </if>
+      <if test="ac_fromdate != null" >
+        ac_fromdate,
+      </if>
+      <if test="ac_todate != null" >
+        ac_todate,
+      </if>
+      <if test="ac_venduu != null" >
+        ac_venduu,
+      </if>
+      <if test="ac_vendid != null" >
+        ac_vendid,
+      </if>
+      <if test="ac_vendcode != null" >
+        ac_vendcode,
+      </if>
+      <if test="ac_vendname != null" >
+        ac_vendname,
+      </if>
+      <if test="ac_currency != null" >
+        ac_currency,
+      </if>
+      <if test="ac_rate != null" >
+        ac_rate,
+      </if>
+      <if test="ac_checkamount != null" >
+        ac_checkamount,
+      </if>
+      <if test="ac_confirmstatus != null" >
+        ac_confirmstatus,
+      </if>
+      <if test="ac_confirmstatuscode != null" >
+        ac_confirmstatuscode,
+      </if>
+      <if test="ac_confirmdate != null" >
+        ac_confirmdate,
+      </if>
+      <if test="ac_remark != null" >
+        ac_remark,
+      </if>
+      <if test="ac_sendstatus != null" >
+        ac_sendstatus,
+      </if>
+      <if test="ac_thisamount != null" >
+        ac_thisamount,
+      </if>
+      <if test="ac_thisuncheck != null" >
+        ac_thisuncheck,
+      </if>
+      <if test="ac_thispay != null" >
+        ac_thispay,
+      </if>
+      <if test="ac_thissend != null" >
+        ac_thissend,
+      </if>
+      <if test="ac_thischeck != null" >
+        ac_thischeck,
+      </if>
+      <if test="ac_payamont != null" >
+        ac_payamont,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="creatorName != null" >
+        creatorName,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+      <if test="updaterName != null" >
+        updaterName,
+      </if>
+      <if test="updatetime != null" >
+        updatetime,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ac_id != null" >
+        #{ac_id,jdbcType=INTEGER},
+      </if>
+      <if test="ac_b2bid != null" >
+        #{ac_b2bid,jdbcType=INTEGER},
+      </if>
+      <if test="ac_code != null" >
+        #{ac_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_date != null" >
+        #{ac_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_apdate != null" >
+        #{ac_apdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_fromdate != null" >
+        #{ac_fromdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_todate != null" >
+        #{ac_todate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_venduu != null" >
+        #{ac_venduu,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_vendid != null" >
+        #{ac_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="ac_vendcode != null" >
+        #{ac_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_vendname != null" >
+        #{ac_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_currency != null" >
+        #{ac_currency,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_rate != null" >
+        #{ac_rate,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_checkamount != null" >
+        #{ac_checkamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_confirmstatus != null" >
+        #{ac_confirmstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_confirmstatuscode != null" >
+        #{ac_confirmstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_confirmdate != null" >
+        #{ac_confirmdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_remark != null" >
+        #{ac_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_sendstatus != null" >
+        #{ac_sendstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_thisamount != null" >
+        #{ac_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thisuncheck != null" >
+        #{ac_thisuncheck,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thispay != null" >
+        #{ac_thispay,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thissend != null" >
+        #{ac_thissend,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thischeck != null" >
+        #{ac_thischeck,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_payamont != null" >
+        #{ac_payamont,jdbcType=DOUBLE},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null" >
+        #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=BIGINT},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterName != null" >
+        #{updaterName,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null" >
+        #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.money.po.Apcheck" >
+    update apcheck
+    <set >
+      <if test="ac_b2bid != null" >
+        ac_b2bid = #{ac_b2bid,jdbcType=INTEGER},
+      </if>
+      <if test="ac_code != null" >
+        ac_code = #{ac_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_date != null" >
+        ac_date = #{ac_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_apdate != null" >
+        ac_apdate = #{ac_apdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_fromdate != null" >
+        ac_fromdate = #{ac_fromdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_todate != null" >
+        ac_todate = #{ac_todate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_venduu != null" >
+        ac_venduu = #{ac_venduu,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_vendid != null" >
+        ac_vendid = #{ac_vendid,jdbcType=INTEGER},
+      </if>
+      <if test="ac_vendcode != null" >
+        ac_vendcode = #{ac_vendcode,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_vendname != null" >
+        ac_vendname = #{ac_vendname,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_currency != null" >
+        ac_currency = #{ac_currency,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_rate != null" >
+        ac_rate = #{ac_rate,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_checkamount != null" >
+        ac_checkamount = #{ac_checkamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_confirmstatus != null" >
+        ac_confirmstatus = #{ac_confirmstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_confirmstatuscode != null" >
+        ac_confirmstatuscode = #{ac_confirmstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_confirmdate != null" >
+        ac_confirmdate = #{ac_confirmdate,jdbcType=TIMESTAMP},
+      </if>
+      <if test="ac_remark != null" >
+        ac_remark = #{ac_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_sendstatus != null" >
+        ac_sendstatus = #{ac_sendstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="ac_thisamount != null" >
+        ac_thisamount = #{ac_thisamount,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thisuncheck != null" >
+        ac_thisuncheck = #{ac_thisuncheck,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thispay != null" >
+        ac_thispay = #{ac_thispay,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thissend != null" >
+        ac_thissend = #{ac_thissend,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_thischeck != null" >
+        ac_thischeck = #{ac_thischeck,jdbcType=DOUBLE},
+      </if>
+      <if test="ac_payamont != null" >
+        ac_payamont = #{ac_payamont,jdbcType=DOUBLE},
+      </if>
+      <if test="creatorId != null" >
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="creatorName != null" >
+        creatorName = #{creatorName,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=BIGINT},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+      <if test="updaterName != null" >
+        updaterName = #{updaterName,jdbcType=VARCHAR},
+      </if>
+      <if test="updatetime != null" >
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="createTime != null" >
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where ac_id = #{ac_id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.money.po.Apcheck" >
+    update apcheck
+    set ac_b2bid = #{ac_b2bid,jdbcType=INTEGER},
+      ac_code = #{ac_code,jdbcType=VARCHAR},
+      ac_date = #{ac_date,jdbcType=TIMESTAMP},
+      ac_apdate = #{ac_apdate,jdbcType=TIMESTAMP},
+      ac_fromdate = #{ac_fromdate,jdbcType=TIMESTAMP},
+      ac_todate = #{ac_todate,jdbcType=TIMESTAMP},
+      ac_venduu = #{ac_venduu,jdbcType=VARCHAR},
+      ac_vendid = #{ac_vendid,jdbcType=INTEGER},
+      ac_vendcode = #{ac_vendcode,jdbcType=VARCHAR},
+      ac_vendname = #{ac_vendname,jdbcType=VARCHAR},
+      ac_currency = #{ac_currency,jdbcType=VARCHAR},
+      ac_rate = #{ac_rate,jdbcType=DOUBLE},
+      ac_checkamount = #{ac_checkamount,jdbcType=DOUBLE},
+      ac_confirmstatus = #{ac_confirmstatus,jdbcType=VARCHAR},
+      ac_confirmstatuscode = #{ac_confirmstatuscode,jdbcType=VARCHAR},
+      ac_confirmdate = #{ac_confirmdate,jdbcType=TIMESTAMP},
+      ac_remark = #{ac_remark,jdbcType=VARCHAR},
+      ac_sendstatus = #{ac_sendstatus,jdbcType=VARCHAR},
+      ac_thisamount = #{ac_thisamount,jdbcType=DOUBLE},
+      ac_thisuncheck = #{ac_thisuncheck,jdbcType=DOUBLE},
+      ac_thispay = #{ac_thispay,jdbcType=DOUBLE},
+      ac_thissend = #{ac_thissend,jdbcType=DOUBLE},
+      ac_thischeck = #{ac_thischeck,jdbcType=DOUBLE},
+      ac_payamont = #{ac_payamont,jdbcType=DOUBLE},
+      creatorId = #{creatorId,jdbcType=INTEGER},
+      creatorName = #{creatorName,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=BIGINT},
+      updaterId = #{updaterId,jdbcType=INTEGER},
+      updaterName = #{updaterName,jdbcType=VARCHAR},
+      updatetime = #{updatetime,jdbcType=TIMESTAMP},
+      createTime = #{createTime,jdbcType=TIMESTAMP}
+    where ac_id = #{ac_id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 61 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/controller/SaleDownController.java

@@ -0,0 +1,61 @@
+package com.usoftchina.saas.sale.controller;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageDefault;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.po.SaleDownForm;
+import com.usoftchina.saas.sale.service.SaleDownService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author: guq
+ * @create: 2019-01-15 11:12
+ **/
+@Api(value = "SaleDownController", description = "客户采购单查看")
+@RestController
+@RequestMapping("saledown")
+public class SaleDownController {
+
+    @Autowired
+    private SaleDownService saleDownService;
+
+    @ApiOperation("获取客户采购单")
+    @GetMapping("/list")
+    public Result getListData(@PageDefault PageRequest page, ListReqDTO req) {
+        PageInfo listData = saleDownService.getListData(page, req);
+        return Result.success(listData);
+    }
+
+    @ApiOperation("更新客户采购单")
+    @PostMapping("/update")
+    public Result update(@RequestBody SaleDownForm saleDownForm) {
+        DocBaseDTO baseDTO = saleDownService.update(saleDownForm);
+        return Result.success(baseDTO);
+    }
+
+    /**
+     * 销售订单表单
+     *
+     * @return
+     */
+    @ApiOperation("读取客户采购单")
+    @GetMapping("/read/{id}")
+    public Result getFormData(@PathVariable("id") Long id) {
+        SaleDownForm formData = saleDownService.getFormData(id);
+        return Result.success(formData);
+    }
+
+    @ApiOperation("转销售订单")
+    @PostMapping("/toSale/{id}")
+    public Result toSale(@PathVariable("id") Long id) {
+
+        return Result.success();
+    }
+
+}

+ 36 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/mapper/SaledownMapper.java

@@ -0,0 +1,36 @@
+package com.usoftchina.saas.sale.mapper;
+
+import com.usoftchina.saas.document.entities.Customer;
+import com.usoftchina.saas.document.entities.Product;
+import com.usoftchina.saas.sale.po.SaleDetail;
+import com.usoftchina.saas.sale.po.SaleDown;
+import com.usoftchina.saas.sale.po.SaleDownDetail;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SaledownMapper {
+    int deleteByPrimaryKey(Integer sa_id);
+
+    int insert(SaleDown record);
+
+    int insertSelective(SaleDown record);
+
+    SaleDown selectByPrimaryKey(Long sa_id);
+
+    int updateByPrimaryKeySelective(SaleDown record);
+
+    void batchInsert(List<SaleDownDetail> insertDetail);
+
+    void batchUpdateClose(@Param("data") String data, @Param("companyid") Long companyid);
+
+    void batchUpdateResClose(@Param("data") String data, @Param("companyid") Long companyid);
+
+    Integer count(Long id);
+
+    List<SaleDownDetail> selectByFK(Long id);
+
+    List<SaleDown> selectListByCon(@Param("con") String con, @Param("companyId") Long companyId);
+
+    void batchUpdate(List<SaleDownDetail> updateDetails);
+}

+ 28 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/po/SaleDownForm.java

@@ -0,0 +1,28 @@
+package com.usoftchina.saas.sale.po;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-01-15 19:40
+ **/
+public class SaleDownForm {
+    private SaleDown main;
+    private List<SaleDownDetail> items;
+
+    public SaleDown getMain() {
+        return main;
+    }
+
+    public void setMain(SaleDown main) {
+        this.main = main;
+    }
+
+    public List<SaleDownDetail> getItems() {
+        return items;
+    }
+
+    public void setItems(List<SaleDownDetail> items) {
+        this.items = items;
+    }
+}

+ 20 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/service/SaleDownService.java

@@ -0,0 +1,20 @@
+package com.usoftchina.saas.sale.service;
+
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.po.SaleDownForm;
+
+/**
+ * @author: guq
+ * @create: 2019-01-15 11:15
+ **/
+public interface SaleDownService {
+
+    PageInfo getListData(PageRequest page, ListReqDTO req);
+
+    SaleDownForm getFormData(Long id);
+
+    DocBaseDTO update(SaleDownForm saleDownForm);
+}

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

@@ -0,0 +1,112 @@
+package com.usoftchina.saas.sale.service.impl;
+
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.dto.ListReqDTO;
+import com.usoftchina.saas.commons.exception.BizExceptionCode;
+import com.usoftchina.saas.commons.po.BillCodeSeq;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.sale.mapper.SaledownMapper;
+import com.usoftchina.saas.sale.po.*;
+import com.usoftchina.saas.sale.service.SaleDownService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2019-01-15 11:16
+ **/
+@Service
+public class SaleDownServiceImpl implements SaleDownService{
+
+    @Autowired
+    private SaledownMapper saledownMapper;
+
+    @Override
+    public PageInfo getListData(PageRequest page, ListReqDTO req) {
+        PageHelper.startPage(page.getNumber(), page.getSize());
+        //查询数据
+        Long companyId = BaseContextHolder.getCompanyId();
+        companyId = 334l;
+        String con = req.getFinalCondition();
+        if (null == con) {
+            con = "1=1";
+        }
+         List<SaleDown> lists= saledownMapper.selectListByCon(con, companyId);
+        //取分页信息
+        PageInfo<SaleDown> pageInfo = new PageInfo<SaleDown>(lists);
+        return pageInfo;
+    }
+
+    @Override
+    public DocBaseDTO update(SaleDownForm formdata) {
+        if (null == formdata || null == formdata.getMain()){
+            throw new BizException(BizExceptionCode.EMPTY_DATA);
+        }
+        //公司ID
+        Long companyId = BaseContextHolder.getCompanyId();
+        //人员Id
+        Long userId = BaseContextHolder.getUserId();
+        String name = BaseContextHolder.getUserName();
+        //获取主表信息
+        SaleDown main = formdata.getMain();
+        List<SaleDownDetail> items = formdata.getItems();
+        //插入从表数据
+        List<SaleDownDetail> insertDetails = new ArrayList<>();
+        //更新从表数据
+        List<SaleDownDetail> updateDetails = new ArrayList<>();
+        //返回对象
+        DocBaseDTO baseDTO = null;
+        Long sa_id = main.getId();
+        String sa_code = main.getSa_code();
+        //更新操作
+        saledownMapper.updateByPrimaryKeySelective(main);
+        //添加从表传输对象
+        for (SaleDownDetail detail : items) {
+            detail.setSd_said(sa_id);
+            detail.setSd_code(sa_code);
+            detail.setCompanyId(companyId);
+            if (StringUtils.isEmpty(detail.getId()) || "0".equals(detail.getId().toString())) {
+                detail.setCreatorId(userId);
+                detail.setCreatorName(BaseContextHolder.getUserName());
+                detail.setCreateTime(new Date());
+                insertDetails.add(detail);
+            } else {
+                updateDetails.add(detail);
+            }
+        }
+        //插入从表
+        if (insertDetails.size() > 0) {
+            saledownMapper.batchInsert(insertDetails);
+        }
+        //更新从表
+        if (updateDetails.size() > 0) {
+            saledownMapper.batchUpdate(updateDetails);
+        }
+        baseDTO = new DocBaseDTO(sa_id, sa_code, BillCodeSeq.SALEDOWN.getName());
+        return baseDTO;
+    }
+
+    @Override
+    public SaleDownForm getFormData(Long id) {
+        if (null == id || "0".equals(id)) {
+            return null;
+        }
+        SaleDownForm saleFormDTO = new SaleDownForm();
+        //查询主表信息
+        SaleDown main = saledownMapper.selectByPrimaryKey(id);
+        //查询从表
+        List<SaleDownDetail> items = saledownMapper.selectByFK(id);
+        saleFormDTO.setMain(main);
+        saleFormDTO.setItems(items);
+        return saleFormDTO;
+    }
+}

+ 482 - 0
applications/sale/sale-server/src/main/resources/mapper/SaledownMapper.xml

@@ -0,0 +1,482 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.sale.mapper.SaledownMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.sale.po.SaleDown" >
+    <id column="sa_id" property="id" jdbcType="INTEGER" />
+    <result column="sa_code" property="sa_code" jdbcType="VARCHAR" />
+    <result column="sa_customeruu" property="sa_customeruu" jdbcType="VARCHAR" />
+    <result column="sa_custid" property="sa_custid" jdbcType="INTEGER" />
+    <result column="sa_custcode" property="sa_custcode" jdbcType="VARCHAR" />
+    <result column="sa_custname" property="sa_custname" jdbcType="VARCHAR" />
+    <result column="sa_date" property="sa_date" jdbcType="TIMESTAMP" />
+    <result column="sa_toplace" property="sa_toplace" jdbcType="VARCHAR" />
+    <result column="sa_currency" property="sa_currency" jdbcType="VARCHAR" />
+    <result column="sa_rate" property="sa_rate" jdbcType="DOUBLE" />
+    <result column="sa_selleruu" property="sa_selleruu" jdbcType="INTEGER" />
+    <result column="sa_sellerid" property="sa_sellerid" jdbcType="INTEGER" />
+    <result column="sa_seller" property="sa_seller" jdbcType="VARCHAR" />
+    <result column="sa_sellercode" property="sa_sellercode" jdbcType="VARCHAR" />
+    <result column="sa_custcontact" property="sa_custcontact" jdbcType="VARCHAR" />
+    <result column="sa_custcontactuu" property="sa_custcontactuu" jdbcType="INTEGER" />
+    <result column="sa_custmobile" property="sa_custmobile" jdbcType="VARCHAR" />
+    <result column="sa_pocode" property="sa_pocode" jdbcType="VARCHAR" />
+    <result column="b2b_pu_id" property="b2b_pu_id" jdbcType="INTEGER" />
+    <result column="sa_printstatus" property="sa_printstatus" jdbcType="VARCHAR" />
+    <result column="sa_printstatuscode" property="sa_printstatuscode" jdbcType="VARCHAR" />
+    <result column="sa_attach" property="sa_attach" jdbcType="VARCHAR" />
+    <result column="sa_status" property="sa_status" jdbcType="VARCHAR" />
+    <result column="sa_statuscode" property="sa_statuscode" jdbcType="VARCHAR" />
+    <result column="sa_remark" property="sa_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+  </resultMap>
+
+  <sql id="Base_Column_List" >
+    sa_id, sa_code, sa_customeruu, sa_custid, sa_custcode, sa_custname, sa_date, sa_toplace, 
+    sa_currency, sa_rate, sa_selleruu, sa_sellerid, sa_seller, sa_sellercode, sa_custcontact, 
+    sa_custcontactuu, sa_custmobile, sa_pocode, b2b_pu_id, sa_printstatus, sa_printstatuscode, 
+    sa_attach, sa_status, sa_statuscode, sa_remark, companyId, createTime, creatorId, 
+    updateTime, updaterId
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="long" >
+    select 
+    <include refid="Base_Column_List" />
+    from saledown
+    where sa_id = #{sa_id}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from saledown
+    where sa_id = #{sa_id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.sale.po.SaleDown" >
+    insert into saledown (sa_code, sa_customeruu,
+      sa_custid, sa_custcode, sa_custname, 
+      sa_date, sa_toplace, sa_currency, 
+      sa_rate, sa_selleruu, sa_sellerid, 
+      sa_seller, sa_sellercode, sa_custcontact, 
+      sa_custcontactuu, sa_custmobile, sa_pocode, 
+      b2b_pu_id, sa_printstatus, sa_printstatuscode, 
+      sa_attach, sa_status, sa_statuscode, 
+      sa_remark, companyId, createTime, 
+      creatorId, updateTime, updaterId
+      )
+    values ( #{sa_code,jdbcType=VARCHAR}, #{sa_customeruu,jdbcType=VARCHAR},
+      #{sa_custid,jdbcType=INTEGER}, #{sa_custcode,jdbcType=VARCHAR}, #{sa_custname,jdbcType=VARCHAR}, 
+      #{sa_date,jdbcType=TIMESTAMP}, #{sa_toplace,jdbcType=VARCHAR}, #{sa_currency,jdbcType=VARCHAR}, 
+      #{sa_rate,jdbcType=DOUBLE}, #{sa_selleruu,jdbcType=INTEGER}, #{sa_sellerid,jdbcType=INTEGER}, 
+      #{sa_seller,jdbcType=VARCHAR}, #{sa_sellercode,jdbcType=VARCHAR}, #{sa_custcontact,jdbcType=VARCHAR}, 
+      #{sa_custcontactuu,jdbcType=INTEGER}, #{sa_custmobile,jdbcType=VARCHAR}, #{sa_pocode,jdbcType=VARCHAR}, 
+      #{b2b_pu_id,jdbcType=INTEGER}, #{sa_printstatus,jdbcType=VARCHAR}, #{sa_printstatuscode,jdbcType=VARCHAR}, 
+      #{sa_attach,jdbcType=VARCHAR}, #{sa_status,jdbcType=VARCHAR}, #{sa_statuscode,jdbcType=VARCHAR}, 
+      #{sa_remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{creatorId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.sale.po.SaleDown" >
+    <selectKey  resultType="java.lang.Long" keyProperty="id">
+      SELECT LAST_INSERT_ID() AS ID
+    </selectKey>
+    insert into saledown
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="sa_code != null" >
+        sa_code,
+      </if>
+      <if test="sa_customeruu != null" >
+        sa_customeruu,
+      </if>
+      <if test="sa_custid != null" >
+        sa_custid,
+      </if>
+      <if test="sa_custcode != null" >
+        sa_custcode,
+      </if>
+      <if test="sa_custname != null" >
+        sa_custname,
+      </if>
+      <if test="sa_date != null" >
+        sa_date,
+      </if>
+      <if test="sa_toplace != null" >
+        sa_toplace,
+      </if>
+      <if test="sa_currency != null" >
+        sa_currency,
+      </if>
+      <if test="sa_rate != null" >
+        sa_rate,
+      </if>
+      <if test="sa_selleruu != null" >
+        sa_selleruu,
+      </if>
+      <if test="sa_sellerid != null" >
+        sa_sellerid,
+      </if>
+      <if test="sa_seller != null" >
+        sa_seller,
+      </if>
+      <if test="sa_sellercode != null" >
+        sa_sellercode,
+      </if>
+      <if test="sa_custcontact != null" >
+        sa_custcontact,
+      </if>
+      <if test="sa_custcontactuu != null" >
+        sa_custcontactuu,
+      </if>
+      <if test="sa_custmobile != null" >
+        sa_custmobile,
+      </if>
+      <if test="sa_pocode != null" >
+        sa_pocode,
+      </if>
+      <if test="b2b_pu_id != null" >
+        b2b_pu_id,
+      </if>
+      <if test="sa_printstatus != null" >
+        sa_printstatus,
+      </if>
+      <if test="sa_printstatuscode != null" >
+        sa_printstatuscode,
+      </if>
+      <if test="sa_attach != null" >
+        sa_attach,
+      </if>
+      <if test="sa_status != null" >
+        sa_status,
+      </if>
+      <if test="sa_statuscode != null" >
+        sa_statuscode,
+      </if>
+      <if test="sa_remark != null" >
+        sa_remark,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="sa_code != null" >
+        #{sa_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_customeruu != null" >
+        #{sa_customeruu,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custid != null" >
+        #{sa_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sa_custcode != null" >
+        #{sa_custcode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custname != null" >
+        #{sa_custname,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_date != null" >
+        #{sa_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sa_toplace != null" >
+        #{sa_toplace,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_currency != null" >
+        #{sa_currency,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_rate != null" >
+        #{sa_rate,jdbcType=DOUBLE},
+      </if>
+      <if test="sa_selleruu != null" >
+        #{sa_selleruu,jdbcType=INTEGER},
+      </if>
+      <if test="sa_sellerid != null" >
+        #{sa_sellerid,jdbcType=INTEGER},
+      </if>
+      <if test="sa_seller != null" >
+        #{sa_seller,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_sellercode != null" >
+        #{sa_sellercode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custcontact != null" >
+        #{sa_custcontact,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custcontactuu != null" >
+        #{sa_custcontactuu,jdbcType=INTEGER},
+      </if>
+      <if test="sa_custmobile != null" >
+        #{sa_custmobile,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_pocode != null" >
+        #{sa_pocode,jdbcType=VARCHAR},
+      </if>
+      <if test="b2b_pu_id != null" >
+        #{b2b_pu_id,jdbcType=INTEGER},
+      </if>
+      <if test="sa_printstatus != null" >
+        #{sa_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_printstatuscode != null" >
+        #{sa_printstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_attach != null" >
+        #{sa_attach,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_status != null" >
+        #{sa_status,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_statuscode != null" >
+        #{sa_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_remark != null" >
+        #{sa_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.sale.po.SaleDown" >
+    update saledown
+    <set >
+      <if test="sa_code != null" >
+        sa_code = #{sa_code,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_customeruu != null" >
+        sa_customeruu = #{sa_customeruu,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custid != null" >
+        sa_custid = #{sa_custid,jdbcType=INTEGER},
+      </if>
+      <if test="sa_custcode != null" >
+        sa_custcode = #{sa_custcode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custname != null" >
+        sa_custname = #{sa_custname,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_date != null" >
+        sa_date = #{sa_date,jdbcType=TIMESTAMP},
+      </if>
+      <if test="sa_toplace != null" >
+        sa_toplace = #{sa_toplace,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_currency != null" >
+        sa_currency = #{sa_currency,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_rate != null" >
+        sa_rate = #{sa_rate,jdbcType=DOUBLE},
+      </if>
+      <if test="sa_selleruu != null" >
+        sa_selleruu = #{sa_selleruu,jdbcType=INTEGER},
+      </if>
+      <if test="sa_sellerid != null" >
+        sa_sellerid = #{sa_sellerid,jdbcType=INTEGER},
+      </if>
+      <if test="sa_seller != null" >
+        sa_seller = #{sa_seller,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_sellercode != null" >
+        sa_sellercode = #{sa_sellercode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custcontact != null" >
+        sa_custcontact = #{sa_custcontact,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_custcontactuu != null" >
+        sa_custcontactuu = #{sa_custcontactuu,jdbcType=INTEGER},
+      </if>
+      <if test="sa_custmobile != null" >
+        sa_custmobile = #{sa_custmobile,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_pocode != null" >
+        sa_pocode = #{sa_pocode,jdbcType=VARCHAR},
+      </if>
+      <if test="b2b_pu_id != null" >
+        b2b_pu_id = #{b2b_pu_id,jdbcType=INTEGER},
+      </if>
+      <if test="sa_printstatus != null" >
+        sa_printstatus = #{sa_printstatus,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_printstatuscode != null" >
+        sa_printstatuscode = #{sa_printstatuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_attach != null" >
+        sa_attach = #{sa_attach,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_status != null" >
+        sa_status = #{sa_status,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_statuscode != null" >
+        sa_statuscode = #{sa_statuscode,jdbcType=VARCHAR},
+      </if>
+      <if test="sa_remark != null" >
+        sa_remark = #{sa_remark,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where sa_id = #{sa_id,jdbcType=INTEGER}
+  </update>
+
+  <insert id="batchInsert" parameterType="java.util.List" >
+    insert into saledowndetail (sd_said, sd_detno,sd_code,
+    sd_prodid, sd_prodcode, sd_prodspec,sd_orispeccode,sd_produnit,
+    sd_custorispeccode,sd_custprodcode,sd_custproddetail,sd_custprodspec,
+    sd_qty,
+    sd_price, sd_total, sd_taxrate,
+    sd_delivery,
+    sd_remark,
+    companyId,createTime,b2b_pd_id)
+    values
+    <foreach collection="list" item="item" index="index" open="" close="" separator=",">
+      (
+      #{item.sd_said,jdbcType=INTEGER}, #{item.sd_detno,jdbcType=INTEGER},#{item.sd_code,jdbcType=VARCHAR},
+      #{item.sd_prodid,jdbcType=INTEGER}, #{item.sd_prodcode,jdbcType=VARCHAR},
+      #{item.sd_prodspec,jdbcType=VARCHAR},#{item.sd_orispeccode,jdbcType=VARCHAR},#{item.sd_produnit,jdbcType=VARCHAR},
+      #{item.sd_custorispeccode,jdbcType=VARCHAR},#{item.sd_custprodcode,jdbcType=VARCHAR},#{item.sd_custproddetail,jdbcType=VARCHAR},
+      #{item.sd_custprodspec,jdbcType=VARCHAR},
+      #{item.sd_qty,jdbcType=DOUBLE},
+      #{item.sd_price,jdbcType=DOUBLE}, #{item.sd_total,jdbcType=DOUBLE}, #{item.sd_taxrate,jdbcType=DOUBLE},
+     #{item.sd_delivery,jdbcType=TIMESTAMP},
+     #{item.sd_remark,jdbcType=VARCHAR},
+      #{item.companyId,jdbcType=INTEGER},#{item.createTime,jdbcType=TIMESTAMP}, #{item.b2b_pd_id}
+      )
+    </foreach>
+  </insert>
+
+  <update id="batchUpdateClose">
+    update saledown set sa_status='已关闭', sa_statuscode='CLOSE' where
+    b2b_pu_id in (${data}) and companyid =${companyid}
+  </update>
+
+  <update id="batchUpdateResClose">
+    update saledown set sa_status='已审核',sa_statuscode='AUDITED' where
+      b2b_pu_id in (${data}) and companyid =${companyid}
+  </update>
+
+
+  <select id="count" parameterType="long" resultType="int">
+    select count(1) from saledown where B2b_pu_id = #{id}
+  </select>
+
+  <resultMap id="detailMap" type="com.usoftchina.saas.sale.po.SaleDownDetail" >
+    <id column="sd_id" property="id" jdbcType="INTEGER" />
+    <result column="sd_said" property="sd_said" jdbcType="INTEGER" />
+    <result column="sd_code" property="sd_code" jdbcType="VARCHAR" />
+    <result column="sd_detno" property="sd_detno" jdbcType="INTEGER" />
+    <result column="b2b_pd_id" property="b2b_pd_id" jdbcType="INTEGER" />
+    <result column="sd_prodid" property="sd_prodid" jdbcType="INTEGER" />
+    <result column="sd_prodcode" property="sd_prodcode" jdbcType="VARCHAR" />
+    <result column="sd_prodspec" property="sd_prodspec" jdbcType="VARCHAR" />
+    <result column="sd_orispeccode" property="sd_orispeccode" jdbcType="VARCHAR" />
+    <result column="sd_custorispeccode" property="sd_custorispeccode" jdbcType="VARCHAR" />
+    <result column="sd_custprodcode" property="sd_custprodcode" jdbcType="VARCHAR" />
+    <result column="sd_custproddetail" property="sd_custproddetail" jdbcType="VARCHAR" />
+    <result column="sd_custprodspec" property="sd_custprodspec" jdbcType="VARCHAR" />
+    <result column="sd_produnit" property="sd_produnit" jdbcType="VARCHAR" />
+    <result column="sd_qty" property="sd_qty" jdbcType="DOUBLE" />
+    <result column="sd_price" property="sd_price" jdbcType="DOUBLE" />
+    <result column="sd_total" property="sd_total" jdbcType="DOUBLE" />
+    <result column="sd_taxrate" property="sd_taxrate" jdbcType="DOUBLE" />
+    <result column="sd_costprice" property="sd_costprice" jdbcType="DOUBLE" />
+    <result column="sd_taxtotal" property="sd_taxtotal" jdbcType="DOUBLE" />
+    <result column="sd_delivery" property="sd_delivery" jdbcType="TIMESTAMP" />
+    <result column="sd_remark" property="sd_remark" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="creatorName" property="creatorName" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Detail_Column_List" >
+    sd_id, sd_said, sd_code, sd_detno, b2b_pd_id, sd_prodid, sd_prodcode, sd_prodspec,
+    sd_orispeccode, sd_custorispeccode, sd_custprodcode, sd_custproddetail, sd_custprodspec,
+    sd_produnit, sd_qty, sd_price, sd_total, sd_taxrate, sd_costprice, sd_taxtotal, sd_delivery,
+    sd_remark, companyId, createTime, creatorId, updateTime, updaterId, creatorName
+  </sql>
+
+  <select id="selectByFK" parameterType="long" resultMap="detailMap">
+    select * from saledowndetail where sd_said=#{id}
+  </select>
+
+  <select id="selectListByCon" resultMap="BaseResultMap">
+    select  *  from saledown
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  companyId = #{companyId}
+      </if>
+    </where>
+    order by sa_id desc
+  </select>
+
+  <update id="batchUpdate" parameterType="com.usoftchina.saas.sale.po.SaleDownDetail">
+    <foreach collection="list" item="item" index="index" open="" close="" separator=";">
+      update saledetail <set>
+      sd_said = #{item.sd_said},
+      sd_detno = #{item.sd_detno},
+      sd_prodid = #{item.sd_prodid},
+      sd_prodcode = #{item.sd_prodcode},
+      sd_qty = #{item.sd_qty,jdbcType=DOUBLE},
+      sd_price = #{item.sd_price,jdbcType=DOUBLE},
+      sd_total = #{item.sd_total,jdbcType=DOUBLE},
+      sd_taxrate = #{item.sd_taxrate,jdbcType=DOUBLE},
+      sd_netprice = #{item.sd_netprice,jdbcType=DOUBLE},
+      sd_nettotal = #{item.sd_nettotal,jdbcType=DOUBLE},
+      sd_delivery = #{item.sd_delivery,jdbcType=TIMESTAMP},
+      sd_sendqty = #{item.sd_sendqty,jdbcType=DOUBLE},
+      sd_pdqty = #{item.sd_pdqty,jdbcType=DOUBLE},
+      sd_remark = #{item.sd_remark,jdbcType=VARCHAR},
+      companyId = #{item.companyId,jdbcType=INTEGER},
+      updaterId = #{item.updaterId,jdbcType=INTEGER},
+      updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
+      sd_text1 = #{item.sd_text1,jdbcType=VARCHAR},
+      sd_text2 = #{item.sd_text2,jdbcType=VARCHAR},
+      sd_text3 = #{item.sd_text3,jdbcType=VARCHAR},
+      sd_text4 = #{item.sd_text4,jdbcType=VARCHAR},
+      sd_text5 = #{item.sd_text5,jdbcType=VARCHAR},
+      sd_yqty = #{item.sd_yqty,jdbcType=DOUBLE},
+      sd_code = #{item.sd_code,jdbcType=VARCHAR}
+    </set>
+      where sd_id = #{item.id,jdbcType=INTEGER}
+    </foreach>
+  </update>
+</mapper>

+ 2 - 2
frontend/saas-web/app/view/document/uusetting/UUSetting.js

@@ -34,7 +34,7 @@ Ext.define('saas.view.document.uusetting.UUSetting', {
             }, {
                 text: '供应商名称',
                 dataIndex: 've_name',
-                width: 120
+                width: 200
             }, {
                 text: '状态',
                 dataIndex: 've_status',
@@ -63,7 +63,7 @@ Ext.define('saas.view.document.uusetting.UUSetting', {
             }, {
                 text: '客户名称',
                 dataIndex: 'cu_name',
-                width: 120
+                width: 200
             }, {
                 text: '状态',
                 dataIndex: 'cu_status',

+ 1 - 0
frontend/saas-web/app/view/document/uusetting/UUSettingWin.js

@@ -342,6 +342,7 @@ Ext.define('saas.view.document.uusetting.UUSettingWin', {
             columns: [{
                 text: '企业名称',
                 dataIndex: 'name',
+                width: 200
             }, {
                 text: 'UU',
                 dataIndex: 'uu'