Browse Source

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

zhoudw 7 years ago
parent
commit
689a74ee10

+ 12 - 2
applications/document/document-server/src/main/java/com/usoftchina/saas/document/controller/WarehouseController.java

@@ -29,12 +29,22 @@ public class WarehouseController {
         return Result.success(map.get("result"));
     }
 
+    /**
+     * 保存
+     * @param data
+     * @return
+     */
     @PostMapping("/save")
     public Result saveFormData(@RequestBody Warehouse data){
-        boolean result = warehouseService.save(data);
-        return Result.success(result);
+        warehouseService.insertSelective(data);
+        return Result.success();
     }
 
+    /**
+     * 账期校验
+     * @param period
+     * @return
+     */
     @PostMapping("/valid/period")
     public Result validPeriod(String period){
         boolean result = warehouseService.validPeriod(period);

+ 12 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/mapper/WarehouseMapper.java

@@ -10,4 +10,16 @@ public interface WarehouseMapper extends CommonBaseMapper<Warehouse> {
     void callProcedure(Map<String, Object> map);
 
     Short validPeriod(Map<String, Object> map);
+
+    int deleteByPrimaryKey(Integer wh_id);
+
+    int insert(Warehouse record);
+
+    int insertSelective(Warehouse record);
+
+    Warehouse selectByPrimaryKey(Integer wh_id);
+
+    int updateByPrimaryKeySelective(Warehouse record);
+
+    int updateByPrimaryKey(Warehouse record);
 }

+ 6 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/Impl/WarehouseServiceImpl.java

@@ -37,4 +37,10 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         }
     }
 
+    @Override
+    public int insertSelective(Warehouse record) {
+        int count = warehouseMapper.insertSelective(record);
+        return count;
+    }
+
 }

+ 1 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/WarehouseService.java

@@ -13,4 +13,5 @@ public interface WarehouseService extends CommonBaseService<WarehouseMapper, War
 
     boolean validPeriod(String periods);
 
+    int insertSelective(Warehouse record);
 }

+ 776 - 0
applications/document/document-server/src/main/resources/mapper/WarehouseMapper.xml

@@ -35,5 +35,781 @@
         SELECT IFNULL(PD_STATUS,0) PD_STATUS FROM PERIODSDETAIL WHERE COMPANYID=#{companyId} AND PD_DETNO=#{period}
     </select>
 
