3 次代碼提交 1015e78b9a ... 13ccc4962c

作者 SHA1 備註 提交日期
  zhangding 13ccc4962c 提交生成pdf代码 4 年之前
  zhangding 81cec8aea9 Merge branch 'master' of http://git.dgtis.com/qxp/suishenbang-oneportal 4 年之前
  zhangding 4c67e05d14 提交企业信息处理代码 4 年之前

+ 26 - 0
suishenbang-order/src/main/java/com/dgtly/order/controller/OrderCustomersController.java

@@ -96,5 +96,31 @@ public class OrderCustomersController extends BaseController
         return prefix + "/edit";
     }
 
+    @GetMapping("/dealHistoryData")
+    @ResponseBody
+    public Object dealHistoryData(String customerCode){
+        String str="";
+        String url = "";
+        if (customerCode!=null&&customerCode!=""){
+             url = cloudPath +"order/order/meta-hana-sales-order/dealHistoryData?customerCode="+customerCode;
+        }else {
+             url = cloudPath +"order/order/meta-hana-sales-order/dealHistoryData";
+        }
+        try {
+            //设置为form方式
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+//            MultiValueMap<String, Object> map = MapDataUtil.convertMultiValueMap(null);
+//            HttpEntity<Object> requestEntity
+//                    = new HttpEntity<>(map, headers);
+            str = restTemplate.getForObject(url, String.class);
+        }catch (Exception e){
+            logger.error("经销商历史数据处理接口报错:"+url,e);
+            throw e;
+        }
+        JSONObject json = JSONObject.parseObject(str);
+        return json;
+    }
+
 
 }

+ 44 - 0
suishenbang-order/src/main/resources/templates/order/customers/customers.html

@@ -44,6 +44,9 @@
             </div>
 
             <div class="btn-group-sm" id="toolbar" role="group">
+                <a class="btn btn-success" id="dealHistoryDataAll">
+                    <i class="fa fa-plus"></i> 全部处理
+                </a>
                 <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:customers:add">-->
                     <!--<i class="fa fa-plus"></i> 添加-->
                 <!--</a>-->
@@ -122,6 +125,7 @@
                     formatter: function(value, row, index) {
                         var actions = [];
                         actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.editTitle(\'' + row.id + '\')"><i class="fa fa-edit"></i>详情</a> ');
+                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="dealHistoryData(\'' + row.chainsCode + '\')"><i class="fa fa-edit"></i>处理</a> ');
                         return actions.join('');
                     }
                 }]
@@ -135,7 +139,47 @@
                 val = val.replace(/^\s+|\s+$/g,"")
                 $(event.target).val(val);
             })
+
+
+
+            $("#dealHistoryDataAll").click(function () {
+                $.ajax({
+                    cache : true,
+                    type : "GET",
+                    url : prefix+"/dealHistoryData",
+                    error : function(request) {
+                        $.modal.alertError("系统错误");
+                    },
+                    success : function(data) {
+                        if (data.success){
+                            alert("处理完成");
+                        } else {
+                            alert("处理失败");
+                        }
+                    }
+                })
+            })
         });
+        function dealHistoryData(customerCode){
+            $.ajax({
+                cache : true,
+                type : "GET",
+                url : prefix+"/dealHistoryData",
+                data : {
+                    "customerCode":customerCode
+                },
+                error : function(request) {
+                    $.modal.alertError("系统错误");
+                },
+                success : function(data) {
+                    if (data.success){
+                        alert("处理完成");
+                    } else {
+                        alert("处理失败");
+                    }
+                }
+            })
+        }
     </script>
 </body>
 </html>

+ 348 - 0
suishenbang-system/src/main/java/com/dgtly/system/domain/MetaHanaSalesOrder.java

