Browse Source

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

zhuth 7 years ago
parent
commit
2496f4a5e0
14 changed files with 700 additions and 31 deletions
  1. 2 2
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Configs.java
  2. 56 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/JasperResult.java
  3. 182 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/SysPrintSet.java
  4. 43 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/JasperReportController.java
  5. 26 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/SysprintsetMapper.java
  6. 13 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/JasperReportService.java
  7. 103 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/JasperReportServiceImpl.java
  8. 1 1
      applications/commons/commons-server/src/main/resources/mapper/ConfigsMapper.xml
  9. 248 0
      applications/commons/commons-server/src/main/resources/mapper/SysprintsetMapper.xml
  10. 4 4
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  11. 1 1
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java
  12. 9 4
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java
  13. 1 1
      applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml
  14. 11 18
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

+ 2 - 2
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Configs.java

@@ -1,14 +1,14 @@
 package com.usoftchina.saas.commons.po;
 
-import com.usoftchina.saas.base.entity.CommonBaseEntity;
 
+import java.io.Serializable;
 import java.util.Date;
 
 /** 系统参数
  * @author: guq
  * @create: 2018-11-16 11:19
  **/
-public class Configs {
+public class Configs implements Serializable {
 
     private Long id;
 

+ 56 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/JasperResult.java

@@ -0,0 +1,56 @@
+package com.usoftchina.saas.commons.po;
+
+import java.io.Serializable;
+
+/**
+ * @author: guq
+ * @create: 2018-11-16 18:54
+ **/
+public class JasperResult implements Serializable{
+
+    private String printurl;
+    private String reportName;
+    private String title;
+    private String whereCondition;
+    private String printtype;
+
+    public String getPrinttype() {
+        return printtype;
+    }
+
+    public void setPrinttype(String printtype) {
+        this.printtype = printtype;
+    }
+
+    public String getPrinturl() {
+        return printurl;
+    }
+
+    public void setPrinturl(String printurl) {
+        this.printurl = printurl;
+    }
+
+    public String getReportName() {
+        return reportName;
+    }
+
+    public void setReportName(String reportName) {
+        this.reportName = reportName;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getWhereCondition() {
+        return whereCondition;
+    }
+
+    public void setWhereCondition(String whereCondition) {
+        this.whereCondition = whereCondition;
+    }
+}

+ 182 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/SysPrintSet.java

@@ -0,0 +1,182 @@
+package com.usoftchina.saas.commons.po;
+
+import java.io.Serializable;
+
+/**
+ * @author: guq
+ * @create: 2018-11-16 18:16
+ **/
+public class SysPrintSet implements Serializable{
+
+    private String caller;
+    private String reportname;
+    private String title;
+    private Integer isdefault;//默认
+    private Integer needaudit;//已审核才能打印
+    private Integer nopost;//已过帐不允许打印
+    private Integer needenoughstock;//库存不足不允许打印
+    private String  countfield;//打印次数字段
+    private String  statusfield;//状态字段
+    private String  statuscodefield;//状态码字段
+    private Integer allowmultiple;//允许多次打印
+    private String defaultcondition;//默认条件
+    private String handlermethod; //打印前执行逻辑方法名
+    private Integer id;
+    private String printtype; //输出类型
+    private String procedureName;//存储过程
+    private Integer ignorepage;
+    private Long companyId;
+    private String keyfield;
+
+    public String getKeyfield() {
+        return keyfield;
+    }
+
+    public void setKeyfield(String keyfield) {
+        this.keyfield = keyfield;
+    }
+    public Long getCompanyId() {
+        return companyId;
+    }
+
+    public void setCompanyId(Long companyId) {
+        this.companyId = companyId;
+    }
+
+    public Integer getIgnorepage() {
+        return ignorepage;
+    }
+
+    public void setIgnorepage(Integer ignorepage) {
+        this.ignorepage = ignorepage;
+    }
+
+    public String getCaller() {
+        return caller;
+    }
+
+    public void setCaller(String caller) {
+        this.caller = caller;
+    }
+
+    public String getReportname() {
+        return reportname;
+    }
+
+    public void setReportname(String reportname) {
+        this.reportname = reportname;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Integer getIsdefault() {
+        return isdefault;
+    }
+
+    public void setIsdefault(Integer isdefault) {
+        this.isdefault = isdefault;
+    }
+
+    public Integer getNeedaudit() {
+        return needaudit;
+    }
+
+    public void setNeedaudit(Integer needaudit) {
+        this.needaudit = needaudit;
+    }
+
+    public Integer getNopost() {
+        return nopost;
+    }
+
+    public void setNopost(Integer nopost) {
+        this.nopost = nopost;
+    }
+
+    public Integer getNeedenoughstock() {
+        return needenoughstock;
+    }
+
+    public void setNeedenoughstock(Integer needenoughstock) {
+        this.needenoughstock = needenoughstock;
+    }
+
+    public String getCountfield() {
+        return countfield;
+    }
+
+    public void setCountfield(String countfield) {
+        this.countfield = countfield;
+    }
+
+    public String getStatusfield() {
+        return statusfield;
+    }
+
+    public void setStatusfield(String statusfield) {
+        this.statusfield = statusfield;
+    }
+
+    public String getStatuscodefield() {
+        return statuscodefield;
+    }
+
+    public void setStatuscodefield(String statuscodefield) {
+        this.statuscodefield = statuscodefield;
+    }
+
+    public Integer getAllowmultiple() {
+        return allowmultiple;
+    }
+
+    public void setAllowmultiple(Integer allowmultiple) {
+        this.allowmultiple = allowmultiple;
+    }
+
+    public String getDefaultcondition() {
+        return defaultcondition;
+    }
+
+    public void setDefaultcondition(String defaultcondition) {
+        this.defaultcondition = defaultcondition;
+    }
+
+    public String getHandlermethod() {
+        return handlermethod;
+    }
+
+    public void setHandlermethod(String handlermethod) {
+        this.handlermethod = handlermethod;
+    }
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getPrinttype() {
+        return printtype;
+    }
+
+    public void setPrinttype(String printtype) {
+        this.printtype = printtype;
+    }
+
+    public String getProcedureName() {
+        return procedureName;
+    }
+
+    public void setProcedureName(String procedureName) {
+        this.procedureName = procedureName;
+    }
+
+}

+ 43 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/JasperReportController.java

@@ -0,0 +1,43 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.commons.po.JasperResult;
+import com.usoftchina.saas.commons.po.SysPrintSet;
+import com.usoftchina.saas.commons.service.JasperReportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2018-11-16 17:18
+ **/
+@RestController
+@RequestMapping("/jasperReport")
+public class JasperReportController {
+
+    @Autowired
+    private JasperReportService jasperReportService;
+
+    @GetMapping("/getPrintSet")
+    public Result getPrintSet(String caller) {
+        List<SysPrintSet> jasperSet = jasperReportService.getPrintSet(caller);
+        return Result.success(jasperSet);
+    }
+
+    @PostMapping("/print")
+    public Result print(String caller, String reportName, Integer id, boolean isProdIO) {
+        JasperResult print = jasperReportService.print(caller, reportName, id, isProdIO, false);
+        return Result.success(print);
+    }
+
+    @PostMapping("/printByDefault")
+    public Result printByDefault(String caller, String reportName, Integer id, boolean isProdIO) {
+        JasperResult print = jasperReportService.print(caller, reportName, id, isProdIO, true);
+        return Result.success(print);
+    }
+}

+ 26 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/SysprintsetMapper.java

@@ -0,0 +1,26 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.commons.po.SysPrintSet;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SysprintsetMapper {
+    int deleteByPrimaryKey(Integer ID);
+
+    int insert(SysPrintSet record);
+
+    int insertSelective(SysPrintSet record);
+
+    SysPrintSet selectByPrimaryKey(Integer ID);
+
+    int updateByPrimaryKeySelective(SysPrintSet record);
+
+    int updateByPrimaryKey(SysPrintSet record);
+
+    List<SysPrintSet> selectSetByCaller(@Param("caller") String caller, @Param("companyId") Long companyId);
+
+    SysPrintSet selectSetByReportName(@Param("caller") String caller, @Param("reportName") String reportName, @Param("companyId") Long companyId);
+
+    SysPrintSet selectDefaultSetBycaller(@Param("caller") String caller, @Param("companyId") Long companyId);
+}

+ 13 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/JasperReportService.java

@@ -0,0 +1,13 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.commons.po.JasperResult;
+import com.usoftchina.saas.commons.po.SysPrintSet;
+
+import java.util.List;
+
+public interface JasperReportService {
+
+    List<SysPrintSet> getPrintSet(String caller);
+
+    JasperResult print(String caller, String reportName, Integer id, boolean isProdIO, boolean isDefault);
+}

+ 103 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/JasperReportServiceImpl.java

@@ -0,0 +1,103 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.usoftchina.saas.commons.mapper.SysprintsetMapper;
+import com.usoftchina.saas.commons.po.Configs;
+import com.usoftchina.saas.commons.po.JasperResult;
+import com.usoftchina.saas.commons.po.SysPrintSet;
+import com.usoftchina.saas.commons.service.ConfigsService;
+import com.usoftchina.saas.commons.service.JasperReportService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import com.usoftchina.saas.context.SpringContextHolder;
+import com.usoftchina.saas.exception.BizException;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+/**
+ * @author: guq
+ * @create: 2018-11-16 18:38
+ **/
+@Service
+public class JasperReportServiceImpl implements JasperReportService{
+
+    private static final String PRINTURLCODE = "printUrl";
+
+    @Autowired
+    private SysprintsetMapper sysprintsetMapper;
+    @Autowired
+    private ConfigsService configsService;
+
+    @Override
+    public List<SysPrintSet> getPrintSet(String caller) {
+        if (StringUtils.isEmpty(caller)) {
+            return null;
+        }
+        Long comanyId = BaseContextHolder.getCompanyId();
+        return sysprintsetMapper.selectSetByCaller(caller, comanyId);
+    }
+
+    @Override
+    public JasperResult print(String caller, String reportName, Integer id, boolean isProdIO, boolean isDefault) {
+        Long companyId = BaseContextHolder.getCompanyId();
+        JasperResult result = new JasperResult();
+        SysPrintSet printSet = null;
+
+        if (isDefault) {
+            printSet = sysprintsetMapper.selectDefaultSetBycaller(caller, companyId);
+        } else {
+            printSet = sysprintsetMapper.selectSetByReportName(caller, reportName, companyId);
+        }
+        if (StringUtils.isEmpty(printSet)) {
+            return null;
+        }
+        //取打印地址
+        Configs config = configsService.getConfigByCode(PRINTURLCODE);
+        String printUrl = null != config ? config.getData() : "";
+        //打印限制 TODO
+        //打印前执行方法
+        if (!StringUtils.isEmpty(printSet.getHandlermethod())) {
+            executor(printSet.getHandlermethod(), new Object[] {id, caller});
+        }
+        //打印前执行过程
+        if (!StringUtils.isEmpty(printSet.getProcedureName())) {
+            //TODO
+        }
+        //拼打印条件
+        String condition = " where " + (StringUtils.isEmpty(printSet.getKeyfield()) ? "1=1" :
+                printSet.getKeyfield() + "=" + id);
+        if (!StringUtils.isEmpty(printSet.getDefaultcondition())) {
+            condition += " and " + printSet.getDefaultcondition();
+        }
+
+        result.setReportName(printSet.getReportname());
+        result.setTitle(printSet.getTitle());
+        result.setPrinturl(printUrl);
+        result.setWhereCondition(condition);
+        result.setPrinttype(StringUtils.isEmpty(printSet.getPrinttype()) ? "" : printSet.getPrinttype());
+        return result;
+
+    }
+
+    private void executor(String handlermethod, Object...args) {
+        Class[] argsClass = new Class[args.length];
+        for (int i = 0, j = args.length; i < j; i++) {
+            argsClass[i] = args[i].getClass();
+        }
+
+        try {
+            Object jasperReportServiceImpl = SpringContextHolder.getBean("jasperReportServiceImpl");
+            Method method = jasperReportServiceImpl.getClass().getMethod(handlermethod, argsClass);
+            method.invoke(jasperReportServiceImpl, args);
+        } catch (Exception e) {
+            if (e.getCause() != null) {
+                String exName = e.getCause().getClass().getSimpleName();
+                if (exName.equals("RuntimeException") || exName.equals("SystemException"))
+                    throw new BizException(3432434, e.getCause().getMessage());
+            }
+            e.printStackTrace();
+        }
+    }
+}

+ 1 - 1
applications/commons/commons-server/src/main/resources/mapper/ConfigsMapper.xml

@@ -143,7 +143,7 @@
     select  *  from configs
     <where>
       <if test="con != null">
-        ${con}
+        code=#{con}
       </if>
       <if test="companyId != null">
         and  companyId = #{companyId}

+ 248 - 0
applications/commons/commons-server/src/main/resources/mapper/SysprintsetMapper.xml

@@ -0,0 +1,248 @@
+<?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.commons.mapper.SysprintsetMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.SysPrintSet" >
+    <id column="ID" property="id" jdbcType="INTEGER" />
+    <result column="CALLER" property="caller" jdbcType="VARCHAR" />
+    <result column="REPORTNAME" property="reportname" jdbcType="VARCHAR" />
+    <result column="TITLE" property="title" jdbcType="VARCHAR" />
+    <result column="ISDEFAULT" property="isdefault" jdbcType="INTEGER" />
+    <result column="NEEDAUDIT" property="needaudit" jdbcType="INTEGER" />
+    <result column="NOPOST" property="nopost" jdbcType="INTEGER" />
+    <result column="NEEDENOUGHSTOCK" property="needenoughstock" jdbcType="INTEGER" />
+    <result column="COUNTFIELD" property="countfield" jdbcType="VARCHAR" />
+    <result column="STATUSFIELD" property="statusfield" jdbcType="VARCHAR" />
+    <result column="STATUSCODEFIELD" property="statuscodefield" jdbcType="VARCHAR" />
+    <result column="ALLOWMULTIPLE" property="allowmultiple" jdbcType="INTEGER" />
+    <result column="HANDLERMETHOD" property="handlermethod" jdbcType="VARCHAR" />
+    <result column="DEFAULTCONDITION" property="defaultcondition" jdbcType="VARCHAR" />
+    <result column="PRINTTYPE" property="printtype" jdbcType="VARCHAR" />
+    <result column="PROCEDURENAME" property="procedureName" jdbcType="VARCHAR" />
+    <result column="IGNOREPAGE" property="ignorepage" jdbcType="INTEGER" />
+    <result column="companyid" property="companyId" jdbcType="INTEGER" />
+    <result column="keyfield" property="keyfield" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    ID, CALLER, REPORTNAME, TITLE, ISDEFAULT, NEEDAUDIT, NOPOST, NEEDENOUGHSTOCK, COUNTFIELD, 
+    STATUSFIELD, STATUSCODEFIELD, ALLOWMULTIPLE, HANDLERMETHOD, DEFAULTCONDITION, PRINTTYPE, 
+    PROCEDURENAME, IGNOREPAGE
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from sysprintset
+    where ID = #{ID,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from sysprintset
+    where ID = #{ID,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.commons.po.SysPrintSet" >
+    insert into sysprintset (ID, CALLER, REPORTNAME, 
+      TITLE, ISDEFAULT, NEEDAUDIT, 
+      NOPOST, NEEDENOUGHSTOCK, COUNTFIELD, 
+      STATUSFIELD, STATUSCODEFIELD, ALLOWMULTIPLE, 
+      HANDLERMETHOD, DEFAULTCONDITION, PRINTTYPE, 
+      PROCEDURENAME, IGNOREPAGE)
+    values (#{ID,jdbcType=INTEGER}, #{CALLER,jdbcType=VARCHAR}, #{REPORTNAME,jdbcType=VARCHAR}, 
+      #{TITLE,jdbcType=VARCHAR}, #{ISDEFAULT,jdbcType=INTEGER}, #{NEEDAUDIT,jdbcType=INTEGER}, 
+      #{NOPOST,jdbcType=INTEGER}, #{NEEDENOUGHSTOCK,jdbcType=INTEGER}, #{COUNTFIELD,jdbcType=VARCHAR}, 
+      #{STATUSFIELD,jdbcType=VARCHAR}, #{STATUSCODEFIELD,jdbcType=VARCHAR}, #{ALLOWMULTIPLE,jdbcType=INTEGER}, 
+      #{HANDLERMETHOD,jdbcType=VARCHAR}, #{DEFAULTCONDITION,jdbcType=VARCHAR}, #{PRINTTYPE,jdbcType=VARCHAR}, 
+      #{PROCEDURENAME,jdbcType=VARCHAR}, #{IGNOREPAGE,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.SysPrintSet" >
+    insert into sysprintset
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="ID != null" >
+        ID,
+      </if>
+      <if test="CALLER != null" >
+        CALLER,
+      </if>
+      <if test="REPORTNAME != null" >
+        REPORTNAME,
+      </if>
+      <if test="TITLE != null" >
+        TITLE,
+      </if>
+      <if test="ISDEFAULT != null" >
+        ISDEFAULT,
+      </if>
+      <if test="NEEDAUDIT != null" >
+        NEEDAUDIT,
+      </if>
+      <if test="NOPOST != null" >
+        NOPOST,
+      </if>
+      <if test="NEEDENOUGHSTOCK != null" >
+        NEEDENOUGHSTOCK,
+      </if>
+      <if test="COUNTFIELD != null" >
+        COUNTFIELD,
+      </if>
+      <if test="STATUSFIELD != null" >
+        STATUSFIELD,
+      </if>
+      <if test="STATUSCODEFIELD != null" >
+        STATUSCODEFIELD,
+      </if>
+      <if test="ALLOWMULTIPLE != null" >
+        ALLOWMULTIPLE,
+      </if>
+      <if test="HANDLERMETHOD != null" >
+        HANDLERMETHOD,
+      </if>
+      <if test="DEFAULTCONDITION != null" >
+        DEFAULTCONDITION,
+      </if>
+      <if test="PRINTTYPE != null" >
+        PRINTTYPE,
+      </if>
+      <if test="PROCEDURENAME != null" >
+        PROCEDURENAME,
+      </if>
+      <if test="IGNOREPAGE != null" >
+        IGNOREPAGE,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="ID != null" >
+        #{ID,jdbcType=INTEGER},
+      </if>
+      <if test="CALLER != null" >
+        #{CALLER,jdbcType=VARCHAR},
+      </if>
+      <if test="REPORTNAME != null" >
+        #{REPORTNAME,jdbcType=VARCHAR},
+      </if>
+      <if test="TITLE != null" >
+        #{TITLE,jdbcType=VARCHAR},
+      </if>
+      <if test="ISDEFAULT != null" >
+        #{ISDEFAULT,jdbcType=INTEGER},
+      </if>
+      <if test="NEEDAUDIT != null" >
+        #{NEEDAUDIT,jdbcType=INTEGER},
+      </if>
+      <if test="NOPOST != null" >
+        #{NOPOST,jdbcType=INTEGER},
+      </if>
+      <if test="NEEDENOUGHSTOCK != null" >
+        #{NEEDENOUGHSTOCK,jdbcType=INTEGER},
+      </if>
+      <if test="COUNTFIELD != null" >
+        #{COUNTFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="STATUSFIELD != null" >
+        #{STATUSFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="STATUSCODEFIELD != null" >
+        #{STATUSCODEFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="ALLOWMULTIPLE != null" >
+        #{ALLOWMULTIPLE,jdbcType=INTEGER},
+      </if>
+      <if test="HANDLERMETHOD != null" >
+        #{HANDLERMETHOD,jdbcType=VARCHAR},
+      </if>
+      <if test="DEFAULTCONDITION != null" >
+        #{DEFAULTCONDITION,jdbcType=VARCHAR},
+      </if>
+      <if test="PRINTTYPE != null" >
+        #{PRINTTYPE,jdbcType=VARCHAR},
+      </if>
+      <if test="PROCEDURENAME != null" >
+        #{PROCEDURENAME,jdbcType=VARCHAR},
+      </if>
+      <if test="IGNOREPAGE != null" >
+        #{IGNOREPAGE,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.SysPrintSet" >
+    update sysprintset
+    <set >
+      <if test="CALLER != null" >
+        CALLER = #{CALLER,jdbcType=VARCHAR},
+      </if>
+      <if test="REPORTNAME != null" >
+        REPORTNAME = #{REPORTNAME,jdbcType=VARCHAR},
+      </if>
+      <if test="TITLE != null" >
+        TITLE = #{TITLE,jdbcType=VARCHAR},
+      </if>
+      <if test="ISDEFAULT != null" >
+        ISDEFAULT = #{ISDEFAULT,jdbcType=INTEGER},
+      </if>
+      <if test="NEEDAUDIT != null" >
+        NEEDAUDIT = #{NEEDAUDIT,jdbcType=INTEGER},
+      </if>
+      <if test="NOPOST != null" >
+        NOPOST = #{NOPOST,jdbcType=INTEGER},
+      </if>
+      <if test="NEEDENOUGHSTOCK != null" >
+        NEEDENOUGHSTOCK = #{NEEDENOUGHSTOCK,jdbcType=INTEGER},
+      </if>
+      <if test="COUNTFIELD != null" >
+        COUNTFIELD = #{COUNTFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="STATUSFIELD != null" >
+        STATUSFIELD = #{STATUSFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="STATUSCODEFIELD != null" >
+        STATUSCODEFIELD = #{STATUSCODEFIELD,jdbcType=VARCHAR},
+      </if>
+      <if test="ALLOWMULTIPLE != null" >
+        ALLOWMULTIPLE = #{ALLOWMULTIPLE,jdbcType=INTEGER},
+      </if>
+      <if test="HANDLERMETHOD != null" >
+        HANDLERMETHOD = #{HANDLERMETHOD,jdbcType=VARCHAR},
+      </if>
+      <if test="DEFAULTCONDITION != null" >
+        DEFAULTCONDITION = #{DEFAULTCONDITION,jdbcType=VARCHAR},
+      </if>
+      <if test="PRINTTYPE != null" >
+        PRINTTYPE = #{PRINTTYPE,jdbcType=VARCHAR},
+      </if>
+      <if test="PROCEDURENAME != null" >
+        PROCEDURENAME = #{PROCEDURENAME,jdbcType=VARCHAR},
+      </if>
+      <if test="IGNOREPAGE != null" >
+        IGNOREPAGE = #{IGNOREPAGE,jdbcType=INTEGER},
+      </if>
+    </set>
+    where ID = #{ID,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.SysPrintSet" >
+    update sysprintset
+    set CALLER = #{CALLER,jdbcType=VARCHAR},
+      REPORTNAME = #{REPORTNAME,jdbcType=VARCHAR},
+      TITLE = #{TITLE,jdbcType=VARCHAR},
+      ISDEFAULT = #{ISDEFAULT,jdbcType=INTEGER},
+      NEEDAUDIT = #{NEEDAUDIT,jdbcType=INTEGER},
+      NOPOST = #{NOPOST,jdbcType=INTEGER},
+      NEEDENOUGHSTOCK = #{NEEDENOUGHSTOCK,jdbcType=INTEGER},
+      COUNTFIELD = #{COUNTFIELD,jdbcType=VARCHAR},
+      STATUSFIELD = #{STATUSFIELD,jdbcType=VARCHAR},
+      STATUSCODEFIELD = #{STATUSCODEFIELD,jdbcType=VARCHAR},
+      ALLOWMULTIPLE = #{ALLOWMULTIPLE,jdbcType=INTEGER},
+      HANDLERMETHOD = #{HANDLERMETHOD,jdbcType=VARCHAR},
+      DEFAULTCONDITION = #{DEFAULTCONDITION,jdbcType=VARCHAR},
+      PRINTTYPE = #{PRINTTYPE,jdbcType=VARCHAR},
+      PROCEDURENAME = #{PROCEDURENAME,jdbcType=VARCHAR},
+      IGNOREPAGE = #{IGNOREPAGE,jdbcType=INTEGER}
+    where ID = #{ID,jdbcType=INTEGER}
+  </update>
+  <select id="selectSetByCaller" resultType="com.usoftchina.saas.commons.po.SysPrintSet">
+    select * from sysprintset where caller=#{caller} and companyId=#{companyId}
+  </select>
+
+  <select id="selectSetByReportName" resultType="com.usoftchina.saas.commons.po.SysPrintSet">
+    select * from sysprintset where caller=#{caller} and reportName=#{reportName} and companyId=#{companyId}
+  </select>
+
+  <select id="selectDefaultSetBycaller" resultType="com.usoftchina.saas.commons.po.SysPrintSet">
+    select * from sysprintset where caller=#{caller} and ISDEFAULT=1 and companyId=#{companyId}
+  </select>
+</mapper>

+ 4 - 4
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -151,8 +151,8 @@
       <if test="creatorName != null" >
         creatorName,
       </if>
-      <if test="creatorTime != null" >
-        creatorTime,
+      <if test="createTime != null" >
+        createTime,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -223,8 +223,8 @@
       <if test="creatorName != null" >
         #{creatorName,jdbcType=VARCHAR},
       </if>
-      <if test="creatorTime != null" >
-        #{creatorTime,jdbcType=TIMESTAMP},
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
       </if>
     </trim>
     <selectKey resultType="Long" keyProperty="id" order="AFTER">

+ 1 - 1
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/mapper/MakeMapper.java

@@ -25,7 +25,7 @@ public interface MakeMapper extends CommonBaseMapper<Make> {
 
     int validateCodeWhenUpdate(@Param("code") String code, @Param("id") Long id, @Param("companyId") Long company);
 
-    Double getOnHand(@Param("prodcode") String prodcode, @Param("whcode") String whcode, @Param("companyId") Long companyId);
+    Double getOnHand(@Param("prodid") Long prodid, @Param("whid") Integer whid, @Param("companyId") Long companyId);
 
     String selectMakeInOutCode(@Param("code") String code, @Param("companyId") Long companyId, @Param("type") String type);
 

+ 9 - 4
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/service/impl/MakeServiceImpl.java

@@ -161,9 +161,13 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             for(MakeMaterial makeMaterial : makeMaterialList){
                 i++;
                 double qty = makeMaterial.getMm_qty()==null?0:makeMaterial.getMm_qty();
-                Double onHand = getMapper().getOnHand(makeMaterial.getMm_prodcode(),makeMaterial.getMm_whcode(), BaseContextHolder.getCompanyId());
-                if (onHand==null){
-                    onHand=0d;
+                double onHand = 0;
+                try {
+                    onHand = getMapper().getOnHand(make.getMa_prodid(),make.getMa_whid(), BaseContextHolder.getCompanyId());
+                }catch (Exception e){
+                    String msg = BizExceptionCode.UNENOUGH_DETAIL_STOCK.getMessage();
+                    int code = BizExceptionCode.SALE_ORDER_HASAUDIT.getCode();
+                    throw new BizException(code, String.format(msg, i));
                 }
                 if(onHand < qty){
                     String msg = BizExceptionCode.UNENOUGH_DETAIL_STOCK.getMessage();
@@ -175,7 +179,8 @@ public class MakeServiceImpl extends CommonBaseServiceImpl<MakeMapper, Make> imp
             double qty = make.getMa_qty();
             double onHand = 0;
             try {
-                onHand = getMapper().getOnHand(make.getMa_prodcode(), make.getMa_whcode(), BaseContextHolder.getCompanyId());
+                onHand = getMapper().getOnHand(make.getMa_prodid(), make.getMa_whid(), BaseContextHolder.getCompanyId());
+
             }catch (Exception e){
                 String msg = BizExceptionCode.UNENOUGH_STOCK.getMessage();
                 int code = BizExceptionCode.UNENOUGH_STOCK.getCode();

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/MakeMapper.xml

@@ -410,7 +410,7 @@
   </select>
 
     <select id="getOnHand" resultType="double">
-        SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODCODE=#{prodcode} AND PW_WHCODE=#{whcode} and COMPANYID=#{companyId}
+        SELECT IFNULL(PW_ONHAND,0) FROM PRODUCTWH WHERE PW_PRODID=#{prodid} AND PW_WHID=#{whid} and COMPANYID=#{companyId}
     </select>
 
     <select id="selectMakeInOutCode" resultType="string">

+ 11 - 18
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -30,65 +30,58 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
     dbColumns: [{
         conditionCode: 'id',
         text: "客户ID",
-        flex: 0,
         dataIndex: "id",
         width: 0,
         xtype: "",
     }, {
         conditionCode: 'cu_code',
         text: "客户编号",
-        flex: 1,
         dataIndex: "cu_code",
-        width: 100,
+        width: 150,
         xtype: "",
     }, {
         conditionCode: 'cu_name',
         text: "客户名称",
-        flex: 1,
         dataIndex: "cu_name",
+        width: 180,
         xtype: "",
     }, {
         conditionCode: 'cu_type',
         text: "客户类型",
-        flex: 1,
         dataIndex: "cu_type",
-        width: 200,
+        width: 150,
         xtype: "",
     }, {
         text: "业务员编号",
-        flex: 1,
         dataIndex: "cu_sellercode",
-        width: 100
+        width:150
     }, {
         text: "业务员",
-        flex: 1,
         dataIndex: "cu_sellername",
-        width: 100
+        width:180
     }, {
         text: "税率",
-        flex: 1,
         dataIndex: "cu_taxrate",
-        width: 100,
         xtype: 'numbercolumn',
+        width:80,
+        renderer: function (v) {
+            return Ext.util.Format.number(v, '0');
+        }
     }, {
         text: "承付天数",
-        flex: 1,
         dataIndex: "cu_promisedays",
-        width: 100,
+        width:100,
         xtype: 'numbercolumn',
-        align: 'end',
         renderer: function (v) {
             return Ext.util.Format.number(v, '0');
         }
     }, {
         text: "额度",
-        flex: 1,
         dataIndex: "cu_credit",
-        width: 100,
+        width:100,
         xtype: 'numbercolumn',
     }, {
         text: "客户地址",
-        flex: 1,
         dataIndex: "ca_address",
         width: 250
     }]