+    <sql id="Example_Where_Clause">
+        <where>
+            <foreach collection="oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Update_By_Example_Where_Clause">
+        <where>
+            <foreach collection="example.oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Base_Column_List">
+        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
+        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5
+    </sql>
+    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
+        select
+        <if test="distinct">
+            distinct
+        </if>
+        <include refid="Base_Column_List" />
+        from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+        <if test="orderByClause != null">
+            order by ${orderByClause}
+        </if>
+    </select>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from warehouse
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from warehouse
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
+        delete from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse (wh_id, wh_code, wh_type,
+        wh_description, wh_statuscode, wh_status,
+        wh_recorderid, wh_recorder, wh_date,
+        companyid, updaterId, updatetime,
+        wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5)
+        values (#{wh_id,jdbcType=INTEGER}, #{wh_code,jdbcType=VARCHAR}, #{wh_type,jdbcType=VARCHAR},
+        #{wh_description,jdbcType=VARCHAR}, #{wh_statuscode,jdbcType=VARCHAR}, #{wh_status,jdbcType=VARCHAR},
+        #{wh_recorderid,jdbcType=VARCHAR}, #{wh_recorder,jdbcType=VARCHAR}, #{wh_date,jdbcType=TIMESTAMP},
+        #{companyid,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{wh_text1,jdbcType=VARCHAR}, #{wh_text2,jdbcType=VARCHAR}, #{wh_text3,jdbcType=VARCHAR},
+        #{wh_text4,jdbcType=VARCHAR}, #{wh_text5,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="wh_id != null">
+                wh_id,
+            </if>
+            <if test="wh_code != null">
+                wh_code,
+            </if>
+            <if test="wh_type != null">
+                wh_type,
+            </if>
+            <if test="wh_description != null">
+                wh_description,
+            </if>
+            <if test="wh_statuscode != null">
+                wh_statuscode,
+            </if>
+            <if test="wh_status != null">
+                wh_status,
+            </if>
+            <if test="wh_recorderid != null">
+                wh_recorderid,
+            </if>
+            <if test="wh_recorder != null">
+                wh_recorder,
+            </if>
+            <if test="wh_date != null">
+                wh_date,
+            </if>
+            <if test="companyid != null">
+                companyid,
+            </if>
+            <if test="updaterId != null">
+                updaterId,
+            </if>
+            <if test="updatetime != null">
+                updatetime,
+            </if>
+            <if test="wh_text1 != null">
+                wh_text1,
+            </if>
+            <if test="wh_text2 != null">
+                wh_text2,
+            </if>
+            <if test="wh_text3 != null">
+                wh_text3,
+            </if>
+            <if test="wh_text4 != null">
+                wh_text4,
+            </if>
+            <if test="wh_text5 != null">
+                wh_text5,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="wh_id != null">
+                #{wh_id,jdbcType=INTEGER},
+            </if>
+            <if test="wh_code != null">
+                #{wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_type != null">
+                #{wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_description != null">
+                #{wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_statuscode != null">
+                #{wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_status != null">
+                #{wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorderid != null">
+                #{wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorder != null">
+                #{wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_date != null">
+                #{wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterId != null">
+                #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="wh_text1 != null">
+                #{wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text2 != null">
+                #{wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text3 != null">
+                #{wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text4 != null">
+                #{wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text5 != null">
+                #{wh_text5,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
+        select count(*) from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </select>
+    <update id="updateByExampleSelective" parameterType="map">
+        update warehouse
+        <set>
+            <if test="record.wh_id != null">
+                wh_id = #{record.wh_id,jdbcType=INTEGER},
+            </if>
+            <if test="record.wh_code != null">
+                wh_code = #{record.wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_type != null">
+                wh_type = #{record.wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_description != null">
+                wh_description = #{record.wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_statuscode != null">
+                wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_status != null">
+                wh_status = #{record.wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_recorderid != null">
+                wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_recorder != null">
+                wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_date != null">
+                wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.companyid != null">
+                companyid = #{record.companyid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updaterId != null">
+                updaterId = #{record.updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="record.updatetime != null">
+                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.wh_text1 != null">
+                wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text2 != null">
+                wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text3 != null">
+                wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text4 != null">
+                wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="record.wh_text5 != null">
+                wh_text5 = #{record.wh_text5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByExample" parameterType="map">
+        update warehouse
+        set wh_id = #{record.wh_id,jdbcType=INTEGER},
+        wh_code = #{record.wh_code,jdbcType=VARCHAR},
+        wh_type = #{record.wh_type,jdbcType=VARCHAR},
+        wh_description = #{record.wh_description,jdbcType=VARCHAR},
+        wh_statuscode = #{record.wh_statuscode,jdbcType=VARCHAR},
+        wh_status = #{record.wh_status,jdbcType=VARCHAR},
+        wh_recorderid = #{record.wh_recorderid,jdbcType=VARCHAR},
+        wh_recorder = #{record.wh_recorder,jdbcType=VARCHAR},
+        wh_date = #{record.wh_date,jdbcType=TIMESTAMP},
+        companyid = #{record.companyid,jdbcType=INTEGER},
+        updaterId = #{record.updaterId,jdbcType=INTEGER},
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{record.wh_text1,jdbcType=VARCHAR},
+        wh_text2 = #{record.wh_text2,jdbcType=VARCHAR},
+        wh_text3 = #{record.wh_text3,jdbcType=VARCHAR},
+        wh_text4 = #{record.wh_text4,jdbcType=VARCHAR},
+        wh_text5 = #{record.wh_text5,jdbcType=VARCHAR}
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        <set>
+            <if test="wh_code != null">
+                wh_code = #{wh_code,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_type != null">
+                wh_type = #{wh_type,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_description != null">
+                wh_description = #{wh_description,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_statuscode != null">
+                wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_status != null">
+                wh_status = #{wh_status,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorderid != null">
+                wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_recorder != null">
+                wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_date != null">
+                wh_date = #{wh_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                companyid = #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterId != null">
+                updaterId = #{updaterId,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                updatetime = #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="wh_text1 != null">
+                wh_text1 = #{wh_text1,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text2 != null">
+                wh_text2 = #{wh_text2,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text3 != null">
+                wh_text3 = #{wh_text3,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text4 != null">
+                wh_text4 = #{wh_text4,jdbcType=VARCHAR},
+            </if>
+            <if test="wh_text5 != null">
+                wh_text5 = #{wh_text5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        set wh_code = #{wh_code,jdbcType=VARCHAR},
+        wh_type = #{wh_type,jdbcType=VARCHAR},
+        wh_description = #{wh_description,jdbcType=VARCHAR},
+        wh_statuscode = #{wh_statuscode,jdbcType=VARCHAR},
+        wh_status = #{wh_status,jdbcType=VARCHAR},
+        wh_recorderid = #{wh_recorderid,jdbcType=VARCHAR},
+        wh_recorder = #{wh_recorder,jdbcType=VARCHAR},
+        wh_date = #{wh_date,jdbcType=TIMESTAMP},
+        companyid = #{companyid,jdbcType=INTEGER},
+        updaterId = #{updaterId,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{wh_text1,jdbcType=VARCHAR},
+        wh_text2 = #{wh_text2,jdbcType=VARCHAR},
+        wh_text3 = #{wh_text3,jdbcType=VARCHAR},
+        wh_text4 = #{wh_text4,jdbcType=VARCHAR},
+        wh_text5 = #{wh_text5,jdbcType=VARCHAR}
+        where wh_id = #{wh_id,jdbcType=INTEGER}
+    </update>
+    <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.Warehouse">
+        <id column="wh_id" jdbcType="INTEGER" property="whId" />
+        <result column="wh_code" jdbcType="VARCHAR" property="whCode" />
+        <result column="wh_type" jdbcType="VARCHAR" property="whType" />
+        <result column="wh_description" jdbcType="VARCHAR" property="whDescription" />
+        <result column="wh_statuscode" jdbcType="VARCHAR" property="whStatuscode" />
+        <result column="wh_status" jdbcType="VARCHAR" property="whStatus" />
+        <result column="wh_recorderid" jdbcType="VARCHAR" property="whRecorderid" />
+        <result column="wh_recorder" jdbcType="VARCHAR" property="whRecorder" />
+        <result column="wh_date" jdbcType="TIMESTAMP" property="whDate" />
+        <result column="companyid" jdbcType="INTEGER" property="companyid" />
+        <result column="updaterId" jdbcType="INTEGER" property="updaterid" />
+        <result column="updatetime" jdbcType="TIMESTAMP" property="updatetime" />
+        <result column="wh_text1" jdbcType="VARCHAR" property="whText1" />
+        <result column="wh_text2" jdbcType="VARCHAR" property="whText2" />
+        <result column="wh_text3" jdbcType="VARCHAR" property="whText3" />
+        <result column="wh_text4" jdbcType="VARCHAR" property="whText4" />
+        <result column="wh_text5" jdbcType="VARCHAR" property="whText5" />
+    </resultMap>
+    <sql id="Example_Where_Clause">
+        <where>
+            <foreach collection="oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Update_By_Example_Where_Clause">
+        <where>
+            <foreach collection="example.oredCriteria" item="criteria" separator="or">
+                <if test="criteria.valid">
+                    <trim prefix="(" prefixOverrides="and" suffix=")">
+                        <foreach collection="criteria.criteria" item="criterion">
+                            <choose>
+                                <when test="criterion.noValue">
+                                    and ${criterion.condition}
+                                </when>
+                                <when test="criterion.singleValue">
+                                    and ${criterion.condition} #{criterion.value}
+                                </when>
+                                <when test="criterion.betweenValue">
+                                    and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                                </when>
+                                <when test="criterion.listValue">
+                                    and ${criterion.condition}
+                                    <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                                        #{listItem}
+                                    </foreach>
+                                </when>
+                            </choose>
+                        </foreach>
+                    </trim>
+                </if>
+            </foreach>
+        </where>
+    </sql>
+    <sql id="Base_Column_List">
+        wh_id, wh_code, wh_type, wh_description, wh_statuscode, wh_status, wh_recorderid,
+        wh_recorder, wh_date, companyid, updaterId, updatetime, wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5
+    </sql>
+    <select id="selectByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultMap="BaseResultMap">
+        select
+        <if test="distinct">
+            distinct
+        </if>
+        <include refid="Base_Column_List" />
+        from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+        <if test="orderByClause != null">
+            order by ${orderByClause}
+        </if>
+    </select>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from warehouse
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from warehouse
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </delete>
+    <delete id="deleteByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample">
+        delete from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </delete>
+    <insert id="insert" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse (wh_id, wh_code, wh_type,
+        wh_description, wh_statuscode, wh_status,
+        wh_recorderid, wh_recorder, wh_date,
+        companyid, updaterId, updatetime,
+        wh_text1, wh_text2, wh_text3,
+        wh_text4, wh_text5)
+        values (#{whId,jdbcType=INTEGER}, #{whCode,jdbcType=VARCHAR}, #{whType,jdbcType=VARCHAR},
+        #{whDescription,jdbcType=VARCHAR}, #{whStatuscode,jdbcType=VARCHAR}, #{whStatus,jdbcType=VARCHAR},
+        #{whRecorderid,jdbcType=VARCHAR}, #{whRecorder,jdbcType=VARCHAR}, #{whDate,jdbcType=TIMESTAMP},
+        #{companyid,jdbcType=INTEGER}, #{updaterid,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP},
+        #{whText1,jdbcType=VARCHAR}, #{whText2,jdbcType=VARCHAR}, #{whText3,jdbcType=VARCHAR},
+        #{whText4,jdbcType=VARCHAR}, #{whText5,jdbcType=VARCHAR})
+    </insert>
+    <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        insert into warehouse
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="whId != null">
+                wh_id,
+            </if>
+            <if test="whCode != null">
+                wh_code,
+            </if>
+            <if test="whType != null">
+                wh_type,
+            </if>
+            <if test="whDescription != null">
+                wh_description,
+            </if>
+            <if test="whStatuscode != null">
+                wh_statuscode,
+            </if>
+            <if test="whStatus != null">
+                wh_status,
+            </if>
+            <if test="whRecorderid != null">
+                wh_recorderid,
+            </if>
+            <if test="whRecorder != null">
+                wh_recorder,
+            </if>
+            <if test="whDate != null">
+                wh_date,
+            </if>
+            <if test="companyid != null">
+                companyid,
+            </if>
+            <if test="updaterid != null">
+                updaterId,
+            </if>
+            <if test="updatetime != null">
+                updatetime,
+            </if>
+            <if test="whText1 != null">
+                wh_text1,
+            </if>
+            <if test="whText2 != null">
+                wh_text2,
+            </if>
+            <if test="whText3 != null">
+                wh_text3,
+            </if>
+            <if test="whText4 != null">
+                wh_text4,
+            </if>
+            <if test="whText5 != null">
+                wh_text5,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="whId != null">
+                #{whId,jdbcType=INTEGER},
+            </if>
+            <if test="whCode != null">
+                #{whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="whType != null">
+                #{whType,jdbcType=VARCHAR},
+            </if>
+            <if test="whDescription != null">
+                #{whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatuscode != null">
+                #{whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatus != null">
+                #{whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorderid != null">
+                #{whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorder != null">
+                #{whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="whDate != null">
+                #{whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterid != null">
+                #{updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="whText1 != null">
+                #{whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="whText2 != null">
+                #{whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="whText3 != null">
+                #{whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="whText4 != null">
+                #{whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="whText5 != null">
+                #{whText5,jdbcType=VARCHAR},
+            </if>
+        </trim>
+    </insert>
+    <select id="countByExample" parameterType="com.usoftchina.saas.document.entities.WarehouseExample" resultType="java.lang.Integer">
+        select count(*) from warehouse
+        <if test="_parameter != null">
+            <include refid="Example_Where_Clause" />
+        </if>
+    </select>
+    <update id="updateByExampleSelective" parameterType="map">
+        update warehouse
+        <set>
+            <if test="record.whId != null">
+                wh_id = #{record.whId,jdbcType=INTEGER},
+            </if>
+            <if test="record.whCode != null">
+                wh_code = #{record.whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whType != null">
+                wh_type = #{record.whType,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whDescription != null">
+                wh_description = #{record.whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whStatuscode != null">
+                wh_statuscode = #{record.whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whStatus != null">
+                wh_status = #{record.whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whRecorderid != null">
+                wh_recorderid = #{record.whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whRecorder != null">
+                wh_recorder = #{record.whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whDate != null">
+                wh_date = #{record.whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.companyid != null">
+                companyid = #{record.companyid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updaterid != null">
+                updaterId = #{record.updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="record.updatetime != null">
+                updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="record.whText1 != null">
+                wh_text1 = #{record.whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText2 != null">
+                wh_text2 = #{record.whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText3 != null">
+                wh_text3 = #{record.whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText4 != null">
+                wh_text4 = #{record.whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="record.whText5 != null">
+                wh_text5 = #{record.whText5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByExample" parameterType="map">
+        update warehouse
+        set wh_id = #{record.whId,jdbcType=INTEGER},
+        wh_code = #{record.whCode,jdbcType=VARCHAR},
+        wh_type = #{record.whType,jdbcType=VARCHAR},
+        wh_description = #{record.whDescription,jdbcType=VARCHAR},
+        wh_statuscode = #{record.whStatuscode,jdbcType=VARCHAR},
+        wh_status = #{record.whStatus,jdbcType=VARCHAR},
+        wh_recorderid = #{record.whRecorderid,jdbcType=VARCHAR},
+        wh_recorder = #{record.whRecorder,jdbcType=VARCHAR},
+        wh_date = #{record.whDate,jdbcType=TIMESTAMP},
+        companyid = #{record.companyid,jdbcType=INTEGER},
+        updaterId = #{record.updaterid,jdbcType=INTEGER},
+        updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{record.whText1,jdbcType=VARCHAR},
+        wh_text2 = #{record.whText2,jdbcType=VARCHAR},
+        wh_text3 = #{record.whText3,jdbcType=VARCHAR},
+        wh_text4 = #{record.whText4,jdbcType=VARCHAR},
+        wh_text5 = #{record.whText5,jdbcType=VARCHAR}
+        <if test="_parameter != null">
+            <include refid="Update_By_Example_Where_Clause" />
+        </if>
+    </update>
+    <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        <set>
+            <if test="whCode != null">
+                wh_code = #{whCode,jdbcType=VARCHAR},
+            </if>
+            <if test="whType != null">
+                wh_type = #{whType,jdbcType=VARCHAR},
+            </if>
+            <if test="whDescription != null">
+                wh_description = #{whDescription,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatuscode != null">
+                wh_statuscode = #{whStatuscode,jdbcType=VARCHAR},
+            </if>
+            <if test="whStatus != null">
+                wh_status = #{whStatus,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorderid != null">
+                wh_recorderid = #{whRecorderid,jdbcType=VARCHAR},
+            </if>
+            <if test="whRecorder != null">
+                wh_recorder = #{whRecorder,jdbcType=VARCHAR},
+            </if>
+            <if test="whDate != null">
+                wh_date = #{whDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="companyid != null">
+                companyid = #{companyid,jdbcType=INTEGER},
+            </if>
+            <if test="updaterid != null">
+                updaterId = #{updaterid,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                updatetime = #{updatetime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="whText1 != null">
+                wh_text1 = #{whText1,jdbcType=VARCHAR},
+            </if>
+            <if test="whText2 != null">
+                wh_text2 = #{whText2,jdbcType=VARCHAR},
+            </if>
+            <if test="whText3 != null">
+                wh_text3 = #{whText3,jdbcType=VARCHAR},
+            </if>
+            <if test="whText4 != null">
+                wh_text4 = #{whText4,jdbcType=VARCHAR},
+            </if>
+            <if test="whText5 != null">
+                wh_text5 = #{whText5,jdbcType=VARCHAR},
+            </if>
+        </set>
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.Warehouse">
+        update warehouse
+        set wh_code = #{whCode,jdbcType=VARCHAR},
+        wh_type = #{whType,jdbcType=VARCHAR},
+        wh_description = #{whDescription,jdbcType=VARCHAR},
+        wh_statuscode = #{whStatuscode,jdbcType=VARCHAR},
+        wh_status = #{whStatus,jdbcType=VARCHAR},
+        wh_recorderid = #{whRecorderid,jdbcType=VARCHAR},
+        wh_recorder = #{whRecorder,jdbcType=VARCHAR},
+        wh_date = #{whDate,jdbcType=TIMESTAMP},
+        companyid = #{companyid,jdbcType=INTEGER},
+        updaterId = #{updaterid,jdbcType=INTEGER},
+        updatetime = #{updatetime,jdbcType=TIMESTAMP},
+        wh_text1 = #{whText1,jdbcType=VARCHAR},
+        wh_text2 = #{whText2,jdbcType=VARCHAR},
+        wh_text3 = #{whText3,jdbcType=VARCHAR},
+        wh_text4 = #{whText4,jdbcType=VARCHAR},
+        wh_text5 = #{whText5,jdbcType=VARCHAR}
+        where wh_id = #{whId,jdbcType=INTEGER}
+    </update>
+
 </mapper>
 

+ 8 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -126,7 +126,14 @@ Ext.define('saas.util.FormUtil', {
         }else{
             var viewModel = form.getViewModel();
             var detailStore = viewModel.get('_detailStore');
-            detailStore.loadData([{},{},{},{},{},{},{},{},{},{}]);
+            var detno = 0,datas=[];
+            Ext.Array.each(new Array(10), function() {
+                detno += 1;
+                var data = {};
+                data[form._detnoColumn] = detno;
+                datas.push(data);
+            })
+            detailStore.loadData(datas);
         }
     }
 });

