zhs 2 роки тому
батько
коміт
7bd0f310f5

+ 32 - 0
src/main/java/com/tld/controller/DictionaryController.java

@@ -2,6 +2,7 @@ package com.tld.controller;
 
 import com.tld.model.Dictionary;
 import com.tld.model.Goods;
+import com.tld.model.GunLine;
 import com.tld.service.DictionaryService;
 import com.tld.util.PassToken;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -97,4 +98,35 @@ public class DictionaryController {
     public Map<String, Object> getMaterial(Dictionary dictionary){
         return dictionaryService.getMaterial(dictionary);
     }
+
+    /**
+     * 查询枪线内容
+     * @param gunLine 参数
+     * @return 返回结果
+     */
+    @GetMapping("getGunLine")
+    public Map<String, Object> getGunLine(GunLine gunLine){
+        return dictionaryService.getGunLine(gunLine);
+    }
+
+    /**
+     * 删除枪线内容
+     * @param id 参数
+     * @return 返回结果
+     */
+    @DeleteMapping("delGunLine")
+    public Map<String, Object> delGunLine(String id){
+        return dictionaryService.delGunLine(id);
+    }
+
+    /**
+     * 添加/修改枪线内容
+     * @param gunLine 参数
+     * @return 返回结果
+     */
+    @PostMapping("editGunLine")
+    public Map<String, Object> editGunLine(@RequestBody GunLine gunLine){
+        return dictionaryService.editGunLine(gunLine);
+    }
+
 }

+ 7 - 0
src/main/java/com/tld/mapper/DictionaryMapper.java

@@ -59,4 +59,11 @@ public interface DictionaryMapper {
 
     List<Map<String, Object>> getMaterial(Dictionary dictionary);
 
+    List<GunLine> getGunLine(GunLine gunLine);
+
+    void delGunLine(String id);
+
+    void addGunLine(GunLine gunLine);
+
+    void updateGunLine(GunLine gunLine);
 }

+ 39 - 0
src/main/java/com/tld/model/GunLine.java

@@ -0,0 +1,39 @@
+package com.tld.model;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serializable;
+
+@Data
+@Accessors(chain = true)
+public class GunLine implements Serializable {
+    /**
+     * 主键
+     */
+    private String id;
+    /**
+     * 编号
+     */
+    private String code;
+    /**
+     * 名称
+     */
+    private String name;
+    /**
+     * 类型
+     */
+    private String type;
+    /**
+     * 页数
+     */
+    private int page;
+    /**
+     * 条数
+     */
+    private int limit;
+    /**
+     * 操作类型 0新增 1修改
+     */
+    private String editType;
+}

+ 4 - 0
src/main/java/com/tld/model/ReceiveGoods.java

@@ -147,4 +147,8 @@ public class ReceiveGoods implements Serializable {
      * 分录ID
      */
     private String entryNumberId;
+    /**
+     * 接受时间
+     */
+    private String receiveTime;
 }

+ 7 - 0
src/main/java/com/tld/service/DictionaryService.java

@@ -1,6 +1,7 @@
 package com.tld.service;
 
 import com.tld.model.Dictionary;
+import com.tld.model.GunLine;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -25,4 +26,10 @@ public interface DictionaryService {
     void dictionariesExport(Dictionary dictionary, HttpServletResponse response);
 
     Map<String, Object> getMaterial(Dictionary dictionary);
+
+    Map<String, Object> getGunLine(GunLine gunLine);
+
+    Map<String, Object> delGunLine(String id);
+
+    Map<String, Object> editGunLine(GunLine gunLine);
 }

+ 53 - 0
src/main/java/com/tld/service/impl/DictionaryServiceImpl.java

@@ -375,4 +375,57 @@ public class DictionaryServiceImpl implements DictionaryService {
         }
         return map;
     }
+
+    @Override
+    public Map<String, Object> getGunLine(GunLine gunLine) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            PageHelper.startPage(gunLine.getPage(), gunLine.getLimit());
+            PageInfo<GunLine> list = new PageInfo<>(dictionaryMapper.getGunLine(gunLine));
+            map.put("data", list);
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Map<String, Object> delGunLine(String id) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            dictionaryMapper.delGunLine(id);
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+            throw new RuntimeException();
+        }
+        return map;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Map<String, Object> editGunLine(GunLine gunLine) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            //新增
+            if(gunLine.getEditType().equals("0")){
+                dictionaryMapper.addGunLine(gunLine);
+            } else if(gunLine.getEditType().equals("1")){ //修改
+                dictionaryMapper.updateGunLine(gunLine);
+            }
+            map.put("msg", "200");
+        } catch (Exception e){
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+            throw new RuntimeException();
+        }
+        return map;
+    }
 }

+ 1 - 0
src/main/java/com/tld/service/impl/ReceiveGoodsSerivceImpl.java

@@ -145,6 +145,7 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
             e.printStackTrace();
             map.put("status", "0002");
             map.put("msg", "服务器请求异常,请稍后再试");