@@ -0,0 +1,348 @@
+package com.dgtly.system.domain;
+
+import com.dgtly.common.core.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author csz
+ * @since 2020-07-30
+ */
+public class MetaHanaSalesOrder extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    private String docNumber;
+
+
+    private String docItem;
+
+
+    private String salesOrg;
+
+
+    private String salesOrgName;
+
+    private String distributionChannel;
+
+    private String customerCode;
+
+    private String customerName;
+
+    private String route;
+
+    private String division;
+
+    private String salesGroup;
+
+    private String plant;
+
+    private String docType;
+
+    private String createDate;
+
+    private String createDateItem;
+
+    private String deliverStatus;
+
+    private String materialCode;
+
+    private String materialName;
+
+    private String sizeDim;
+
+    private String creditDate;
+
+    private String creditStatus;
+
+    private String rejectReason;
+
+    private BigDecimal noDeliverQty;
+
+    private BigDecimal noDeliverWt;
+
+    private BigDecimal noDeliverAmt;
+
+    private BigDecimal deliverQty;
+
+    private BigDecimal deliverWt;
+
+    private BigDecimal deliverAmt;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date expectedTime;
+
+    private String expectedTimeStr;//预期到货时间 字符串
+
+    public String getDocNumber() {
+        return docNumber;
+    }
+
+    public void setDocNumber(String docNumber) {
+        this.docNumber = docNumber;
+    }
+
+    public String getDocItem() {
+        return docItem;
+    }
+
+    public void setDocItem(String docItem) {
+        this.docItem = docItem;
+    }
+
+    public String getSalesOrg() {
+        return salesOrg;
+    }
+
+    public void setSalesOrg(String salesOrg) {
+        this.salesOrg = salesOrg;
+    }
+
+    public String getSalesOrgName() {
+        return salesOrgName;
+    }
+
+    public void setSalesOrgName(String salesOrgName) {
+        this.salesOrgName = salesOrgName;
+    }
+
+    public String getDistributionChannel() {
+        return distributionChannel;
+    }
+
+    public void setDistributionChannel(String distributionChannel) {
+        this.distributionChannel = distributionChannel;
+    }
+
+    public String getCustomerCode() {
+        return customerCode;
+    }
+
+    public void setCustomerCode(String customerCode) {
+        this.customerCode = customerCode;
+    }
+
+    public String getCustomerName() {
+        return customerName;
+    }
+
+    public void setCustomerName(String customerName) {
+        this.customerName = customerName;
+    }
+
+    public String getRoute() {
+        return route;
+    }
+
+    public void setRoute(String route) {
+        this.route = route;
+    }
+
+    public String getDivision() {
+        return division;
+    }
+
+    public void setDivision(String division) {
+        this.division = division;
+    }
+
+    public String getSalesGroup() {
+        return salesGroup;
+    }
+
+    public void setSalesGroup(String salesGroup) {
+        this.salesGroup = salesGroup;
+    }
+
+    public String getPlant() {
+        return plant;
+    }
+
+    public void setPlant(String plant) {
+        this.plant = plant;
+    }
+
+    public String getDocType() {
+        return docType;
+    }
+
+    public void setDocType(String docType) {
+        this.docType = docType;
+    }
+
+    public String getCreateDate() {
+        return createDate;
+    }
+
+    public void setCreateDate(String createDate) {
+        this.createDate = createDate;
+    }
+
+    public String getCreateDateItem() {
+        return createDateItem;
+    }
+
+    public void setCreateDateItem(String createDateItem) {
+        this.createDateItem = createDateItem;
+    }
+
+    public String getDeliverStatus() {
+        return deliverStatus;
+    }
+
+    public void setDeliverStatus(String deliverStatus) {
+        this.deliverStatus = deliverStatus;
+    }
+
+    public String getMaterialCode() {
+        return materialCode;
+    }
+
+    public void setMaterialCode(String materialCode) {
+        this.materialCode = materialCode;
+    }
+
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
+    public String getSizeDim() {
+        return sizeDim;
+    }
+
+    public void setSizeDim(String sizeDim) {
+        this.sizeDim = sizeDim;
+    }
+
+    public String getCreditDate() {
+        return creditDate;
+    }
+
+    public void setCreditDate(String creditDate) {
+        this.creditDate = creditDate;
+    }
+
+    public String getCreditStatus() {
+        return creditStatus;
+    }
+
+    public void setCreditStatus(String creditStatus) {
+        this.creditStatus = creditStatus;
+    }
+
+    public String getRejectReason() {
+        return rejectReason;
+    }
+
+    public void setRejectReason(String rejectReason) {
+        this.rejectReason = rejectReason;
+    }
+
+    public BigDecimal getNoDeliverQty() {
+        return noDeliverQty;
+    }
+
+    public void setNoDeliverQty(BigDecimal noDeliverQty) {
+        this.noDeliverQty = noDeliverQty;
+    }
+
+    public BigDecimal getNoDeliverWt() {
+        return noDeliverWt;
+    }
+
+    public void setNoDeliverWt(BigDecimal noDeliverWt) {
+        this.noDeliverWt = noDeliverWt;
+    }
+
+    public BigDecimal getNoDeliverAmt() {
+        return noDeliverAmt;
+    }
+
+    public void setNoDeliverAmt(BigDecimal noDeliverAmt) {
+        this.noDeliverAmt = noDeliverAmt;
+    }
+
+    public BigDecimal getDeliverQty() {
+        return deliverQty;
+    }
+
+    public void setDeliverQty(BigDecimal deliverQty) {
+        this.deliverQty = deliverQty;
+    }
+
+    public BigDecimal getDeliverWt() {
+        return deliverWt;
+    }
+
+    public void setDeliverWt(BigDecimal deliverWt) {
+        this.deliverWt = deliverWt;
+    }
+
+    public BigDecimal getDeliverAmt() {
+        return deliverAmt;
+    }
+
+    public void setDeliverAmt(BigDecimal deliverAmt) {
+        this.deliverAmt = deliverAmt;
+    }
+
+    public Date getExpectedTime() {
+        return expectedTime;
+    }
+
+    public void setExpectedTime(Date expectedTime) {
+        this.expectedTime = expectedTime;
+    }
+
+    public String getExpectedTimeStr() {
+        return expectedTimeStr;
+    }
+
+    public void setExpectedTimeStr(String expectedTimeStr) {
+        this.expectedTimeStr = expectedTimeStr;
+    }
+
+    @Override
+    public String toString() {
+        return "MetaHanaSalesOrder{" +
+                "docNumber='" + docNumber + '\'' +
+                ", docItem='" + docItem + '\'' +
+                ", salesOrg='" + salesOrg + '\'' +
+                ", salesOrgName='" + salesOrgName + '\'' +
+                ", distributionChannel='" + distributionChannel + '\'' +
+                ", customerCode='" + customerCode + '\'' +
+                ", customerName='" + customerName + '\'' +
+                ", route='" + route + '\'' +
+                ", division='" + division + '\'' +
+                ", salesGroup='" + salesGroup + '\'' +
+                ", plant='" + plant + '\'' +
+                ", docType='" + docType + '\'' +
+                ", createDate='" + createDate + '\'' +
+                ", createDateItem='" + createDateItem + '\'' +
+                ", deliverStatus='" + deliverStatus + '\'' +
+                ", materialCode='" + materialCode + '\'' +
+                ", materialName='" + materialName + '\'' +
+                ", sizeDim='" + sizeDim + '\'' +
+                ", creditDate='" + creditDate + '\'' +
+                ", creditStatus='" + creditStatus + '\'' +
+                ", rejectReason='" + rejectReason + '\'' +
+                ", noDeliverQty=" + noDeliverQty +
+                ", noDeliverWt=" + noDeliverWt +
+                ", noDeliverAmt=" + noDeliverAmt +
+                ", deliverQty=" + deliverQty +
+                ", deliverWt=" + deliverWt +
+                ", deliverAmt=" + deliverAmt +
+                '}';
+    }
+}