+ 84 - 4
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -1,18 +1,84 @@
 Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
-    extend: 'saas.view.core.grid.GridPanel',
+    extend: 'Ext.grid.Panel',
     xtype: 'dbfindgridpanel',
     GridUtil: Ext.create('saas.util.GridUtil'),
     BaseUtil: Ext.create('saas.util.BaseUtil'),
     dataUrl: '',
+    dbSearchFields: [],
+    condition:'',
 
     initComponent: function() {
         var me = this;
         if(me.columns){
             var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 6,
+                data: [],
+                proxy: {
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = " 1=1 ";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            keyword: condition
+                        });
+                    }
+                }
+            });
+
             Ext.apply(me, {
-                store:Ext.create('Ext.data.Store', {
-                    fields:fields
-                })
+                dockedItems:[{
+                    xtype:'toolbar',
+                    dock:'top',
+                    items:me.dbSearchFields.concat([{
+                        xtype:'button',
+                        text:'查询',
+                        handler:function(b){
+                            var grid = me;
+                            grid.condition = '';
+                            var fields = grid.dbSearchFields;
+                            Ext.Array.each(fields,function(f) {
+                                var field = b.ownerCt.down('[name='+f.name+']')
+                                var c = grid.getCondition(field,f.conditionExpression);
+                                grid.condition+=c;
+                            });
+                            debugger
+                            if(grid.condition.length>0){
+                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
+                            }
+                            grid.store.loadPage(1);
+                        }
+                    },'->',{
+                        xtype:'button',
+                        text:'新增'
+                    }])
+                },{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页"
+                }]
             });
         }
         me.callParent(arguments);
