Эх сурвалжийг харах

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

chenw 7 жил өмнө
parent
commit
33a69f96c0

+ 11 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/ProfitdetailMapper.java

@@ -0,0 +1,11 @@
+package com.usoftchina.saas.money.mapper;
+
+import com.usoftchina.saas.money.po.Profitpresent;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ProfitdetailMapper {
+    List<Profitpresent> selectByCondition(@Param("con") String con, @Param("companyId") Long companyId);
+    String selectCalculateFields(@Param("fields") String fields, @Param("con") String con, @Param("companyId") Long companyId);
+}

+ 109 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/Profitpresent.java

@@ -0,0 +1,109 @@
+package com.usoftchina.saas.money.po;
+
+import java.util.Date;
+
+/**
+ * @author heqw
+ * @date 2018/12/10 10:45
+ **/
+public class Profitpresent {
+    private Date pi_date;
+    private Integer pi_ym;
+    private String pi_custcode;
+    private String pi_custname;
+    private String cu_sellername;
+    private Double saamount;
+    private Double netamount;
+    private Double costamount;
+    private Double profit;
+    private Double profitpresent;
+    private String cu_type;
+
+    public String getCu_type() {
+        return cu_type;
+    }
+
+    public void setCu_type(String cu_type) {
+        this.cu_type = cu_type;
+    }
+
+    public Date getPi_date() {
+        return pi_date;
+    }
+
+    public void setPi_date(Date pi_date) {
+        this.pi_date = pi_date;
+    }
+
+    public Integer getPi_ym() {
+        return pi_ym;
+    }
+
+    public void setPi_ym(Integer pi_ym) {
+        this.pi_ym = pi_ym;
+    }
+
+    public String getPi_custcode() {
+        return pi_custcode;
+    }
+
+    public void setPi_custcode(String pi_custcode) {
+        this.pi_custcode = pi_custcode;
+    }
+
+    public String getPi_custname() {
+        return pi_custname;
+    }
+
+    public void setPi_custname(String pi_custname) {
+        this.pi_custname = pi_custname;
+    }
+
+    public String getCu_sellername() {
+        return cu_sellername;
+    }
+
+    public void setCu_sellername(String cu_sellername) {
+        this.cu_sellername = cu_sellername;
+    }
+
+    public Double getSaamount() {
+        return saamount;
+    }
+
+    public void setSaamount(Double saamount) {
+        this.saamount = saamount;
+    }
+
+    public Double getNetamount() {
+        return netamount;
+    }
+
+    public void setNetamount(Double netamount) {
+        this.netamount = netamount;
+    }
+
+    public Double getCostamount() {
+        return costamount;
+    }
+
+    public void setCostamount(Double costamount) {
+        this.costamount = costamount;
+    }
+
+    public Double getProfit() {
+        return profit;
+    }
+
+    public void setProfit(Double profit) {
+        this.profit = profit;
+    }
+
+    public Double getProfitpresent() {
+        return profitpresent;
+    }
+
+    public void setProfitpresent(Double profitpresent) {
+        this.profitpresent = profitpresent;
+    }
+}

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