+            throw new RuntimeException();
         }
         return map;
     }

+ 6 - 7
src/main/resources/mapper/AskGoodsMapper.xml

@@ -691,7 +691,7 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_ask_goods
-        set out_num = ifnull(out_num, 0) + #{num}
+        set out_num = convert(ifnull(out_num, 0) + #{num}, decimal(12,3))
         where material_id = #{materialId}
           and ask_goods_id = #{askGoodsId}
         <if test="entryNumber != null and entryNumber != ''">
@@ -702,8 +702,7 @@
     <select id="getScanNum" resultType="String">
         select if(sum(num) is null, 0, sum(num))
         from tld_ask_goods_vitrual
-        where unique_code = #{uniqueCode}
-          and ask_goods_id = #{askGoodsId}
+        where ask_goods_id = #{askGoodsId}
           and wllb_code = #{wllbCode}
           and entry_number = #{entryNumber}
     </select>
@@ -1741,7 +1740,7 @@
     </update>
     <!-- 往单据上增加数量 -->
     <update id="updateEnquiryOutNum">
-        update tld_enquiry set out_num = (out_num + 0) + #{num} where ask_goods_id = #{askGoodsId} and entry_number = #{entryNumber}
+        update tld_enquiry set out_num = convert((out_num + 0) + #{num}, decimal(12,3)) where ask_goods_id = #{askGoodsId} and entry_number = #{entryNumber}
     </update>
     <!--产成品出库流水修改连翻号-->
     <update id="UpdSerial">
@@ -1774,11 +1773,11 @@
     </insert>
     <!-- 新增错误日志信息 -->
     <insert id="addError">
-        delete from tld_error;
-        insert into tld_error (error_info, data_val, scrq, type, document_id, document_code, num)
+        delete from tld_error where transmission_type = "1";
+        insert into tld_error (error_info, data_val, scrq, type, document_id, document_code, num, transmission_type, url, generate_code, material_id, entry_number)
         values
         <foreach collection="list" index="index" item="item" separator=",">
-            (#{item.errorInfo},#{item.dataVal},now(),#{item.type},#{item.documentId},#{item.documentCode},#{item.num})
+            (#{item.errorInfo},#{item.dataVal},now(),#{item.type},#{item.documentId},#{item.documentCode},#{item.num}, #{item.transmissionType}, #{item.url}, #{item.generateCode}, #{item.materialId}, #{item.entryNumber})
         </foreach>
     </insert>
 </mapper>

+ 44 - 0
src/main/resources/mapper/DictionaryMapper.xml

@@ -351,6 +351,26 @@
             </if>
         </trim>
     </select>
+    <!-- 查询枪线内容 -->
+    <select id="getGunLine" resultType="com.tld.model.GunLine">
+        select
+               id,
+               code,
+               name,
+               type
+        from tld_gun_line
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            <if test="type != null and type != ''">
+                and type = #{type}
+            </if>
+            <if test="code != null and code != ''">
+                and code like CONCAT('%', #{code}, '%')
+            </if>
+            <if test="name != null and name != ''">
+                and name like CONCAT('%', #{name}, '%')
+            </if>
+        </trim>
+    </select>
     <!-- 修改物料字典内容 -->
     <update id="updateMaterial">
         update tld_material
@@ -438,6 +458,22 @@
         </set>
         where id = #{id}
     </update>
+    <!-- 修改枪线内容 -->
+    <update id="updateGunLine">
+        update tld_gun_line
+        <set>
+            <if test="code != null">
+                code = #{code},
+            </if>
+            <if test="name != null">
+                name = #{name},
+            </if>
+            <if test="type != null">
+                type = #{type},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
     <!-- 删除字典内容 -->
     <delete id="deleteDictionary">
         delete
@@ -449,6 +485,10 @@
         delete
         from tld_inventory_gs
     </delete>
+    <!-- 删除枪线内容 -->
+    <delete id="delGunLine">
+        delete from tld_gun_line where id = #{id}
+    </delete>
     <!-- 新增日志 -->
     <insert id="addAccess">
         insert into tld_access(type, data, scrq,access_type) value (#{type},#{data},now(),#{accessType})
@@ -461,4 +501,8 @@
     <insert id="addStorageLocation">
         insert into tld_storage_location(storage_location_code, storage_location_name, warehouse_where) value (#{storageLocationCode},#{storageLocationName},#{warehouseWhere})
     </insert>
+    <!-- 新增枪线内容 -->
+    <insert id="addGunLine">
+        insert into tld_gun_line(code,name,type) value(#{code},#{name},#{type})
+    </insert>
 </mapper>

+ 1 - 1
src/main/resources/mapper/InviteMapper.xml

@@ -93,7 +93,7 @@
     <select id="getScanNum" resultType="String">
         select if(sum(num) is null, 0, sum(num))
         from tld_ask_goods_vitrual
-        where unique_code = #{uniqueCode} and ask_goods_id = #{askGoodsId} and entry_number = #{entryNumber}
+        where ask_goods_id = #{askGoodsId} and entry_number = #{entryNumber}
     </select>
     <!-- 物料库位选择 -->
     <select id="getMaterialCk" resultType="com.tld.model.Inventory">

+ 8 - 6
src/main/resources/mapper/ReceiveGoodsMapper.xml

@@ -22,7 +22,8 @@
         e.company_number as companyNumber,
         e.supplier_id as supplierId,
         p.name as compName,
-        g.name as wbsName
+        g.name as wbsName,
+        a.receive_time
         from tld_receive_goods a
         left join tld_material b on a.material_id = b.tld_id
         left join tld_customer c on a.supplier_id = c.code
@@ -95,9 +96,9 @@
     <insert id="addReceiveGoods">
         insert into tld_receive_goods(order_code, material_id, purchase_num, arrival_num, type, qualified_num,
                                       disqualification_num, wbs, arrival_time, measurement_id, supplier_id,
-                                      entry_number, warehousing_num,source_id,entry_number_id)
+                                      entry_number, warehousing_num,source_id,entry_number_id,receive_time)
         values (#{orderCode}, #{materialId}, #{purchaseNum}, #{arrivalNum}, #{type}, 0+CAST(#{qualifiedNum} as char),
-                #{disqualificationNum}, #{wbs}, #{arrivalTime}, #{measurementId}, #{supplierId}, #{entryNumber}, '0',#{sourceId},#{entryNumberId});
+                #{disqualificationNum}, #{wbs}, #{arrivalTime}, #{measurementId}, #{supplierId}, #{entryNumber}, '0',#{sourceId},#{entryNumberId},now());
     </insert>
     <!-- 新增采购单信息 -->
     <insert id="addReceiveGoodsf">
@@ -155,10 +156,10 @@
     <insert id="addReceiveGoodsLog" keyProperty="id" useGeneratedKeys="true">
         insert into tld_receive_goods_log(order_number, order_code, company_number, supplier_id, arrival_time,
                                           order_type, source_type, move_type, material_id, purchase_num, arrival_num,
-                                          qualified_num, disqualification_num, wbs, measurement_id)
+                                          qualified_num, disqualification_num, wbs, measurement_id,receive_time)
         values (#{orderNumber}, #{orderCode}, #{companyNumber}, #{supplierId}, #{arrivalTime}, #{orderType},
                 #{sourceType}, #{moveType}, #{materialId}, #{purchaseNum}, #{arrivalNum}, 0+CAST(#{qualifiedNum} as char),
-                #{disqualificationNum}, #{wbs}, #{measurementId})
+                #{disqualificationNum}, #{wbs}, #{measurementId},now())
     </insert>
     <!-- 新增采购到料大屏信息 -->
     <insert id="addPurchase">
@@ -399,7 +400,8 @@
             j.name as wbsCode,
             e.company_number as companyNumber,
             e.supplier_id as supplierId,
-            p.name as compName
+            p.name as compName,
+            a.receive_time as receiveTime
         from tld_receive_goods a
         left join tld_material b on a.material_id = b.tld_id
         left join tld_customer c on a.supplier_id = c.code

+ 2 - 1
src/main/resources/mapper/WarehouseTransferMapper.xml

@@ -117,7 +117,8 @@
     <!-- 修改出库数量 -->
     <update id="updateOutNum">
         update tld_warehouse_transfer
-        set out_num = ifnull(out_num, 0) + #{num},type = #{typeVal} where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId} and entry_number = #{entryNumber}
+        set out_num = convert(ifnull(out_num, 0) + #{num}, decimal(12,3)),type = #{typeVal}
+        where material_id = #{materialId} and warehouse_transfer_id = #{askGoodsId} and entry_number = #{entryNumber}
     </update>
     <!-- 查询当天移库单条数 -->
     <select id="getReturnWarehouseTransferCount" resultType="int">

+ 3 - 3
src/main/resources/mapper/WarehousingMapper.xml

@@ -619,7 +619,7 @@
     <!-- 增加半成品/产成品虚拟库位数量 -->
     <update id="updateInventoryNotice">
         update tld_inventory
-        set amount = amount + #{warehousingNum},
+        set amount = convert(amount + #{warehousingNum}, decimal(12,3)),
             totime = now()
         where storage_location_code = #{storageLocationCode}
           and material_id = #{materialId}
@@ -1112,13 +1112,13 @@
     <!-- 其他入库 -->
     <update id="updateInventoryOther">
         update tld_inventory
-        set amount = (amount + 0) + #{amount}
+        set amount = convert((amount + 0) + #{amount}, decimal(12,3))
         where id = #{id}
     </update>
     <!-- 移库虚拟库入库 -->
     <update id="updateVitrualNum">
         update tld_inventory
-        set amount = amount + #{num}
+        set amount = convert(amount + #{num}, decimal(12,3))
         where material_id = #{materialId}
           and storage_location_code = #{storageLocationCode}
     </update>