Browse Source

问题修改

zhs 2 years ago
parent
commit
8e9ac1cd10

+ 2 - 2
src/main/java/com/tld/config/MyRedissonConfig.java

@@ -16,8 +16,8 @@ public class MyRedissonConfig {
     public RedissonClient redissonClient(){
         // 创建配置 指定redis地址及节点信息
         Config config = new Config();
-//        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
-        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
+        config.useSingleServer().setAddress("redis://8.142.144.205:6379").setPassword("#09SilverB");
+//        config.useSingleServer().setAddress("redis://10.2.111.91:6379").setPassword("#09SilverB");
         //redis集群使用
 //        config.useClusterServers().addNodeAddress("redis://8.142.144.205:6379");
         // 根据config创建出RedissonClient实例

+ 20 - 0
src/main/java/com/tld/controller/QueryListController.java

@@ -366,5 +366,25 @@ public class QueryListController {
         return queryListService.getDepartment(user);
     }
 
+    /**
+     * 查询指定交货单内容
+     * @param user 参数
+     * @return 返回结果
+     */
+    @GetMapping("getAskGoodsInfo")
+    public Map<String, Object> getAskGoodsInfo(User user){
+        return queryListService.getAskGoodsInfo(user);
+    }
+
+    /**
+     * 查询指定交货单内容
+     * @param user 参数
+     * @return 返回结果
+     */
+    @GetMapping("getInviteInfo")
+    public Map<String, Object> getInviteInfo(User user){
+        return queryListService.getInviteInfo(user);
+    }
+
 }
 

+ 10 - 1
src/main/java/com/tld/controller/WarehousingController.java

@@ -120,6 +120,16 @@ public class WarehousingController {
         return warehousingService.getNotice(notice);
     }
 
+    /**
+     * 报工单导出
+     * @param notice
+     * @param response
+     */
+    @GetMapping("exportNotice")
+    public void exportNotice(Notice notice, HttpServletResponse response){
+        warehousingService.exportNotice(notice, response);
+    }
+
     /**
      * 半成品材料入库
      * @param notice 参数
@@ -150,7 +160,6 @@ public class WarehousingController {
         return warehousingService.delInventoryNotice(id,request);
     }
 
-
     /**
      * 查询半成品流水
      * @param notice 参数

+ 4 - 0
src/main/java/com/tld/mapper/QueryListMapper.java

@@ -121,4 +121,8 @@ public interface QueryListMapper {
     List<Map<String, Object>> getPlannedDepartment(User user);
 
     List<Map<String, Object>> getInviteDepartment(User user);
+
+    List<AskGoods> getAskGoodsInfo(User user);
+
+    List<AskGoods> getInviteInfo(User user);
 }

+ 5 - 0
src/main/java/com/tld/mapper/WarehousingMapper.java

@@ -136,4 +136,9 @@ public interface WarehousingMapper {
     Map<String, Object> getOtherShipments(@Param("id") String id);
 
     void delOtherShipments(@Param("id") String id);
+
+    List<StorageLocation> getRecommendTwo(String type);
+
+    List<Map<String, Object>> exportNotice(Notice notice);
+
 }

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

@@ -147,4 +147,8 @@ public class Delivery implements Serializable {
      * 连翻号
      */
     private String serial;
+    /**
+     * 项目名称
+     */
+    private String projectName;
 }

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

@@ -65,4 +65,5 @@ public interface AskGoodsService {
     Map<String, Object> getRemovalHalfUpdSerial(AskGoods askGoods);
 
     void test03();
+
 }

+ 4 - 0
src/main/java/com/tld/service/QueryListService.java

@@ -75,4 +75,8 @@ public interface QueryListService {
     Map<String, Object> getDepartment(User user);
 
     Map<String, Object> getTaskNum(User user);
+
+    Map<String, Object> getAskGoodsInfo(User user);
+
+    Map<String, Object> getInviteInfo(User user);
 }

+ 2 - 0
src/main/java/com/tld/service/WarehousingService.java

@@ -58,4 +58,6 @@ public interface WarehousingService {
     Map<String, Object> delOtherShipments(String id, HttpServletRequest request);
 
     Map<String, Object> addDisposeNotice(Notice notice);
+
+    void exportNotice(Notice notice, HttpServletResponse response);
 }