@@ -43,6 +43,8 @@ public class MoneyReportServiceImpl implements MoneyReportService {
     private CustmonthMapper custmonthMapper;
     @Autowired
     private BanksubledgerMapper banksubledgerMapper;
+    @Autowired
+    private ProfitdetailMapper profitdetailMapper;
 
     @Override
     public Map<String, Object> vendorCheck(PageRequest page, ListReqDTO req) {
@@ -278,6 +280,11 @@ public class MoneyReportServiceImpl implements MoneyReportService {
             if (!StringUtils.isEmpty(calculateFieldsSql)) {
                 res = banksubledgerMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
             }
+        }else if("profitdetails".equals(type)){
+            list = profitdetailMapper.selectByCondition(con, companyId);
+            if (!StringUtils.isEmpty(calculateFieldsSql)) {
+                res = profitdetailMapper.selectCalculateFields(calculateFieldsSql, con, companyId);
+            }
         }
 
         try {

+ 123 - 0
applications/money/money-server/src/main/resources/mapper/ProfitdetailMapper.xml

@@ -0,0 +1,123 @@
+<?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.ProfitdetailMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.money.po.Profitpresent" >
+    <result column="pi_ym" property="pi_ym" jdbcType="INTEGER" />
+    <result column="pi_custcode" property="pi_custcode" jdbcType="VARCHAR" />
+    <result column="pi_custname" property="pi_custname" jdbcType="VARCHAR" />
+	  <result column="cu_type" property="cu_type" jdbcType="VARCHAR" />
+    <result column="cu_sellername" property="cu_sellername" jdbcType="VARCHAR" />
+    <result column="saamount" property="saamount" jdbcType="DOUBLE" />
+    <result column="netamount" property="netamount" jdbcType="DOUBLE" />
+    <result column="costamount" property="costamount" jdbcType="DOUBLE" />
+    <result column="profit" property="profit" jdbcType="DOUBLE" />
+    <result column="profitpresent" property="profitpresent" jdbcType="DOUBLE" />
+    <result column="pi_date" property="pi_date" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    cu_type, pi_custcode, pi_custname, cu_sellername, saamount, netamount, costamount, profit,
+    profitpresent
+  </sql>
+
+  <select id="selectByCondition" parameterType="java.lang.Long" resultMap="BaseResultMap">
+   SELECT
+	a.pi_custcode,
+	a.pi_custname,
+	a.cu_type,
+	a.cu_sellername,
+	a.saamount,
+	a.netamount,
+	a.costamount,
+SUM(a.netamount - a.costamount) as profit,
+(SUM(a.netamount - a.costamount)/IFNULL(netamount,SUM(netamount - costamount))) as profitpresent
+
+FROM
+	(
+		SELECT
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername,
+			SUM(
+				pd_sendprice * (pd_outqty - pd_inqty)
+			) AS saamount,
+			SUM(
+				pd_netprice * (pd_outqty - pd_inqty)
+			) AS netamount,
+			SUM(
+				pd_price * (pd_outqty - pd_inqty)
+			) AS costamount
+		FROM
+			prodinout,
+			prodiodetail,
+			customer
+    <where>
+      <if test="con != null">
+        ${con}
+      </if>
+      <if test="companyId != null">
+        and  prodinout.companyid = #{companyId}
+      </if>
+    </where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and
+prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		GROUP BY
+			pi_custcode,
+			pi_custname,
+	        cu_type,
+			cu_sellername
+	) a GROUP BY
+			a.pi_custcode,
+			a.pi_custname,
+	        a.cu_type,
+			a.cu_sellername
+	  ORDER BY a.pi_custname asc,a.pi_custname desc
+  </select>
+
+	<select id="selectCalculateFields" resultType="string">
+		SELECT ${fields}
+		FROM
+		(
+		SELECT
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername,
+		SUM(
+		pd_sendprice * (pd_outqty - pd_inqty)
+		) AS saamount,
+		SUM(
+		pd_netprice * (pd_outqty - pd_inqty)
+		) AS netamount,
+		SUM(
+		pd_price * (pd_outqty - pd_inqty)
+		) AS costamount
+		FROM
+		prodinout,
+		prodiodetail,
+		customer
+		<where>
+			<if test="con != null">
+				${con}
+			</if>
+			<if test="companyId != null">
+				and  prodinout.companyid = #{companyId}
+			</if>
+		</where>
+		and	pi_id = pd_piid
+		AND pi_custid = cu_id and
+		prodinout.companyid= prodiodetail.companyid and prodiodetail.companyid = prodinout.companyid
+		GROUP BY
+		pi_custcode,
+		pi_custname,
+		cu_type,
+		cu_sellername
+		) a GROUP BY
+		a.pi_custcode,
+		a.pi_custname,
+		a.cu_type,
+		a.cu_sellername
+	</select>
+
+</mapper>

+ 1 - 1
frontend/saas-portal-web/config/dev.env.js

@@ -10,6 +10,6 @@ module.exports = merge(prodEnv, {
     // 后端接口网关
     api: '"https://saas-api-dev.usoftchina.com:5443"',
     // 账户中心接口
-    sso: '"https://tsso.usoftchina.com"'
+    sso: '"https://test-sso.uuzcc.cn"'
   }
 })

+ 3 - 1
frontend/saas-web/app/view/document/bom/BasePanel.js

@@ -19,7 +19,8 @@ Ext.define('saas.view.document.bom.BasePanel', {
     },{
         xtype : "textfield", 
         name : "bo_version", 
-        fieldLabel:'版本'
+        fieldLabel:'版本',
+        emptyText: '全部',
     },{
         xtype: 'combobox',
         name: 'bo_statuscode',
@@ -27,6 +28,7 @@ Ext.define('saas.view.document.bom.BasePanel', {
         displayField: 'bo_status',
         valueField: 'bo_statuscode',
         fieldLabel :'状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['bo_statuscode', 'bo_status'],

+ 4 - 1
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -21,11 +21,13 @@ Ext.define('saas.view.document.customer.BasePanel', {
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         fieldLabel : "客户类型", 
+        emptyText: '全部',
         hiddenBtn:true
     }, {
         xtype : "employeeDbfindTrigger", 
         name : "cu_sellername", 
-        fieldLabel:'业务员'
+        fieldLabel:'业务员',
+        emptyText: '输入人员编号或姓名',
     },{
         xtype: 'combobox',
         name: 'cu_statuscode',
@@ -33,6 +35,7 @@ Ext.define('saas.view.document.customer.BasePanel', {
         displayField: 'cu_status',
         valueField: 'cu_statuscode',
         fieldLabel :'状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['cu_statuscode', 'cu_status'],

+ 3 - 1
frontend/saas-web/app/view/document/product/BasePanel.js

@@ -22,7 +22,8 @@ Ext.define('saas.view.document.product.BasePanel', {
         xtype : "remotecombo", 
         storeUrl: '/api/document/producttype/getCombo',
         name : "pr_kind", 
-        fieldLabel : '物料类型'
+        fieldLabel : '物料类型',
+        emptyText: '全部',
     }, {
         xtype: 'combobox',
         name: 'pr_statuscode',
@@ -30,6 +31,7 @@ Ext.define('saas.view.document.product.BasePanel', {
         displayField: 'pr_status',
         valueField: 'pr_statuscode',
         fieldLabel : '状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['pr_statuscode', 'pr_status'],

+ 2 - 0
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -21,6 +21,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         storeUrl:'/api/document/vendorkind/getCombo',
         name : "ve_type", 
         fieldLabel : '供应商类型',
+        emptyText: '全部',
         hiddenBtn:true
     },{
         xtype: 'combobox',
@@ -29,6 +30,7 @@ Ext.define('saas.view.document.vendor.BasePanel', {
         displayField: 've_status',
         valueField: 've_statuscode',
         fieldLabel : '状态',
+        emptyText: '全部',
         editable:false,
         store: Ext.create('Ext.data.ArrayStore', {
         fields: ['ve_statuscode', 've_status'],

+ 1 - 0
frontend/saas-web/app/view/home/charts/KeyData.js

@@ -110,6 +110,7 @@ Ext.define('saas.view.home.charts.KeyData', {
                     if(!tip) {
                         var tip = Ext.create('Ext.tip.ToolTip', {
                             target: th.el,
+                            minWidth: 100,
                             title: record.get('label'),
                             html: record.get('value'),
                             showOnTap: true,

+ 2 - 0
frontend/saas-web/app/view/money/fundtransfer/QueryPanel.js

@@ -20,10 +20,12 @@ Ext.define('saas.view.money.fundtransfer.QueryPanel', {
         xtype : "bandinfoDbfindTrigger",
         name : "ftd_bankname",
         fieldLabel : "转出账户",
+        emptyText: '输入账户编号或名称',
     },{
         xtype : "bandinfoDbfindTrigger",
         name : "ftd_inbankname",
         fieldLabel : "转入账户",
+        emptyText: '输入账户编号或名称',
     },{
         xtype: 'combobox',
         name: 'ft_statuscode',

+ 51 - 20
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -11,60 +11,91 @@ Ext.define('saas.view.money.report.ProfitDetail', {
     viewName: 'money-report-profitdetail',
 
     groupField: null,
-    listUrl: '/api/money/report/recDetail',
+    listUrl: '/api/money/report/profitdetails',
     defaultCondition: null,
     reportTitle: '毛利润分析表',
-    QueryWidth: 0.25,
+    QueryWidth: 0.2,
     searchItems: [{
         xtype: 'customerDbfindTrigger',
         name: 'pi_custname',
-        fieldLabel: '客户名称',
-        columnWidth: 0.25
+        emptyText: '客户',
+        columnWidth: 0.15,
+        dbfinds:[
+            {
+                from:'cu_name',to:'pi_custname'
+            }]
     }, {
         xtype : "remotecombo", 
         storeUrl:'/api/document/customerkind/getCombo',
         name : "cu_type", 
         emptyText : "客户类型", 
-        columnWidth: 0.25,
+        columnWidth: 0.15,
         hiddenBtn:true
     }, {
         xtype: 'condatefield',
-        name: 'rb_date',
+        name: 'pi_date',
         fieldLabel: '日期',
-        columnWidth: 0.25
+        columnWidth: 0.5
     }],
 
-    reportColumns: [{
-        text: '客户编号',
-        dataIndex: 'pi_inoutno',
-        width: 200
-    }, {
+    reportColumns: [
+        {
+            text: '客户',
+            dataIndex: 'pi_custname',
+            width: 200,
+        },{
         text: '客户类型',
-        dataIndex: 'pi_custcode',
+        dataIndex: 'cu_type',
         width: 200,
     }, {
         text: '业务员',
-        dataIndex: 'pi_custname',
+        dataIndex: 'cu_sellername',
         width: 200,
     }, {
         text: '销售总额',
-        dataIndex: 'pi_class',
-        width: 150
+        dataIndex: 'saamount',
+        width: 150,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            }
     }, {
         text: '不含税金额',
-        dataIndex: 'pu_buyername',
+        dataIndex: 'netamount',
         width: 150
     }, {
         text: '成本金额',
-        dataIndex: 'rb_date',
+        dataIndex: 'costamount',
         width: 150
     }, {
         text: '毛利润',
-        dataIndex: 'pd_pdno',
+        dataIndex: 'profit',
         width: 150,
+            renderer : function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function(v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join();
+                return Ext.util.Format.number(v, format);
+            }
     }, {
         text: '毛利率',
-        dataIndex: 'cu_beginaramount',
+        dataIndex: 'profitpresent',
         width: 150
     }]
 });

+ 2 - 1
frontend/saas-web/app/view/purchase/purchase/QueryPanel.js

@@ -66,7 +66,8 @@ Ext.define('saas.view.purchase.purchase.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pu_sacode',
-        fieldLabel: '关联销售单号'
+        fieldLabel: '关联销售单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

+ 3 - 1
frontend/saas-web/app/view/purchase/purchaseIn/QueryPanel.js

@@ -70,7 +70,9 @@ Ext.define('saas.view.purchase.purchaseIn.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_pucode',
-        fieldLabel: '关联采购单号'
+        fieldLabel: '关联采购单号',
+        emptyText: '输入单号',
+
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

+ 2 - 1
frontend/saas-web/app/view/purchase/purchaseOut/QueryPanel.js

@@ -70,7 +70,8 @@ Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_iocode',
-        fieldLabel: '关联验收单号'
+        fieldLabel: '关联验收单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',

+ 8 - 3
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -24,6 +24,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
         xtype: 'productDbfindTrigger',
         name: 'pr_detail',
         fieldLabel: '物料',
+        emptyText: '输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -62,15 +63,18 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
     }, {
         xtype: 'warehouseDbfindTrigger',
         name: 'pd_whname',
-        fieldLabel: '仓库'
+        fieldLabel: '仓库',
+        emptyText: '输入仓库编号或名称',
     }, {
         xtype: 'textfield',
         name: 'pi_iocode',
-        fieldLabel: '关联出货单号'
+        fieldLabel: '关联出货单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',
         fieldLabel: '录入人',
+        emptyText: '输入人员编号或姓名',
         getCondition: function(value) {
             if(!value) {
                 return '1=1';
@@ -81,7 +85,8 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'pi_auditman',
-        fieldLabel: '审核人'
+        fieldLabel: '审核人',
+        emptyText: '输入人员编号或姓名',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {

+ 6 - 2
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -24,6 +24,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
         xtype: 'productDbfindTrigger',
         name: 'pr_detail',
         fieldLabel: '物料',
+        emptyText: '输入物料编号或名称',
         showDetail: true
     }, {
         xtype: 'combobox',
@@ -67,11 +68,13 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     }, {
         xtype: 'textfield',
         name: 'pi_sacode',
-        fieldLabel: '关联销售单号'
+        fieldLabel: '关联销售单号',
+        emptyText: '输入单号',
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'creatorName',
         fieldLabel: '录入人',
+        emptyText: '输入人员编号或姓名',
         getCondition: function(value) {
             if(!value) {
                 return '1=1';
@@ -82,7 +85,8 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
     }, {
         xtype: 'employeeDbfindTrigger',
         name: 'pi_auditman',
-        fieldLabel: '审核人'
+        fieldLabel: '审核人',
+        emptyText: '输入人员编号或姓名',
     }],
     moreQueryFormItems: [],
     queryGridConfig: {

+ 4 - 0
frontend/saas-web/resources/json/navigation.json

@@ -71,6 +71,10 @@
             "text": "销售利润表",
             "viewType": "sale-report-saleprofit"
         }, {
+            "text": "毛利润分析表",
+            "id": "monry-report-profitdetail",
+            "viewType":"monry-report-profitdetail"
+        },{
             "text": "客户对账单",
             "id": "monry-report-customercheck",
             "viewType":"monry-report-customercheck"