Browse Source

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

rainco 7 years ago
parent
commit
8a99b3b057

+ 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>

+ 10 - 1
frontend/saas-web/app/view/core/dbfind/types/ProductDbfindTrigger.js

@@ -91,7 +91,16 @@ Ext.define('saas.view.core.dbfind.types.ProductDbfindTrigger', {
         dataIndex: "pr_zxbzs",
         width: 100,
         xtype: 'numbercolumn',
-        align: 'end'
+        align: 'end',
+        renderer : function(v) {
+            if(!v) {
+                return 0;
+            }
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
+            var format = '0.' + xr.join();
+            return Ext.util.Format.number(v, format);
+        }
     },{
         text: "L/T",
         dataIndex: "pr_leadtime",

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

@@ -6,7 +6,7 @@ Ext.define('saas.view.document.product.BasePanel', {
     viewModel: 'document-product-basepanel',
 
     searchField:[{
-        xtype : "dbfindtrigger", 
+        xtype : "productDbfindTrigger", 
         name : "pr_code", 
         emptyText : "物料编号", 
         width:120

+ 0 - 85
frontend/saas-web/app/view/document/product/BasePanelController.js

@@ -9,9 +9,6 @@ Ext.define('saas.view.document.product.BasePanelController', {
             'dbfindtrigger[name=pr_code]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dataUrl:'/api/document/product/list',
-                        addXtype: 'document-product-formpanel',
-                        addTitle: '物料资料',
                         dbfinds:[
                         {
                             from:'pr_code',to:'pr_code'
@@ -28,88 +25,6 @@ Ext.define('saas.view.document.product.BasePanelController', {
                         }, {
                             from:'id',to:'id',ignore:true
                         }],
-                        dbtpls:[{
-                            field:'pr_code',width:100
-                        },{
-                            field:'pr_detail',width:100
-                        }],
-                        defaultCondition: "pr_statuscode='OPEN'",
-                        dbSearchFields:[{
-                            emptyText:'输入物料编号、名称或规格',
-                            xtype : "textfield", 
-                            name : "search", 
-                            width: 200,
-                            getCondition: function(v) {
-                                return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
-                            },
-                            allowBlank : true, 
-                            columnWidth : 0.25
-                        }],
-                        dbColumns:[{
-                            "text": "物料ID",
-                            "hidden": true,
-                            "dataIndex": "id",
-                        }, {
-                            "text": "物料编号",       
-                            "dataIndex": "pr_code",
-                            "width": 200,
-                        }, {
-                            "text": "物料名称",
-                            "width": 200,
-                            "dataIndex": "pr_detail",
-                        }, {
-                            "text": "规格",
-                            "dataIndex": "pr_spec",
-                            "width": 100,
-                        }, {
-                            "text": "单位",
-                            "dataIndex": "pr_unit",
-                            "width": 100,
-                        },{
-                            "text": "仓库id",
-                            "dataIndex": "pr_whid",
-                            "hidden": true,
-                        },{
-                            "text": "仓库编号",
-                            "dataIndex": "pr_whcode",
-                            "hidden": true,
-                        },{
-                            "text": "仓库",
-                            "dataIndex": "pr_whname",
-                            "width": 200,
-                        },{
-                            "text": "总库存数",
-                            "dataIndex": "po_onhand",
-                            "width": 100,
-                            xtype: 'numbercolumn',
-                            align:'end'
-                        },{
-                            "text": "类型",
-                            "dataIndex": "pr_kind",
-                            "width": 100,
-                        },{
-                            "text": "型号",
-                            "dataIndex": "pr_orispeccode",
-                            "width": 100,
-                        },{
-                            "text": "品牌",
-                            "dataIndex": "pr_brand",
-                            "width": 100,
-                        },{
-                            "text": "供应商",
-                            "dataIndex": "pr_vendname",
-                            "width": 100,
-                        },{
-                            "text": "最小包装",
-                            "dataIndex": "pr_zxbzs",
-                            "width": 100,
-                            xtype: 'numbercolumn',
-                            align:'end'
-                        },{
-                            "text": "L/T",
-                            "dataIndex": "pr_leadtime",
-                            "width": 100,
-                        }]
                     }) ;   
 
                 }