+ 29 - 29
src/main/java/com/tld/service/impl/DeliveryServiceImpl.java

@@ -200,35 +200,35 @@ public class DeliveryServiceImpl implements DeliveryService {
                 }
                 askGoodsMapper.deleteVirtual(askGoods.getId());//删除已出虚拟表库存
 
-                if(materialClass.getPartType().equals("产成品")){
-                    //查询设备绑定的
-                    List<Map<String, Object>> list1 = deliveryMapper.getEquipmentSoftware(materialClass.getCode());
-                    //如果设备绑定软件基础信息有数据则继续往下执行
-                    if(list.size() != 0){
-                        Map<String, Object> map1 = list1.get(0);
-                        Delivery delivery1 = new Delivery()
-                                .setDeliveryId(deliveryId)
-                                .setMaterialId(map1.get("materialId").toString())
-                                .setWbs(list.get(0).getWbs());
-                        //查询软件类销售出库单据
-                        List<Delivery> list2 = deliveryMapper.getDelivery(delivery1);
-                        //如果单据存在  则继续往下执行
-                        if(list2.size() != 0){
-                            //修改软件类单据出库数量
-                            deliveryMapper.updateDelivery(map1.get("materialId").toString(), askGoods.getNum(), deliveryId, list2.get(0).getEntryNumber());
-                            //存入返回GS信息表内
-                            ReturRemoval returRemoval = new ReturRemoval()
-                                    .setMaterialId(map1.get("materialId").toString())
-                                    .setDocumentId(deliveryId)
-                                    .setWbs(list.get(0).getWbs())
-                                    .setNum(askGoods.getNum())
-                                    .setEntryNumber(list.get(0).getEntryNumber())
-                                    .setDocumentPointsId(list.get(0).getId())
-                                    .setStorageLocationCode(askGoods.getStorageLocationCode());
-                            askGoodsMapper.addReturnGsRemoval(returRemoval);//新增返回gs数据子表信息
-                        }
-                    }
-                }
+//                if(materialClass.getPartType().equals("产成品")){
+//                    //查询设备绑定的
+//                    List<Map<String, Object>> list1 = deliveryMapper.getEquipmentSoftware(materialClass.getCode());
+//                    //如果设备绑定软件基础信息有数据则继续往下执行
+//                    if(list.size() != 0){
+//                        Map<String, Object> map1 = list1.get(0);
+//                        Delivery delivery1 = new Delivery()
+//                                .setDeliveryId(deliveryId)
+//                                .setMaterialId(map1.get("materialId").toString())
+//                                .setWbs(list.get(0).getWbs());
+//                        //查询软件类销售出库单据
+//                        List<Delivery> list2 = deliveryMapper.getDelivery(delivery1);
+//                        //如果单据存在  则继续往下执行
+//                        if(list2.size() != 0){
+//                            //修改软件类单据出库数量
+//                            deliveryMapper.updateDelivery(map1.get("materialId").toString(), askGoods.getNum(), deliveryId, list2.get(0).getEntryNumber());
+//                            //存入返回GS信息表内
+//                            ReturRemoval returRemoval = new ReturRemoval()
+//                                    .setMaterialId(map1.get("materialId").toString())
+//                                    .setDocumentId(deliveryId)
+//                                    .setWbs(list.get(0).getWbs())
+//                                    .setNum(askGoods.getNum())
+//                                    .setEntryNumber(list.get(0).getEntryNumber())
+//                                    .setDocumentPointsId(list.get(0).getId())
+//                                    .setStorageLocationCode(askGoods.getStorageLocationCode());
+//                            askGoodsMapper.addReturnGsRemoval(returRemoval);//新增返回gs数据子表信息
+//                        }
+//                    }
+//                }
                 //存入返回GS信息表内
                 ReturRemoval returRemoval = new ReturRemoval()
                         .setMaterialId(materialClass.getTldId())

+ 39 - 6
src/main/java/com/tld/service/impl/QueryListServiceImpl.java

@@ -929,6 +929,38 @@ public class QueryListServiceImpl implements QueryListService {
         return map;
     }
 