+ 26 - 0
suishenbang-system/src/main/java/com/dgtly/system/mapper/MetaHanaSalesOrderMapper.java

@@ -0,0 +1,26 @@
+package com.dgtly.system.mapper;
+
+
+import com.dgtly.system.domain.MetaHanaSalesOrder;
+import org.apache.ibatis.annotations.MapKey;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author csz
+ * @since 2020-07-30
+ */
+public interface MetaHanaSalesOrderMapper {
+
+    List<MetaHanaSalesOrder> selectDistinctMetaHanaSalesOrder(MetaHanaSalesOrder metaHanaSalesOrder);
+
+    @MapKey("order_number")
+    Map<String,Map<String,Object>> selectOrderExcepTimeByList(List<String> orderNumbers);
+
+    List<MetaHanaSalesOrder> selectDistinctMetaHanaSalesOrder1(MetaHanaSalesOrder metaHanaSalesOrder);
+}

+ 29 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/IMetaHanaSalesOrderService.java

@@ -0,0 +1,29 @@
+package com.dgtly.system.service;
+
+
+import com.dgtly.system.domain.MetaHanaSalesOrder;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 服务类
+ * </p>
+ *
+ * @author csz
+ * @since 2020-07-30
+ */
+
+public interface IMetaHanaSalesOrderService {
+
+    /**
+     * 根据 条件查询去重后SalesOrderList 可分页
+     *
+     * @param metaHanaSalesOrder
+     * @return
+     */
+
+    List<MetaHanaSalesOrder> selectDistinctMetaHanaSalesOrder(MetaHanaSalesOrder metaHanaSalesOrder);
+
+
+}

