gaodd 5 anni fa
parent
commit
e37605cad2

+ 2 - 12
src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java

@@ -76,17 +76,7 @@ public class BusinessPlanController {
76 76
     })
77 77
     public PageInfo<BusinessPlan> getList(Integer pageNum, Integer pageSize, Integer userId ,HttpServletRequest request, BusinessPlan businessPlan,String createTimeStart,String createTimeEnd) throws Exception {
78 78
 
79
-    	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
80
-        if(createTimeStart!=null){
81
-        	
82
-            Date startDate = simpleDateFormat.parse(createTimeStart);
83
-            businessPlan.setKszxrq(startDate);
84
-        }
85
-        if(createTimeEnd!=null){
86
-        	Date endDate = simpleDateFormat.parse(createTimeEnd);
87
-        	businessPlan.setJzzxrq(endDate);
88
-        }
89
-        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, userId, businessPlan, "FIELD(audit_state,0,3,1,2,4 ), id desc", null);
79
+        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, userId, businessPlan, "FIELD(audit_state,0,3,1,2,4 ), id desc", null,createTimeStart,createTimeEnd);
90 80
         PageInfo<BusinessPlan> pageInfo = new PageInfo<BusinessPlan>(list);
91 81
         return pageInfo;
92 82
     }
@@ -106,7 +96,7 @@ public class BusinessPlanController {
106 96
     public PageInfo<BusinessPlan> getAuditPassList(Integer pageNum, Integer pageSize, BusinessPlan businessPlan, Integer billType) {
107 97
         // 可以查询所有人通过的计划,必须是应用的.
108 98
         businessPlan.setAuditState(AuditType.AGREE.getAuditCode());
109
-        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, null, businessPlan, " agree_time desc", billType);
99
+        List<BusinessPlan> list = businessPlanService.queryByExample(pageNum, pageSize, null, businessPlan, " agree_time desc", billType,null,null);
110 100
         double sumAmount = 0;
111 101
         if(list.size()>0){
112 102
         	for (int i = 0; i < list.size(); i++) {

+ 2 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.java

@@ -55,4 +55,6 @@ public interface BusinessDeliveryStorageNoticeMapper {
55 55
 
56 56
 	//根据通知单状态查询数据--主表
57 57
     List<Map<String,Object>> uploadNoticeData(Map<String,Object> map);
58
+
59
+	List<Map<String, Object>> getNoticeData(Map<String, Object> mapCondition1);
58 60
 }

+ 36 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.xml

@@ -944,4 +944,40 @@
944 944
       </foreach>
945 945
     </if>
946 946
   </select>
947
+  
948
+  <select id="getNoticeData" parameterType="java.util.Map" resultType="java.util.HashMap">
949
+    SELECT
950
+        notice.*,
951
+        customer.address, <!-- 地址 -->
952
+        customer.identification,<!-- 身份证号 -->
953
+        customer.mobile,<!-- 手机号 -->
954
+        customer.social_credit_code identification,<!-- 社会信用代码 -->
955
+        customer.enterprise_phone mobile,<!-- 企业电话 -->
956
+        customer.account_number yhkh,
957
+		customer.bank_name khyhmc,
958
+		customer.account_name khyhhb,
959
+		customer.administrative_division skr,<!-- 收款人 -->
960
+		customer.business_regist_num jhkh, <!-- 计划客户 -->
961
+		enum.enumName planTypeName,
962
+        plan.execute_type planTypeId
963
+    FROM
964
+        business_delivery_storage_notice notice
965
+    left join business_customer customer on customer.id=notice.customer_bid
966
+    left join business_plan plan on notice.plan_bid = plan.id
967
+    left join basic_enum enum on  plan.execute_type = enum.enumId
968
+    WHERE ((notice.audit_state=2) or (notice.bill_type=2)) and 1 = 1 <!-- 审批通过的,中转通知单没有审批 -->
969
+    AND notice.in_Application in (1,3,4)
970
+    <if test="orgId != null" ><!--用house_id 区分是哪个库的 house_id是代储库 orgId 是主库 -->
971
+      AND notice.house_id = #{orgId,jdbcType=INTEGER}
972
+    </if>
973
+    <if test="ids != null" >
974
+      AND notice.id in
975
+      <foreach collection="ids" item="listItem" open="(" close=")" separator="," >
976
+        #{listItem}
977
+      </foreach>
978
+    </if>
979
+    <if test="ids == null" >
980
+      AND notice.id is null
981
+    </if>
982
+  </select>
947 983
 </mapper>

+ 1 - 1
src/main/java/com/chinaitop/depot/business/service/BusinessPlanService.java

@@ -80,7 +80,7 @@ public interface BusinessPlanService {
80 80
      * @return
81 81
      */
82 82
     List<BusinessPlan> queryByExample(Integer pageNum, Integer pageSize,
83
-            Integer userId, BusinessPlan businessPlan, String order, Integer billType);
83
+            Integer userId, BusinessPlan businessPlan, String order, Integer billType,String createTimeStart,String createTimeEnd);
84 84
 
85 85
     
86 86
     /**

+ 19 - 1
src/main/java/com/chinaitop/depot/business/service/impl/BusinessPlanServiceImpl.java

@@ -729,7 +729,7 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
729 729
 
730 730
     @Override
731 731
     public List<BusinessPlan> queryByExample(Integer pageNum, Integer pageSize,
732
-            Integer userId, BusinessPlan businessPlan, String order, Integer billType) {
732
+            Integer userId, BusinessPlan businessPlan, String order, Integer billType,String createTimeStart,String createTimeEnd) {
733 733
         BusinessPlanExample example = new BusinessPlanExample();
734 734
         Criteria createCriteria = example.createCriteria();
735 735
         if (userId != null) {
@@ -774,6 +774,24 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
774 774
         	createCriteria.andJzzxrqLessThanOrEqualTo(businessPlan.getJzzxrq());
775 775
         }
776 776
         
777
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
778
+        try {
779
+        	if(createTimeStart!=null && createTimeStart!=""){
780
+        		createTimeStart = createTimeStart+" "+"00:00:00";
781
+        		Date startDate = simpleDateFormat.parse(createTimeStart);
782
+        		createCriteria.andCreateTimeGreaterThanOrEqualTo(startDate);
783
+        	}
784
+        	if(createTimeEnd!=null && createTimeEnd!=""){
785
+        		createTimeEnd = createTimeEnd +" "+ "23:59:59";
786
+        		Date endtDate = simpleDateFormat.parse(createTimeEnd);
787
+        		createCriteria.andCreateTimeLessThanOrEqualTo(endtDate);
788
+        	}
789
+        	
790
+		} catch (ParseException e) {
791
+			// TODO Auto-generated catch block
792
+			e.printStackTrace();
793
+		}
794
+        
777 795
         //储备粮计划
778 796
         if(businessPlan.getAttributeType() != null ){
779 797
         	createCriteria.andAttributeTypeEqualTo(businessPlan.getAttributeType());

+ 9 - 0
src/main/java/com/chinaitop/depot/pushs/service/impl/PushServiceImpl.java

@@ -91,10 +91,19 @@ public class PushServiceImpl implements PushsService{
91 91
 			List<BusinessStoreWareDetail> json = businessStoreWareDetailMapper.selectByExample(businessStoreWareDetailExample);
92 92
 			mains.put("fromData",json);//从表数据以json形式插入主表数据
93 93
 		}
94
+		
95
+		Map<String,Object> mapCondition1 = new HashMap<String, Object>();
96
+		mapCondition1.put("orgId",orgId);
97
+		if(ParameterUtil.isnotnull(ids)) {
98
+			List<String> idsList = Arrays.asList(ids.split(","));
99
+			mapCondition1.put("ids", idsList);
100
+		}
101
+		List<Map<String,Object>> mainList1 =businessDeliveryStorageNoticeMapper.getNoticeData(mapCondition1);
94 102
 
95 103
         Map<String,Object> mapData = new HashMap<String, Object>();
96 104
 		mapData.put("status", "success");
97 105
 		mapData.put("mainData", mainList);
106
+		mapData.put("mainData1", mainList1);
98 107
 		return JSON.toJSONString(ResponseEntity.ok(mapData));
99 108
 	}
100 109