+    @Override
+    public Map<String, Object> getAskGoodsInfo(User user) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            PageHelper.startPage(user.getPage(), user.getLimit());
+            PageInfo<AskGoods> list = new PageInfo<>(queryListMapper.getAskGoodsInfo(user));
+            map.put("msg", "200");
+            map.put("data", list);
+        }catch (Exception e) {
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
+    @Override
+    public Map<String, Object> getInviteInfo(User user) {
+        Map<String, Object> map = new HashMap<>();
+        try{
+            PageHelper.startPage(user.getPage(), user.getLimit());
+            PageInfo<AskGoods> list = new PageInfo<>(queryListMapper.getInviteInfo(user));
+            map.put("msg", "200");
+            map.put("data", list);
+        }catch (Exception e) {
+            e.printStackTrace();
+            map.put("msg", "500");
+            map.put("errMsg", "服务器请求异常,请稍后再试");
+        }
+        return map;
+    }
+
     /**
      * @Description: 查询领料日期
      * @Param: User
@@ -940,11 +972,12 @@ public class QueryListServiceImpl implements QueryListService {
     public Map<String, Object> getPlannedDelivery(User user) {
         Map<String, Object> map = new HashMap<>();
         try{
-            List<String> list = null ;
+            PageInfo<String> list = null ;
             if (user.getType().equals("计划出库")){
-                list = queryListMapper.getPlannedDelivery(user);//计划出库
+                PageHelper.startPage(user.getPage(), user.getLimit());
+                list = new PageInfo<>(queryListMapper.getPlannedDelivery(user));//计划出库
             }else {
-                list = queryListMapper.getInviteDelivery(user);//邀请出库
+                list = new PageInfo<>(queryListMapper.getInviteDelivery(user));//邀请出库
             }
             map.put("data", list);
             map.put("msg", "200");
@@ -968,11 +1001,11 @@ public class QueryListServiceImpl implements QueryListService {
     public Map<String, Object> getDepartment(User user) {
         Map<String, Object> map = new HashMap<>();
         try{
-            List<Map<String,Object>> list = null ;
+            PageInfo<Map<String,Object>> list = null ;
             if (user.getType().equals("计划出库")){
-                list = queryListMapper.getPlannedDepartment(user);//计划出库
+                list = new PageInfo<>(queryListMapper.getPlannedDepartment(user));//计划出库
             }else {
-                list = queryListMapper.getInviteDepartment(user);//邀请出库
+                list = new PageInfo<>(queryListMapper.getInviteDepartment(user));//邀请出库
             }
             map.put("data", list);
             map.put("msg", "200");

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

@@ -100,10 +100,10 @@ public class ReceiveGoodsSerivceImpl implements ReceiveGoodsSerivce {
                    rg.setWbs(wbs);
                    rg.setMeasurementId((String) element.get("measUnitId"));
 
-                   rg.setPurchaseNum(element.get("purchaseCount").toString().split("\\.")[0]);
-                   rg.setArrivalNum((element.get("receiveCount").toString().split("\\.")[0]));
-                   rg.setQualifiedNum(element.get("curOkCount").toString().split("\\.")[0]);
-                   rg.setDisqualificationNum(element.get("curNgCount").toString().split("\\.")[0]);
+                   rg.setPurchaseNum(element.get("purchaseCount").toString());
+                   rg.setArrivalNum((element.get("receiveCount").toString()));
+                   rg.setQualifiedNum(element.get("curOkCount").toString());
+                   rg.setDisqualificationNum(element.get("curNgCount").toString());
 
 
                    receiveGoodsList.add(rg);

+ 57 - 6
src/main/java/com/tld/service/impl/WarehousingServiceImpl.java

@@ -68,12 +68,14 @@ public class WarehousingServiceImpl implements WarehousingService {
                 return map;
             }
             if(materialClass.getPartType().equals("半成品")){
-                map.put("msg", "500");
-                map.put("errMsg", "此物料是" + materialClass.getPartType());
+                List<StorageLocation> listTwo = warehousingMapper.getRecommendTwo("1");
+                map.put("data", listTwo);
+                map.put("listString", new HashMap<>());//返回库位剩余数量
                 return map;
             }
             if (materialClass.getPartType().equals("产成品")) {
-                map.put("data", new ArrayList<>());
+                List<StorageLocation> listTwo = warehousingMapper.getRecommendTwo("2");
+                map.put("data", listTwo);
                 map.put("listString", new HashMap<>());//返回库位剩余数量
                 return map;
             }
@@ -176,6 +178,8 @@ public class WarehousingServiceImpl implements WarehousingService {
         try {
             //入库信息
             List<WarehousingVirtual> list = new LinkedList<>();
+            //新入库逻辑
+            List<WarehousingVirtual> list1 = new LinkedList<>();
             //返回采购单id
             StringBuilder stringBuilder = new StringBuilder();
             //查询入库所需要的信息
@@ -194,7 +198,7 @@ public class WarehousingServiceImpl implements WarehousingService {
                 warehousingVirtual.setMaterialId(warehousingVirtual1.getMaterialId());
                 warehousingVirtual.setPurchaseNum(receiveGoods1.getPurchaseNum());
                 list.add(warehousingVirtual);
-
+                list1.add(warehousingVirtual);
                 if(Double.parseDouble(warehousingVirtual.getNum()) <= 0){
                     break;
                 }
@@ -219,10 +223,32 @@ public class WarehousingServiceImpl implements WarehousingService {
                 if(!stringBuilder.toString().contains(receiveGoods1.getOrderNumber() + ",")){
                     stringBuilder.append(receiveGoods1.getOrderNumber() + ",");
                 }
+                //半成品扫码入库逻辑
+                //查询物料信息
+                MaterialClass material = warehousingMapper.getMaterial(new Notice().setMaterialCode(warehousingVirtual.getWllbCode()));
+                if(material.getPartType().equals("半成品")) {
+                    Notice notice = new Notice()
+                            .setMaterialId(receiveGoods1.getMaterialId())
+                            .setCompanyNumber(warehousingVirtual.getAccountSleeve())
+                            .setStorageLocationCode(warehousingVirtual.getStorageLocationCode())
+                            .setWbs(receiveGoods1.getWbs())
+                            .setWarehousingNum(warehousingVirtual.getNum())
+                            .setProducBatch(warehousingVirtual.getProducDate())
+                            .setWllbCode(material.getWllbCode())
+                            .setWllbClass(material.getWllbClass());
+                    if (warehousingMapper.getInventoryNotice(notice) != 0) {
+                        warehousingMapper.updateInventoryNotice(notice);
+                    } else {
+                        warehousingMapper.addInventoryNotice(notice);
+                    }
+                } else {
+                    warehousingMapper.addInventory(list1);//库存
+                    list1.clear();
+                }
             }
             //入库
             warehousingMapper.addStorage(list);//入库流水
-            warehousingMapper.addInventory(list);//库存
+//            warehousingMapper.addInventory(list);//库存
             warehousingMapper.delVirtual(uniqueCode);//删除临时表数据
             map.put("data", stringBuilder.toString());
             map.put("msg", "200");
@@ -387,6 +413,32 @@ public class WarehousingServiceImpl implements WarehousingService {
         return map;
     }
 
+    @Override
+    public void exportNotice(Notice notice, HttpServletResponse response) {
+        try {
+            //导出数据汇总
+            List<List<Object>> sheetDataList = new ArrayList<>();
+            //表头数据
+            List<Object> head = Arrays.asList("生产订单号", "报工单号", "物料编号", "物料名称", "数量", "已入库数量", "报工时间", "分录号", "所属公司", "公司编号", "WBS", "移动类型", "来源类型", "状态");
+            //查询数据
+            List<Map<String, Object>> list = new ArrayList<>(warehousingMapper.exportNotice(notice));
+            sheetDataList.add(head);
+            for (Map<String, Object> userMap : list) {
+                List<Object> listSheet = new ArrayList<>();
+                for (String key : userMap.keySet()) {
+                    listSheet.add(userMap.get(key));
+                }
+                sheetDataList.add(listSheet);
+            }
+            //当前时间
+            Date time = new Date();
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMddHHmmss");
+            ExcelUtils.export(response, "入库流水数据导出" + sdf.format(time), sheetDataList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Map<String, Object> addInventoryNotice(Notice notice) {
@@ -1161,7 +1213,6 @@ public class WarehousingServiceImpl implements WarehousingService {
         return map;
     }
 
-
     /**
      * 入库单生成
      *

+ 1 - 0
src/main/resources/mapper/AskGoodsMapper.xml

@@ -96,6 +96,7 @@
         WHERE (a.num + 0) <![CDATA[>]]> (
             IFNULL(a.out_num, 0) + 0)
           and e.part_type != '半成品' and e.part_type != '产成品'
+          and a.ask_goods_id = #{askGoodsId} and e.code in (select material_id from tld_user_material where user_id = #{userId})
     </select>
     <!-- 物料库位选择 -->
     <select id="getMaterialCk" resultType="com.tld.model.Inventory">

+ 1 - 0
src/main/resources/mapper/DeliveryMapper.xml

@@ -22,6 +22,7 @@
             b.delivery_type,
             b.source_type,
             b.move_type,
+            b.project_name,
             c.name as materialName,
             c.code as materialCode,
             c.part_type as partType

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

@@ -80,8 +80,8 @@
             LEFT JOIN tld_department c ON b.department = c.code
             JOIN tld_material e ON a.material_id = e.tld_id
         WHERE
-                ( a.num + 0 ) <![CDATA[>]]> (
-                IFNULL( a.out_num, 0 ) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
+            ( a.num + 0 ) <![CDATA[>]]> (IFNULL( a.out_num, 0 ) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
+            and a.ask_goods_id = #{askGoodsId} and e.code in (select material_id from tld_user_material where user_id = #{userId})
     </select>
     <!-- 查询指定pda 指定物料扫描总数 -->
     <select id="getScanNum" resultType="String">
@@ -376,9 +376,9 @@
     </insert>
     <!-- 交货单接口 -->
     <insert id="addDeliverys">
-        insert into tld_delivery_f (delivery_id, delivery_code, company_number, customer_code, bills_time, delivery_type,source_type,move_type)
+        insert into tld_delivery_f (delivery_id, delivery_code, company_number, customer_code, bills_time, delivery_type,source_type,move_type,project_name)
         values
-            (#{deliveryOrderId},#{deliveryOrderNo},#{companyNumber},#{customerNo},#{docDate},#{deloveryGoodsType},#{sourceType},#{moveType})
+            (#{deliveryOrderId},#{deliveryOrderNo},#{companyNumber},#{customerNo},#{docDate},#{deloveryGoodsType},#{sourceType},#{moveType},#{projectName})
         ;
         insert into tld_delivery ( delivery_id, entry_number, material_id, wbs, measurement_id, gs_delivery_num, gs_cancel_num, out_num,status )
         values

+ 45 - 28
src/main/resources/mapper/QueryListMappeer.xml

@@ -1299,8 +1299,7 @@
         FROM
             tld_notice a
             join tld_material b on a.material_id = b.tld_id
-        where b.part_type = "半成品" and (warehousing_num + 0) <![CDATA[<]]> (
-        a.num + 0) and b.code in (select material_id from tld_user_material where user_id = #{userId})
+        where b.part_type = "半成品" and a.type = "0" and b.code in (select material_id from tld_user_material where user_id = #{userId})
     </select>
     <!-- 查询产成品入库任务数量 -->
     <select id="getChanChenPin" resultType="int">
@@ -1460,12 +1459,11 @@
         select
             b.sqrq
         from tld_ask_goods a
-        left join tld_ask_goods_f b on a.ask_goods_id = b.ask_goods_id
-        where a.material_id in(
-            select b.tld_id from tld_user_material a
-            left join tld_material b on a.material_id = b.code
-            where a.user_id = #{userId})
-        and a.type = '0'
+        join tld_ask_goods_f b on a.ask_goods_id = b.ask_goods_id
+        join tld_material e on a.material_id = e.tld_id
+        where e.code in ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          and (a.num + 0) <![CDATA[>]]> (
+            IFNULL(a.out_num, 0) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
         group by b.sqrq
         order by b.sqrq desc
     </select>
@@ -1474,12 +1472,11 @@
         select
             b.sqrq
         from tld_invite a
-                 left join tld_invite_f b on a.ask_goods_id = b.ask_goods_id
-        where a.material_id in(
-            select b.tld_id from tld_user_material a
-                                     left join tld_material b on a.material_id = b.code
-            where a.user_id = #{userId})
-          and a.ask_goods_type = '0'
+        join tld_invite_f b on a.ask_goods_id = b.ask_goods_id
+        join tld_material e on a.material_id = e.tld_id
+        where e.code in ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          and (a.num + 0) <![CDATA[>]]> (
+            IFNULL(a.out_num, 0) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
         group by b.sqrq
         order by b.sqrq desc
     </select>
@@ -1489,13 +1486,12 @@
             c.name,
             c.code
         from tld_ask_goods a
-        left join tld_ask_goods_f b on a.ask_goods_id = b.ask_goods_id
-        left join tld_department c on b.department = c.code
-        where a.material_id in(
-            select b.tld_id from tld_user_material a
-                                     left join tld_material b on a.material_id = b.code
-            where a.user_id = #{userId})
-          and a.type = '0'
+        join tld_ask_goods_f b on a.ask_goods_id = b.ask_goods_id
+        join tld_department c on b.department = c.code
+        join tld_material e on a.material_id = e.tld_id
+        where e.code IN ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          and (a.num + 0) <![CDATA[>]]> (
+            IFNULL(a.out_num, 0) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
           and b.sqrq = #{sqrq}
         group by c.name,c.code
     </select>
@@ -1505,14 +1501,35 @@
             c.name,
             c.code
         from tld_invite a
-        left join tld_invite_f b on a.ask_goods_id = b.ask_goods_id
-        left join tld_department c on b.department = c.code
-        where a.material_id in(
-            select b.tld_id from tld_user_material a
-            left join tld_material b on a.material_id = b.code
-            where a.user_id = #{userId})
-          and a.ask_goods_type = '0'
+        join tld_invite_f b on a.ask_goods_id = b.ask_goods_id
+        join tld_department c on b.department = c.code
+        join tld_material e on a.material_id = e.tld_id
+        where e.code IN ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          and (a.num + 0) <![CDATA[>]]> (
+            IFNULL(a.out_num, 0) + 0) and e.part_type != '半成品' and e.part_type != '产成品'
           and b.sqrq = #{sqrq}
         group by c.name,c.code
     </select>
+    <!-- 查询指定参数的要货单 -->
+    <select id="getAskGoodsInfo" resultType="com.tld.model.AskGoods">
+        SELECT DISTINCT b.ask_goods_id as id,b.ask_goods_code as code
+        FROM tld_ask_goods a
+        JOIN tld_ask_goods_f b ON a.ask_goods_id = b.ask_goods_id
+        JOIN tld_material e ON a.material_id = e.tld_id
+        WHERE
+            b.sqrq = #{sqrq} AND b.department = #{department}
+          AND e.code IN ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          AND e.part_type != '半成品' AND e.part_type != '产成品' AND (a.num + 0) <![CDATA[>]]> (IFNULL(a.out_num, 0) + 0)
+    </select>
+    <!-- 查询指定参数的要货单 -->
+    <select id="getInviteInfo" resultType="com.tld.model.AskGoods">
+        SELECT DISTINCT b.ask_goods_id as id,b.ask_goods_code as code
+        FROM tld_invite a
+        JOIN tld_invite_f b ON a.ask_goods_id = b.ask_goods_id
+        JOIN tld_material e ON a.material_id = e.tld_id
+        WHERE
+            b.sqrq = #{sqrq} AND b.department = #{department}
+          AND e.code IN ( SELECT material_id FROM tld_user_material WHERE user_id = #{userId} )
+          AND e.part_type != '半成品' AND e.part_type != '产成品' AND (a.num + 0) <![CDATA[>]]> (IFNULL(a.out_num, 0) + 0)
+    </select>
 </mapper>

+ 85 - 0
src/main/resources/mapper/WarehousingMapper.xml

@@ -55,6 +55,20 @@
         WHERE #{storageLocationCode} like CONCAT('%', CONCAT(storage_location_code, ','), '%')
           and warehouse_where != '5000'
     </select>
+    <!-- 查询 -->
+    <select id="getRecommendTwo" resultType="com.tld.model.StorageLocation">
+        SELECT a.id,
+               a.storage_location_code,
+               a.storage_location_name,
+               a.warehouse_where,
+               a.storage_location_type,
+               a.storage_location_capacity,
+               a.is_not_disable,
+               a.create_time
+        FROM tld_storage_location a
+        JOIN tld_warehouse b ON a.warehouse_where = b.tld_id
+        where b.warehouse_type = #{type}
+    </select>
     <!-- 查询是否是混合物料 -->
     <select id="getIsNotSisable" resultType="String">
         select
@@ -436,6 +450,77 @@
         join tld_notice_f b on a.notice_id = b.notice_id
         join tld_material c on a.material_id = c.tld_id
         join tld_company e on b.company_number = e.code
+        <trim prefix="WHERE" prefixOverrides="and |or">
+            and c.code in (select material_id from tld_user_material where user_id = #{userId})
+            <if test="type != null and type != ''">
+                and a.type = #{type}
+            </if>
+            <if test="noticeId != null and noticeId != ''">
+                and a.notice_id like CONCAT(CONCAT('%', #{noticeId}), '%')
+            </if>
+            <if test="entryNumber != null and entryNumber != ''">
+                and a.entry_number like CONCAT(CONCAT('%', #{entryNumber}), '%')
+            </if>
+            <if test="wllbCode != null and wllbCode != ''">
+                and c.code like CONCAT(CONCAT('%', #{wllbCode}), '%')
+            </if>
+            <if test="materialName != null and materialName != ''">
+                and c.name like CONCAT(CONCAT('%', #{materialName}), '%')
+            </if>
+            <if test="startTime != null and startTime != ''">
+                and b.notice_time <![CDATA[>=]]> #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''">
+                and b.notice_time <![CDATA[<=]]> #{endTime}
+            </if>
+            <if test="partType != null and partType == '产成品'.toString()">
+                and c.part_type = #{partType}
+            </if>
+            <if test="partType != null and partType == '半成品'.toString()">
+                and (c.part_type ='半成品' or c.part_type ='原材料')
+            </if>
+            <if test="companyNumber != null and companyNumber != ''">
+                and b.company_number = #{companyNumber}
+            </if>
+            <if test="productionCode != null and productionCode != ''">
+                and a.production_code like CONCAT(CONCAT('%', #{productionCode}), '%')
+            </if>
+            <if test="wbs != null and wbs != ''">
+                and a.wbs like CONCAT(CONCAT('%', #{wbs}), '%')
+            </if>
+            <if test="moveType != null and moveType != ''">
+                and b.move_type like CONCAT(CONCAT('%', #{moveType}), '%')
+            </if>
+            <if test="sourceType != null and sourceType != ''">
+                and b.source_type like CONCAT(CONCAT('%', #{sourceType}), '%')
+            </if>
+            <if test="noticeCode != null and noticeCode != ''">
+                and b.notice_code like CONCAT(CONCAT('%', #{noticeCode}), '%')
+            </if>
+        </trim>
+        order by a.id desc
+    </select>
+    <!-- 导出报工单 -->
+    <select id="exportNotice" resultType="java.util.LinkedHashMap">
+        select
+            a.production_code,
+            b.notice_code as noticeCode,
+            c.code as wllbCode,
+            c.name as materialName,
+            a.num,
+            a.warehousing_num,
+            b.notice_time as noticeTime,
+            a.entry_number,
+            e.name as companyName,
+            b.company_number,
+            if(a.wbs = "", null, a.wbs) as wbs,
+            b.source_type as sourceType,
+            b.move_type as moveType,
+            (case a.type when "0" then "未入库" when "1" then "已入库" end) as type
+        from tld_notice a
+        join tld_notice_f b on a.notice_id = b.notice_id
+        join tld_material c on a.material_id = c.tld_id
+        join tld_company e on b.company_number = e.code
         <trim prefix="WHERE" prefixOverrides="and |or">
             <if test="type != null and type != ''">
                 and a.type = #{type}