@@ -70,5 +136,19 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
             }
             me.ownerCt.close();
         }
+    },
+
+    getCondition: function(f,conditionExpression){
+        debugger
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
     }
 });

+ 1 - 0
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -35,6 +35,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
                 dataUrl: f.dataUrl,
                 dbfinds: f.dbfinds,
                 belong: f.belong,
+                dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
                 dbfindtrigger:f
             }]
         });

+ 271 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindGridPanel.js

@@ -0,0 +1,271 @@
+Ext.define('saas.view.core.dbfind.MultiDbfindGridPanel', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'multidbfindgridpanel',
+    GridUtil: Ext.create('saas.util.GridUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    dataUrl: '',
+    dbSearchFields: [],
+    condition:'',
+    selectRecordArr:[],
+
+    selModel: {
+        checkOnly:true,
+        type:'checkboxmodel',
+        ignoreRightMouseSelection : false,
+        listeners:{
+            select:function(selModel,record,c,d){
+                var selectRecordArr = selModel.view.ownerCt.selectRecordArr;
+                selectRecordArr.push(record);
+            },
+            deselect:function(selModel,record){
+                var selectRecordArr = selModel.view.ownerCt.selectRecordArr;
+                var index = -1;
+                index = selectRecordArr.findIndex(function(f){
+                    return f.id==record.id
+                });
+                if(index>-1){
+                    selectRecordArr.splice(index,1);
+                }
+            }
+        },
+	    onHeaderClick: function(headerCt, header, e) {
+            console.log('header click');
+	        if (header.isCheckerHd) {
+	            e.stopEvent();
+	            var isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');
+	            if (isChecked && this.getSelection().length > 0) {//先全选,再筛选后再全选时,无法响应的bug
+	                this.deselectAll(true);
+	            } else {
+	                this.selectAll(true);
+	                this.view.ownerCt.selectall = true;
+	            }
+            }
+	    }
+	},
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 6,
+                data: [],
+                proxy: {
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list',
+                        totalProperty: 'data.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = " 1=1 ";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            keyword: condition
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype:'toolbar',
+                    dock:'top',
+                    items:me.dbSearchFields.concat([{
+                        xtype:'button',
+                        text:'查询',
+                        handler:function(b){
+                            var grid = me;
+                            grid.condition = '';
+                            var fields = grid.dbSearchFields;
+                            Ext.Array.each(fields,function(f) {
+                                var field = b.ownerCt.down('[name='+f.name+']')
+                                var c = grid.getCondition(field,f.conditionExpression);
+                                grid.condition+=c;
+                            });
+                            if(grid.condition.length>0){
+                                grid.condition = grid.condition.substring(0,grid.condition.length-5);
+                            }
+                            grid.store.loadPage(1);
+                        }
+                    },'->',{
+                        xtype:'button',
+                        text:'新增'
+                    }])
+                },{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    emptyMsg: "暂无数据",
+                    store: me.store,
+                    displayMsg: '显示{0}到{1}条数据,共有{2}条',
+                    beforePageText: "当前第",
+                    afterPageText: "页,共{0}页",
+                    items:[{
+                        xtype:'checkbox',
+                        id:'showSelectRecord',
+                        boxLabel:'显示选中数据',
+                        handler:function(b){
+                            var grid = me;
+                            if(b.checked){
+                                grid.store.loadData(grid.selectRecordArr);
+                            }else{
+                                grid.store.loadPage(1);
+                            }
+                        }
+                    }],
+                    moveFirst: function() {
+                        //if(Ext.getCmp('showSelectRecord').checked==false){
+                            if (this.fireEvent('beforechange', this, 1) !== false) {
+                                this.store.loadPage(1);
+                                return true;
+                            }
+                        //}
+                        return false;
+                    },
+                    movePrevious: function() {
+                        var me = this,
+                            store = me.store,
+                            prev = store.currentPage - 1;
+                        if (prev > 0) {
+                            if (me.fireEvent('beforechange', me, prev) !== false) {
+                                store.previousPage();
+                                return true;
+                            }
+                        }
+                        return false;
+                    },
+                    moveNext: function() {
+                        var me = this,
+                            store = me.store,
+                            total = me.getPageData().pageCount,
+                            next = store.currentPage + 1;
+                        if (next <= total) {
+                            if (me.fireEvent('beforechange', me, next) !== false) {
+                                store.nextPage();
+                                return true;
+                            }
+                        }
+                        return false;
+                    },
+                    moveLast: function() {
+                        var me = this,
+                            last = me.getPageData().pageCount;
+                        if (me.fireEvent('beforechange', me, last) !== false) {
+                            me.store.loadPage(last);
+                            return true;
+                        }
+                        return false;
+                    },
+                    doRefresh: function() {
+                        var me = this,
+                            store = me.store,
+                            current = store.currentPage;
+                        if (me.fireEvent('beforechange', me, current) !== false) {
+                            store.loadPage(current);
+                            return true;
+                        }
+                        return false;
+                    },
+                    updateInfo: function() {
+                        var me = this,
+                            displayItem = me.child('#displayItem'),
+                            store = me.store,
+                            pageData = me.getPageData(),
+                            count, msg;
+                        if (displayItem) {
+                            count = store.getCount();
+                            if (count === 0) {
+                                msg = me.emptyMsg;
+                            } else {
+                                msg = Ext.String.format(me.displayMsg, pageData.fromRecord, pageData.toRecord, pageData.total);
+                            }
+                            displayItem.setText(msg);
+                        }
+                    }
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    loadData: function(grid, url) {
+        this.BaseUtil.request({url})
+        .then(function(response) {
+            var data = Ext.decode(response.responseText);
+                grid.getStore().loadData(data.data);
+                grid.fireEvent('afterLoadData', grid, data.data);
+                grid.setLoading(false);
+        })
+        .catch(function(response) {
+            // something...
+        });
+    },
+
+    listeners:{
+        afterrender:function(grid){
+            if(grid.dataUrl){
+                grid.setLoading(true);
+                grid.loadData(grid, grid.dataUrl);
+            }
+        }//,
+        // itemClick: function(view,record) {
+        //     var me = this;
+        //     var dbfinds = me.dbfinds;
+        //     if(dbfinds&&dbfinds.length>0){
+        //         if(me.belong=='grid'){
+        //             for (let index = 0; index < dbfinds.length; index++) {
+        //                 var item = dbfinds[index];
+        //                 var rec = me.dbfindtrigger.column.ownerCt.ownerCt.selModel.getLastSelected();
+        //                 if(rec){
+        //                     var nowRec = me.dbfindtrigger.column.ownerCt.ownerCt.store.getData().getByKey(rec.id);
+        //                     nowRec.set(item.to,record.get(item.from));
+        //                     //me.column.getEditor().setValue(record.get(item.from));
+        //                 }
+        //             }
+        //         }else if(me.belong=='form'){
+        //             for (let index = 0; index < dbfinds.length; index++) {
+        //                 var item = dbfinds[index];
+        //                 var field = me.ownerCt.belong.down('[name='+item.to+']');
+        //                 if(field){
+        //                     var val = record.get(item.from);
+        //                     if(field.xtype=='dbfindtrigger'){
+        //                         field.setValue(val);
+        //                         field.lastTriggerValue=val;
+        //                     }else{
+        //                         field.setValue(val);
+        //                     }    
+        //                 }
+        //             }
+        //         }
+        //     }
+        //     me.ownerCt.close();
+        // }
+    },
+
+    getCondition: function(f,conditionExpression){
+        debugger
+        var condition = '';
+        if((f.xtype == 'checkbox' || f.xtype == 'radio')&&f.logic){
+            
+        }else if(f.xtype=='textfield'&&f.value!=''){
+            condition=conditionExpression.replace(new RegExp("\\{0}","g"), f.value);
+        }
+        if(condition.length>0){
+            condition+= ' AND ';
+        }
+        return condition;
+    }
+});

+ 57 - 0
frontend/saas-web/app/view/core/dbfind/MultiDbfindTrigger.js

@@ -0,0 +1,57 @@
+/**
+ *  multi dbfind trigger
+ * 改了下MultiDbfindTrigger的赋值方式,在grid中也会把多选的值用#号连接
+ */
+Ext.define('saas.view.core.dbfind.MultiDbfindTrigger', {
+	extend: 'Ext.form.field.Trigger',
+	alias: 'widget.multidbfindtrigger',
+	triggerCls: 'x-form-search-trigger',
+    GridUtil: Ext.create('saas.util.GridUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
+    minChars:1, // 设置用户输入字符多少时触发查询
+    tpl: '',
+    enableKeyEvents:true,
+    initComponent:function() {
+        var me = this;
+        this.callParent(arguments);
+    },
+    onTriggerClick:function(f){
+        //判断dbfindtrigger归属
+        var belong = f.judge(f);
+        var win = Ext.create('Ext.window.Window', {   
+            trigger:f,
+            belong:f.ownerCt,  
+            modal:true,
+            height: '80%',
+            width: '80%',
+            title: '查找',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            renderTo:Ext.getCmp('main-tab-panel').getActiveTab().getEl(),
+            items:[{
+                xtype:'multidbfindgridpanel',
+                columns: f.dbColumns,
+                dataUrl: f.dataUrl,
+                dbfinds: f.dbfinds,
+                belong: f.belong,
+                dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
+                dbfindtrigger:f
+            }]
+        });
+        win.show();
+    },
+
+    judge:function(f){
+        if(f.ownerCt.xtype.trim().toUpperCase().indexOf('FORMPANEL')>-1){
+            f.belong = 'form';
+            return 'form'
+        }
+        else if(f.column){
+            f.belong = 'grid';
+            return 'grid'
+        }
+    }
+});

+ 3 - 0
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -62,6 +62,9 @@ Ext.define('saas.view.core.form.FormPanel', {
                 }, {
                     xtype: 'button',
                     text: '删除',
+                    bind: {
+                        hidden: '{deleteHidden}'
+                    },
                     handler: 'delete'
                 }, {
                     xtype: 'button',

+ 10 - 0
frontend/saas-web/app/view/core/form/FormPanelModel.js

@@ -3,8 +3,18 @@ Ext.define('saas.view.core.form.FormPanelModel', {
     alias: 'viewmodel.core-form-formpanel',
 
     data: {
+        id:0,
         _bindFields: [], // 主表绑定字段,绑定到formfield并且未设置ignore为true
         _detailBindeFields: [], // 从表绑定列
         _detailStore: null, // 从表store
     },
+
+    formulas:{
+        deleteHidden:{
+            bind:'{id}',
+            get:function(value){
+                return !value;
+            }
+        }
+    }
 });

+ 29 - 15
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -25,6 +25,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     showIndex: true,
     configUrl: '',
 
+    features: [{
+        ftype: 'summary',
+        dock: 'bottom'
+    }],
+
     initComponent: function() {
         var me = this;
         me.setSummary();
@@ -121,17 +126,20 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
             form = me.ownerCt,
             detnoColumn = form._detnoColumn,
             store = me.getStore(),
-            selectedRecord = me.selModel.lastSelected;
+            selectedRecord = me.selModel.lastSelected,
+            detno = 0;
 
         //当前行后序号全部加1
-        var detno = selectedRecord.data[form._detnoColumn];
-        var store = me.store;
-        store.each(function(item){
-            d = item.data[detnoColumn];
-            if(Number(d) > detno) {
-                item.set(detnoColumn, Number(d) + 1);
-            }
-        });
+        if(selectedRecord){
+            detno = selectedRecord.data[form._detnoColumn];
+            var store = me.store;
+            store.each(function(item){
+                d = item.data[detnoColumn];
+                if(Number(d) > detno) {
+                    item.set(detnoColumn, Number(d) + 1);
+                }
+            });
+        }
         var data = {};
         data[detnoColumn] = detno + 1;
         store.insert(store.indexOf(selectedRecord) + 1, data);
@@ -169,11 +177,11 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     swapUp: function() {
         var me = this,
-            store = me.getStore(),
-            record = me.selModel.lastSelected,
-            selectedIdx = store.indexOf(record);
-            
-            me.swap(record, selectedIdx, -1);
+        store = me.getStore(),
+        record = me.selModel.lastSelected,
+        selectedIdx = store.indexOf(record);
+
+        me.swap(record, selectedIdx, -1);
     },
 
     swapDown: function() {
@@ -187,11 +195,17 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
 
     swap: function(from, index, dir) {
         var me = this,
+        form = me.ownerCt,
         store = me.getStore(),
         to = store.getAt(index + dir);
 
         if(from && to) {
-            var keys = me.getColumns().map(function(c) { return c.dataIndex }),
+            var keys = me.getColumns().map(function(c) {
+                //剔除序号字段
+                if(c.dataIndex!=form._detnoColumn){
+                    return c.dataIndex 
+                }
+            }),
             data = from.getData(),
             toData = to.getData();
 

+ 131 - 43
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -71,21 +71,91 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
+                defaults: { // defaults 将会应用所有的子组件上,而不是父容器
+                    listeners: {
+                        'mouseover':function(){
+                            this.showMenu(); 
+                        },
+                        'mouseout':function(btn,e){
+                            var cx = e.browserEvent.clientX, cy = e.browserEvent.clientY;
+                            var btnLayout = btn.el.dom.getBoundingClientRect();
+                            if(cx <= btnLayout.left || cx >= btnLayout.left+btnLayout.width || cy <= btnLayout.top) {
+                                btn.hideMenu();
+                            }
+                        }
+                    }
+                },
                 items: ['->', {
                     text: '新增',
                     handler: me.onAddMore
                 }, {
                     text: '审核',
-                    handler: me.onAudit
-                }, {
-                    text: '反审核',
-                    handler: me.onUnAudit
+                    xtype: 'button',
+                    handler: me.onAudit,
+                    menu: {
+                        items: [{
+                            text:'反审核',
+                            handler:function(){
+                                me.onUnAudit(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '打印',
-                    handler: me.onPrint
+                    handler: me.onPrint,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'设置',
+                            handler:function(){
+                                me.onPrintSet(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
-                    text: '导出',
-                    handler: me.onExport
+                    text: '导入',
+                    handler: me.onImport,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'导出',
+                            handler:function(){
+                                me.onExport(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
+                },{
+                    text: '关闭',
+                    handler: me.onCloseOrder,
+                    menu: {
+                        width: 80,
+                        items: [{
+                            text:'启用',
+                            handler:function(){
+                                me.onOpenOrder(this)
+                            }
+                        }],
+                        listeners: {
+                            'mouseleave':function(enu){
+                                this.hide();
+                            } 
+                        }
+                    }
                 }, {
                     text: '删除',
                     handler: me.onDelete
@@ -131,8 +201,8 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             return c.dataIndex;
         });
     },
-    onAddMore: function (btn) {
-        var grid = this.getGrid(btn),
+    onAddMore: function (me) {
+        var grid = me.up('grid'),
             mainTab = Ext.getCmp('main-tab-panel'),
             id = grid.xtype + '_add';
             existingItem = mainTab.down('[id=' + id + ']');
@@ -145,37 +215,55 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             mainTab.setActiveTab(mainTab.add(form));
         }
     },
-    onAudit: function(btn){
-        btn.ownerCt.ownerCt.vastOperation("batchAudit");
+    onAudit: function(me){
+        console.log('审核');
+        me.up('grid').vastOperation("batchAudit");
     },
-    onUnAudit:function(btn){
-        btn.ownerCt.ownerCt.vastOperation("batchUnAudit");
+    onUnAudit:function(me){
+        console.log('反审核');
+        me.up('grid').vastOperation("batchUnAudit");
     },
-    onPrint: function () {
+    onPrint: function (me) {
         console.log("打印");
     },
-    onExport: function () {
+    onPrintSet:function(me){
+        console.log("打印设置");
+    },
+    onImport:function(me){
+        console.log("导入");
+    },
+    onExport: function (me) {
         console.log("导出");
     },
+    onCloseOrder:function(me){
+        console.log("关闭订单");
+    },onOpenOrder:function(me){
+        console.log("开启订单");
+    },
     onDelete: function (btn) {
-        btn.ownerCt.ownerCt.vastOperation("batchDelete");
+        btn.up('grid').vastOperation("batchDelete");
     },
     vastOperation :function(type){
-        var me = this,
-        params = JSON.stringify(me.getGridSelected());
-        me.BaseUtil.request({
-                url: me._baseVastUrl+type,
-                params: params,
-                method: 'POST',
-                async:false
-            })
-            .then(function() {
-                Ext.Msg.alert('提示','操作成功');
-            })
-            .catch(function(response) {
-                Ext.Msg.alert('提示','操作失败');
-            });
-            me.getStore().loadPage(1);
+        var me = this;
+        var data = me.getGridSelected();
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            me.BaseUtil.request({
+                    url: me._baseVastUrl+type,
+                    params: params,
+                    method: 'POST',
+                    async:false
+                })
+                .then(function() {
+                    Ext.Msg.alert('提示','操作成功');
+                })
+                .catch(function(response) {
+                    Ext.Msg.alert('提示','操作失败');
+                });
+                me.getStore().loadPage(1);
+        }else{
+            Ext.Msg.alert('提示','请勾选至少一条明细。');
+        }
     },
     /**
      * 获取grid被选数据
@@ -185,18 +273,18 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         var me = this,
             items = me.selModel.getSelection(),
             data = new Array() ;
-		Ext.each(items, function(item, index){
-			if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
-				var o = new Object();
-				if(me._idField){
-					o['id'] = item.data[me._idField];
-                }
-                if(me._codeField){
-					o['code'] = item.data[me._codeField];
+            Ext.each(items, function(item, index){
+                if(!Ext.isEmpty(item.data[me._idField])&&!Ext.isEmpty(item.data[me._codeField])){
+                    var o = new Object();
+                    if(me._idField){
+                        o['id'] = item.data[me._idField];
+                    }
+                    if(me._codeField){
+                        o['code'] = item.data[me._codeField];
+                    }
+                    data.push(o);
                 }
-				data.push(o);
-            }
-		});
-		return {baseDTOs:data};
+            });
+		return data;
     } 
 });

+ 73 - 1
frontend/saas-web/app/view/test/order/FormController.js

@@ -26,6 +26,14 @@ Ext.define('saas.view.test.order.FormController', {
                         },{
                             field:'ve_name',width:100
                         }],
+                        dbSearchFields:[{
+                            xtype : "textfield", 
+                            name : "ve_name", 
+                            conditionExpression:"ve_name like '{0}%'",
+                            fieldLabel : "供应商名称", 
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             conditionCode:'ve_id',
                             "text": "供应商ID",
@@ -66,16 +74,80 @@ Ext.define('saas.view.test.order.FormController', {
             'dbfindtrigger[name=pd_prodcode]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        conditionCode:'pr_code',
                         dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
                         dbfinds:[{
                             from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
                         }],
                         dbtpls:[{
                             field:'pr_code',width:100
                         },{
                             field:'pr_detail',width:100
                         }],
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
+                        dbColumns:[{
+                            "text": "物料ID",
+                            "flex": 0,
+                            "dataIndex": "pr_id",
+                            "width": 0,
+                            "xtype": "",
+                            "items": null
+                        },{
+                            "text": "物料编号",
+                            "flex": 1,
+                            "dataIndex": "pr_code",
+                            "width": 100,
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料名称",
+                            "flex": 1,
+                            "dataIndex": "pr_detail",
+                            "xtype": "",
+                            "items": null
+                        }, {
+                            "text": "物料规格",
+                            "flex": 0,
+                            "dataIndex": "pr_spec",
+                            "width": 200,
+                            "xtype": "",
+                            "items": null
+                        }]
+                    }) ;   
+
+                }
+            },
+            //放大镜赋值关系 以及 tpl模板
+            'multidbfindtrigger[name=pd_prodcode]':{
+                beforerender:function(f){
+                    Ext.apply(f,{
+                        dataUrl:'http://192.168.253.41:9480/api/document/product/getProductsByCondition',
+                        dbfinds:[{
+                            from:'pr_code',to:'pd_prodcode'
+                        },{
+                            from:'pr_unit',to:'pd_unit'
+                        }],
+                        dbtpls:[{
+                            field:'pr_code',width:100
+                        },{
+                            field:'pr_detail',width:100
+                        }],
+                        dbSearchFields:[{
+                            emptyText:'输入物料编号或物料名称',
+                            xtype : "textfield", 
+                            name : "search", 
+                            conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
+                            allowBlank : true, 
+                            columnWidth : 0.25
+                        }],
                         dbColumns:[{
                             "text": "物料ID",
                             "flex": 0,

+ 2 - 2
frontend/saas-web/app/view/test/order/FormPanel.js

@@ -18,7 +18,7 @@ Ext.define('saas.view.test.order.FormPanel', {
     _auditUrl:'http://192.168.253.58:8800/purchase/audit',
     _deleteUrl:'http://192.168.253.58:8800/purchase/delete/',
     _deleteDetailUrl:'http://192.168.253.58:8800/purchase/deleteItem/',
-    initId:11,
+    initId:0,
 
     toolBtns: [{
         xtype: 'button',
@@ -149,7 +149,7 @@ Ext.define('saas.view.test.order.FormPanel', {
                     queryMode : "local", 
                     store : null, 
                     valueField : "value", 
-                    xtype : "dbfindtrigger"
+                    xtype : "multidbfindtrigger"
                 }, 
                 text : "物料编号", 
                 width : 200.0,