+ 51 - 0
suishenbang-system/src/main/java/com/dgtly/system/service/impl/MetaHanaSalesOrderServiceImpl.java

@@ -0,0 +1,51 @@
+package com.dgtly.system.service.impl;
+
+import com.dgtly.common.utils.DateUtils;
+import com.dgtly.system.domain.MetaHanaSalesOrder;
+import com.dgtly.system.mapper.MetaHanaSalesOrderMapper;
+import com.dgtly.system.service.IMetaHanaSalesOrderService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * <p>
+ * 服务实现类
+ * </p>
+ *
+ * @author qxp
+ * @since 2020-07-30
+ */
+@Service
+public class MetaHanaSalesOrderServiceImpl implements IMetaHanaSalesOrderService {
+
+    @Resource
+    private MetaHanaSalesOrderMapper metaHanaSalesOrderMapper;
+
+
+    @Override
+    public List<MetaHanaSalesOrder> selectDistinctMetaHanaSalesOrder(MetaHanaSalesOrder metaHanaSalesOrder) {
+
+        /*List<String> orderNumbers = new ArrayList<>();
+        List<MetaHanaSalesOrder> list =  metaHanaSalesOrderMapper.selectDistinctMetaHanaSalesOrder(metaHanaSalesOrder);
+        for(MetaHanaSalesOrder m:list){
+            orderNumbers.add(m.getDocNumber());
+        }
+        Map<String,Map<String,Object>> timeList = metaHanaSalesOrderMapper.selectOrderExcepTimeByList(orderNumbers);
+        for(MetaHanaSalesOrder m:list){
+            if(timeList.containsKey(m.getDocNumber())){
+
+                m.setExpectedTime((Date)timeList.get(m.getDocNumber()).get("expected_time"));
+            }
+
+        }*/
+        if(metaHanaSalesOrder.getExpectedTime() != null){
+            metaHanaSalesOrder.setExpectedTimeStr(DateUtils.dateTime(metaHanaSalesOrder.getExpectedTime()));
+        }
+        List<MetaHanaSalesOrder> list =  metaHanaSalesOrderMapper.selectDistinctMetaHanaSalesOrder(metaHanaSalesOrder);
+        return list;
+    }
+
+
+}

+ 82 - 0
suishenbang-system/src/main/resources/mapper/system/MetaHanaSalesOrderMapper.xml

@@ -0,0 +1,82 @@
+<?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.dgtly.system.mapper.MetaHanaSalesOrderMapper">
+
+    <resultMap type="MetaHanaSalesOrder" id="MetaHanaSalesResult">
+        <result property="docNumber"    column="DOC_NUMBER"    />
+        <result property="docItem"    column="DOC_ITEM"    />
+        <result property="salesOrg"    column="SALES_ORG"    />
+        <result property="salesOrgName"    column="SALES_ORG_NAME"    />
+        <result property="distributionChannel"    column="DISTRIBUTION_CHANNEL"    />
+        <result property="customerCode"    column="CUSTOMER_CODE"    />
+        <result property="customerName"    column="CUSTOMER_NAME"    />
+        <result property="route"    column="ROUTE"    />
+        <result property="division"    column="DIVISION"    />
+        <result property="salesGroup"    column="SALES_GROUP"    />
+        <result property="plant"    column="PLANT"    />
+        <result property="docType"    column="DOC_TYPE"    />
+        <result property="createDate"    column="CREATE_DATE"    />
+        <result property="createDateItem"    column="CREATE_DATE_ITEM"    />
+        <result property="deliverStatus"    column="DELIVER_STATUS"    />
+        <result property="materialCode"    column="MATERIAL_CODE"    />
+        <result property="materialName"    column="MATERIAL_NAME"    />
+        <result property="sizeDim"    column="SIZE_DIM"    />
+        <result property="creditDate"    column="CREDIT_DATE"    />
+        <result property="creditStatus"    column="CREDIT_STATUS"    />
+        <result property="rejectReason"    column="REJECT_REASON"    />
+        <result property="noDeliverQty"    column="NO_DELIVER_QTY"    />
+        <result property="noDeliverWt"    column="NO_DELIVER_WT"    />
+        <result property="noDeliverAmt"    column="NO_DELIVER_AMT"    />
+        <result property="deliverQty"    column="DELIVER_QTY"    />
+        <result property="deliverWt"    column="DELIVER_WT"    />
+        <result property="deliverAmt"    column="DELIVER_AMT"    />
+    </resultMap>
+    <sql id="selectMetaHanaSalesOrderVo">
+        select DOC_NUMBER, DOC_ITEM, SALES_ORG, SALES_ORG_NAME, DISTRIBUTION_CHANNEL, CUSTOMER_CODE, CUSTOMER_NAME, ROUTE,
+        DIVISION, SALES_GROUP, PLANT, DOC_TYPE, CREATE_DATE, CREATE_DATE_ITEM, DELIVER_STATUS, MATERIAL_CODE, MATERIAL_NAME, SIZE_DIM
+         , CREDIT_DATE, CREDIT_STATUS, REJECT_REASON, NO_DELIVER_QTY, NO_DELIVER_WT, NO_DELIVER_AMT, DELIVER_QTY, DELIVER_WT, DELIVER_AMT from meta_hana_sales_order
+    </sql>
+    <select id="selectDistinctMetaHanaSalesOrder" parameterType="MetaHanaSalesOrder" resultMap="MetaHanaSalesResult">
+        select DOC_NUMBER, DOC_ITEM, SALES_ORG, SALES_ORG_NAME, DISTRIBUTION_CHANNEL, CUSTOMER_CODE, CUSTOMER_NAME, ROUTE,
+        DIVISION, SALES_GROUP, PLANT, DOC_TYPE, CREATE_DATE, CREATE_DATE_ITEM, DELIVER_STATUS, MATERIAL_CODE, MATERIAL_NAME, SIZE_DIM
+        , CREDIT_DATE, CREDIT_STATUS, REJECT_REASON, NO_DELIVER_QTY, NO_DELIVER_WT, NO_DELIVER_AMT, DELIVER_QTY, DELIVER_WT, DELIVER_AMT from meta_hana_sales_order
+        <where>
+            <if test="docNumber != null  and docNumber != ''"> and DOC_NUMBER = #{docNumber}</if>
+        </where>
+    </select>
+
+    <select id="selectOrderExcepTimeByList" parameterType="String" resultType="Map">
+        select order_number ,expected_time
+        from sales_order_base
+        where order_number in
+        <foreach collection="list" item="orderNumber" open="(" separator="," close=")">
+            #{orderNumber}
+        </foreach>
+    </select>
+
+    <select id="selectDistinctMetaHanaSalesOrder1" parameterType="MetaHanaSalesOrder" resultMap="MetaHanaSalesResult">
+        select distinct mhso.DOC_NUMBER, mhso.CUSTOMER_CODE, mhso.CUSTOMER_NAME,
+        mhso.CREATE_DATE, mhso.CREDIT_DATE, mhso.CREDIT_STATUS, mhso.REJECT_REASON
+            ,sob.expected_time as expectedTime
+
+        from meta_hana_sales_order mhso
+        LEFT JOIN sales_order_base sob
+        on mhso.DOC_NUMBER = sob.order_number
+        <where>
+            <if test="docNumber != null  and docNumber != ''"> and mhso.DOC_NUMBER like concat('%', #{docNumber}, '%')</if>
+            <if test="salesOrg != null  and salesOrg != ''"> and mhso.SALES_ORG =#{salesOrg}</if>
+            <if test="salesOrgName != null  and salesOrgName != ''"> and mhso.SALES_ORG_NAME like concat('%', #{salesOrgName}, '%')</if>
+            <if test="customerCode != null  and customerCode != ''"> and mhso.CUSTOMER_CODE like concat('%', #{customerCode}, '%')</if>
+            <if test="customerName != null  and customerName != ''"> and mhso.CUSTOMER_NAME like concat('%', #{customerName}, '%')</if>
+            <if test="docType != null  and docType != ''"> and mhso.DOC_TYPE = #{docType}</if>
+            <if test="creditStatus != null  and creditStatus != ''"> and mhso.CREDIT_STATUS = #{creditStatus}</if>
+            <if test="params.start_expectedTime != null and params.start_expectedTime != ''"><!-- 开始时间检索 -->
+                and date_format(expected_time,'%y%m%d') &gt;= date_format(#{params.start_expectedTime},'%y%m%d')
+            </if>
+            <if test="params.end_expectedTime != null and params.end_expectedTime != ''"><!-- 结束时间检索 -->
+                and date_format(expected_time,'%y%m%d') &lt;= date_format(#{params.end_expectedTime},'%y%m%d')
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 3 - 3
suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
 	
 	<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar,
+		select u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.email, u.avatar,
           u.phonenumber, u.password, u.sex, u.salt, u.status, u.del_flag,
           u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
           d.dept_name, d.leader,
@@ -142,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id,u.company_id, u.dept_id,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_company c on u.company_id = c.id
@@ -163,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id,u.company_id, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id,u.company_id,u.id_type,u.id_number,u.account_id,u.is_authentication,u.receive_url_mobile_no, u.dept_id, u.login_name, u.user_name, u.email, u.avatar, u.phonenumber, u.status, u.create_time
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_company c on u.company_id = c.id

+ 6 - 0
suishenbang-wxportal/suishenbang-wxportal-api/src/main/java/com/dgtly/wxportal/controller/EsignController.java

@@ -111,6 +111,12 @@ public class EsignController extends ApiBaseController {
         }
     }
 
+    @PostMapping("/testPDF")
+    @ResponseBody
+    public void aaa(){
+        String fileId = eSignService.upload("0583133446");
+    }
+
 
 
     /**

+ 0 - 1
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/ESignService.java

@@ -64,5 +64,4 @@ public interface ESignService {
       */
      int updateThirdParty(CustomersExt customersExt);
 
-
     }

+ 13 - 3
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/service/impl/ESignServiceImpl.java

@@ -2,8 +2,10 @@ package com.dgtly.wxportal.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.dgtly.system.domain.CustomersExt;
+import com.dgtly.system.domain.MetaHanaSalesOrder;
 import com.dgtly.system.domain.SysUser;
 import com.dgtly.system.service.ICustomersExtService;
+import com.dgtly.system.service.IMetaHanaSalesOrderService;
 import com.dgtly.system.service.ISysUserService;
 import com.dgtly.wxportal.config.ESignConfig;
 import com.dgtly.wxportal.service.ESignService;
@@ -20,6 +22,7 @@ import org.springframework.stereotype.Service;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.util.List;
 
 /**
  * @author ZhangDing
@@ -41,6 +44,8 @@ public class ESignServiceImpl implements ESignService {
     private ICustomersExtService customersExtService;
     @Autowired
     private ESignConfig eSignConfig;
+    @Autowired
+    private IMetaHanaSalesOrderService iMetaHanaSalesOrderService;
 
     @Override
     public String upload(String orderId) {
@@ -183,14 +188,20 @@ public class ESignServiceImpl implements ESignService {
 
             // 3.打开文档
             document.open();
-            document.addTitle("    签   宝   租  铺  合  同 ");// 标题
+            document.addTitle("随  身  邦  收  货  单");// 标题
             document.addAuthor("");// 作者
             document.addSubject("");// 主题
             document.addKeywords("");// 关键字
             document.addCreator("");// 创建者
+            MetaHanaSalesOrder order = new MetaHanaSalesOrder();
+            order.setDocNumber(orderId);
+            List<MetaHanaSalesOrder> metaHanaSalesOrders = iMetaHanaSalesOrderService.selectDistinctMetaHanaSalesOrder(order);
 
             // 4.向文档中添加内容
-            PDFUtil.generateEPDF(document,"11");
+            PDFUtil.generateEPDF(document,metaHanaSalesOrders.get(0).getCustomerName()
+            ,metaHanaSalesOrders.get(0).getDocNumber(),
+             metaHanaSalesOrders
+                    );
 
             // 5.关闭文档
             document.close();
@@ -200,7 +211,6 @@ public class ESignServiceImpl implements ESignService {
 
         return fileUrl;
     }
-
     /**
      * 获取文件上传路径
      * @param filePath

+ 43 - 39
suishenbang-wxportal/suishenbang-wxportal-common/src/main/java/com/dgtly/wxportal/utils/pdf/PDFUtil.java

@@ -1,6 +1,7 @@
 package com.dgtly.wxportal.utils.pdf;
 
-import com.dgtly.wxportal.config.ESignConfig;
+import com.dgtly.system.domain.MetaHanaSalesOrder;
+import com.dgtly.system.service.IMetaHanaSalesOrderService;
 import com.itextpdf.text.*;
 import com.itextpdf.text.pdf.*;
 import com.itextpdf.text.pdf.draw.DottedLineSeparator;
@@ -9,6 +10,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.math.BigInteger;
+import java.util.List;
+
 /**
  * @description: PDF相关处理
  * @author: qxm
@@ -162,7 +166,6 @@ public class PDFUtil {
      */
 
 
-
     // main测试
         public static void main(String[] args) throws Exception {
 
@@ -182,14 +185,15 @@ public class PDFUtil {
 
                 // 3.打开文档
                 document.open();
-                document.addTitle("E    签   宝   租  铺  合  同 ");// 标题
+                document.addTitle("随  身  邦  收  货  单");// 标题
                 document.addAuthor("");// 作者
                 document.addSubject("");// 主题
                 document.addKeywords("");// 关键字
                 document.addCreator("");// 创建者
 
+
                 // 4.向文档中添加内容
-                PDFUtil.generateEPDF(document,"XXX公司");
+                PDFUtil.generateEPDF(document,"XXX公司",null,null);
 
                 // 5.关闭文档
                 document.close();
@@ -201,6 +205,7 @@ public class PDFUtil {
         // 定义全局的字体静态变量
         private static Font titlefont;
         private static Font headfont;
+        private static Font namefont;
         private static Font keyfont;
         private static Font textfont;
         // 最大宽度
@@ -213,6 +218,7 @@ public class PDFUtil {
                 titlefont = new Font(bfChinese, 16, Font.BOLD);
                 headfont = new Font(bfChinese, 14, Font.BOLD);
                 keyfont = new Font(bfChinese, 10, Font.BOLD);
+                namefont = new Font(bfChinese, 12, Font.BOLD);
                 textfont = new Font(bfChinese, 10, Font.NORMAL);
 
             } catch (Exception e) {
@@ -221,10 +227,11 @@ public class PDFUtil {
         }
 
 
-    public  static void generateEPDF(Document document,String name) throws Exception {
 
+
+    public  static void generateEPDF(Document document,String name,String docNumber,List<MetaHanaSalesOrder> metaHanaSalesOrders) throws Exception {
         // 段落
-        Paragraph paragraph = new Paragraph("立    邦   随   身  邦  订  单 ", titlefont);
+        Paragraph paragraph = new Paragraph("立    邦   随   身  邦  收  货  单", titlefont);
         paragraph.setAlignment(1); //设置文字居中 0靠左   1,居中     2,靠右
         paragraph.setIndentationLeft(12); //设置左缩进
         paragraph.setIndentationRight(12); //设置右缩进
@@ -234,7 +241,7 @@ public class PDFUtil {
         paragraph.setSpacingAfter(10f); //设置段落下空白
         document.add(paragraph);
 
-        Paragraph paragraph2 = new Paragraph("发呢五分范文芳你得请我的飒",textfont);
+        /*Paragraph paragraph2 = new Paragraph("发呢五分范文芳你得请我的飒",textfont);
         paragraph2.setAlignment(1); //设置文字居中 0靠左   1,居中     2,靠右
         paragraph2.setIndentationLeft(12); //设置左缩进
         paragraph2.setIndentationRight(12); //设置右缩进
@@ -242,16 +249,22 @@ public class PDFUtil {
         paragraph2.setLeading(10f); //行间距
         paragraph2.setSpacingBefore(5f); //设置段落上空白
         paragraph2.setSpacingAfter(5f); //设置段落下空白
-        document.add(paragraph2);
+        document.add(paragraph2);*/
         // 直线
         Paragraph p1 = new Paragraph();
         p1.add(new Chunk(new LineSeparator()));
         document.add(p1);
-        Paragraph paragraph1 = new Paragraph("客户名称: " +name+"", textfont);
+        Paragraph paragraph1 = new Paragraph("客户名称: " +name+"                           " +
+        "                                                     订单号: " +docNumber+"", namefont);
         paragraph1.setLeading(20f); //行间距
         paragraph1.setSpacingBefore(5f); //设置段落上空白
         paragraph1.setSpacingAfter(5f); //设置段落下空白
         document.add(paragraph1);
+        /*Paragraph paragraphNumber = new Paragraph("订单号: " +docNumber+"", textfont);
+        paragraphNumber.setLeading(20f); //行间距
+        paragraphNumber.setSpacingBefore(5f); //设置段落上空白
+        paragraphNumber.setSpacingAfter(5f); //设置段落下空白
+        document.add(paragraphNumber);*/
         // 点线
         Paragraph p2 = new Paragraph();
         p2.add(new Chunk(new DottedLineSeparator()));
@@ -275,39 +288,30 @@ public class PDFUtil {
         image.scalePercent(40); //依照比例缩放
         //document.add(image);
         // 表格
-        PdfPTable table = createTable(new float[] { 80, 80, 80, 80, 80, 80 ,80,80});
-        table.addCell(createCell("采购单信息", headfont, Element.ALIGN_LEFT, 8, false));
-        table.addCell(createCell("采购单号", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("项目名称", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("采购分类", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("申请人", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("申请部门", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("采购员", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("预估总价", keyfont, Element.ALIGN_CENTER));
-        table.addCell(createCell("申请日期", keyfont, Element.ALIGN_CENTER));
-
-
-        table.addCell(createCell("20200813131", textfont));
-        table.addCell(createCell("丁小改测试数据01", textfont));
-        table.addCell(createCell("打印机", textfont));
-        table.addCell(createCell("业务用户1", textfont));
-        table.addCell(createCell("南京工厂", textfont));
-        table.addCell(createCell("cg000005", textfont));
-        table.addCell(createCell("100000", textfont));
-        table.addCell(createCell("2020-08-13", textfont));
-            document.add(table);
-
-
-
-        paragraph = new Paragraph("中标供应商信息", titlefont);
+        PdfPTable table = createTable(new float[] { 100, 80, 80});
+        table.addCell(createCell("物品明细", headfont, Element.ALIGN_CENTER, 8, false));
+        table.addCell(createCell("材料名称", keyfont, Element.ALIGN_CENTER));
+        table.addCell(createCell("规格", keyfont, Element.ALIGN_CENTER));
+        table.addCell(createCell("数量", keyfont, Element.ALIGN_CENTER));
+//        table.addCell(createCell("未交货数量", keyfont, Element.ALIGN_CENTER));
+//        table.addCell(createCell("发货数量", keyfont, Element.ALIGN_CENTER));
+//        table.addCell(createCell("已收货数量", keyfont, Element.ALIGN_CENTER));
+        for (MetaHanaSalesOrder metaHanaSalesOrder1:metaHanaSalesOrders) {
+            table.addCell(createCell(metaHanaSalesOrder1.getMaterialName(), textfont));
+            table.addCell(createCell(metaHanaSalesOrder1.getSizeDim(), textfont));
+            table.addCell(createCell(metaHanaSalesOrder1.getDeliverQty().toString(), textfont));
+        }
+        document.add(table);
+
+
+
+
+        paragraph = new Paragraph("收货单位及经办人(盖章):", namefont);
         paragraph.setAlignment(0); //设置文字居中 0靠左   1,居中     2,靠右
-        paragraph.setIndentationLeft(12); //设置左缩进
-        paragraph.setIndentationRight(12); //设置右缩进
-        paragraph.setFirstLineIndent(24); //设置首行缩进
         paragraph.setLeading(20f); //行间距
-        paragraph.setSpacingBefore(5f); //设置段落上空白
+        paragraph.setSpacingBefore(10f); //设置段落上空白
         paragraph.setSpacingAfter(10f); //设置段落下空白
-            document.add(paragraph);
+        document.add(paragraph);
 
 
     }

+ 5 - 13
suishenbang-wxportal/suishenbang-wxportal-manager/src/main/resources/templates/wxportal/orderfile/orderfile.html

@@ -30,18 +30,7 @@
         </div>
 
         <div class="btn-group-sm" id="toolbar" role="group">
-            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:file:add">
-                <i class="fa fa-plus"></i> 添加
-            </a>
-            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:file:edit">
-                <i class="fa fa-edit"></i> 修改
-            </a>
-            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:file:remove">
-                <i class="fa fa-remove"></i> 删除
-            </a>
-            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:file:export">
-                <i class="fa fa-download"></i> 导出
-            </a>
+
         </div>
         <div class="col-sm-12 select-table table-striped">
             <table id="bootstrap-table"></table>
@@ -85,7 +74,7 @@
                     field : 'fileUrl',
                     title : '操作',
                     formatter : function (value,row,index) {
-                        return '<a class="btn btn-success btn-xs" href='+value+' target="_blank"><i class="fa fa-download"></i>下载</a>';
+                        return '<a class="btn btn-success btn-xs" href='+ctx+value+' target="_blank"><i class="fa fa-download"></i>查看</a>';
                     }
                 }
                 /*,
@@ -103,6 +92,9 @@
         };
         $.table.init(options);
     });
+
+
+    
 </script>
 </body>
 </html>