lvzhikai 4 роки тому
батько
коміт
2748bc0d56
16 змінених файлів з 144 додано та 52 видалено
  1. 17 28
      src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java
  2. 18 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java
  3. 18 0
      src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java
  4. 2 1
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.java
  5. 12 12
      src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.xml
  6. 2 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.java
  7. 15 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessDeliveryStorageNoticeMapper.xml
  8. 2 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.java
  9. 13 0
      src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.xml
  10. 1 1
      src/main/java/com/chinaitop/depot/business/service/BusinessContractService.java
  11. 2 0
      src/main/java/com/chinaitop/depot/business/service/BusinessDeliveryStorageNoticeService.java
  12. 2 0
      src/main/java/com/chinaitop/depot/business/service/BusinessPlanService.java
  13. 10 5
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractServiceImpl.java
  14. 12 1
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessDeliveryStorageNoticeServiceImpl.java
  15. 12 0
      src/main/java/com/chinaitop/depot/business/service/impl/BusinessPlanServiceImpl.java
  16. 6 4
      src/main/java/com/chinaitop/depot/pushs/service/impl/PushServiceImpl.java

+ 17 - 28
src/main/java/com/chinaitop/depot/business/controller/BusinessContractController.java

@@ -966,32 +966,21 @@ public class BusinessContractController {
966 966
         PageInfo<BusinessContract> pageInfo = new PageInfo<BusinessContract>(list);
967 967
         return pageInfo;
968 968
     }
969
-    
970
-    
971
-    
972
-   /* //合同信息同步
973
-  	@RequestMapping("/contractInfoSynchronization")
974
-  	public void contractInfoSynchronization() {
975
-  		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
976
-  		List list = DataSynchronization.queryContractInfo();
977
-  		List<BusinessContract> contractList = contractService.getAllContractInfo();
978
-  		for(BusinessContract contractInfo:contractList) {
979
-  			int num = 0;
980
-  			for(int i=0;i<list.size();i++) {
981
-  				Map<String,Object> map = (Map<String,Object>)list.get(i);
982
-  				String kdbm = ObjectUtils.toString(map.get("kdbm"),"");//库点编码
983
-  				String refreshTime = ObjectUtils.toString(map.get("refreshTime"),"");
984
-  				if(kdbm.equals(ObjectUtils.toString(orgInfo.getOrgId(),""))) {
985
-  					if(!refreshTime.equals(format.format(orgInfo.getUpdateTime()))) {
986
-  						DataSynchronization.orgInfoSynchronizationUpdate(map, orgInfo);
987
-  					}
988
-  					break;
989
-  				}else if(num == (list.size()-1)){
990
-  					DataSynchronization.orgInfoSynchronizationInsert(orgInfo);
991
-  				}else {
992
-  					num = num+1;
993
-  				}
994
-  			}
995
-  		}
996
-  	}*/
969
+
970
+	/**
971
+	 * 查询合同完成启用数量总数
972
+	 * @param orgId  组织id
973
+	 * @param contractNumber  计划编号
974
+	 * @return
975
+	 * @throws Exception
976
+	 */
977
+	@RequestMapping(value="/getCountQYzl",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
978
+	@ApiOperation(value="查询合同完成启用数量总数", notes = "查询合同完成启用数量总数")
979
+	@ApiImplicitParams({
980
+			@ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
981
+			@ApiImplicitParam(name = "contractNumber", value = "合同编号", paramType = "query")
982
+	})
983
+	public String getCountQYzl(Integer orgId, String contractNumber) throws Exception {
984
+		return contractService.getCountQYzl(orgId,contractNumber);
985
+	}
997 986
 }

+ 18 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java

@@ -778,4 +778,22 @@ public class BusinessDeliveryStorageNoticeController {
778 778
         }
779 779
         return modelMap;
780 780
     }
781
+
782
+	/**
783
+	 * 查询通知单完成启用数量总数
784
+	 * @param orgId  组织id
785
+	 * @param billNumber  计划编号
786
+	 * @return
787
+	 * @throws Exception
788
+	 */
789
+	@RequestMapping(value="/getCountQYzl",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
790
+	@ApiOperation(value="查询通知单完成启用数量总数", notes = "查询通知单完成启用数量总数")
791
+	@ApiImplicitParams({
792
+			@ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
793
+			@ApiImplicitParam(name = "billNumber", value = "通知单编号", paramType = "query"),
794
+			@ApiImplicitParam(name = "billType", value = "通知单类型", paramType = "query")
795
+	})
796
+	public String getCountQYzl(Integer orgId, String billNumber, String billType) throws Exception {
797
+		return deliveryStorageNoticeService.getCountQYzl(orgId,billNumber,billType);
798
+	}
781 799
 }

+ 18 - 0
src/main/java/com/chinaitop/depot/business/controller/BusinessPlanController.java

@@ -689,5 +689,23 @@ public class BusinessPlanController {
689 689
     public List<Map<String,Object>> getWarehouseByPlan(String warehouseId,Integer orgId, String ckOrRk) throws Exception {
690 690
     	return businessPlanService.getHouseByPlan(warehouseId,orgId,ckOrRk);
691 691
     }
692
+
693
+
694
+    /**
695
+     * 查询计划完成启用数量总数
696
+     * @param orgId  组织id
697
+     * @param planNumber  计划编号
698
+     * @return
699
+     * @throws Exception
700
+     */
701
+    @RequestMapping(value="/getCountQYzl",produces = MediaType.APPLICATION_JSON_VALUE, method=RequestMethod.GET)
702
+    @ApiOperation(value="查询计划完成启用数量总数", notes = "查询计划完成启用数量总数")
703
+    @ApiImplicitParams({
704
+    	@ApiImplicitParam(name = "orgId", value = "组织id", paramType = "query"),
705
+    	@ApiImplicitParam(name = "planNumber", value = "计划编号", paramType = "query")
706
+    })
707
+    public Map<String, Object> getCountQYzl(Integer orgId, String planNumber) throws Exception {
708
+    	return businessPlanService.getCountQYzl(orgId,planNumber);
709
+    }
692 710
     
693 711
 }

+ 2 - 1
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.java

@@ -124,5 +124,6 @@ public interface BusinessContractMapper {
124 124
     //根据通知单状态查询合同数据
125 125
     List<Map<String,Object>> contractData(Map<String,Object> map);
126 126
 
127
-	/*List<BusinessContract> getAllContractInfo();*/
127
+    String getCountQYzl(Map<String,Object> map);
128
+
128 129
 }

+ 12 - 12
src/main/java/com/chinaitop/depot/business/mapper/BusinessContractMapper.xml

@@ -1266,16 +1266,16 @@
1266 1266
       </foreach>
1267 1267
     </if>
1268 1268
   </select>
1269
-  
1270
-  
1271
-  <!-- <select id="getAllContractInfo" resultMap="BaseResultMap" parameterType="map" >
1272
-    select contract.id,contract_number,contract_title,customer_id,customer_bid,customer_number,customer_name, grain_quantity,money_quantity,
1273
-    signing_man,signing_time,enable_date,disable_date,contract_type,original_contract,original_contract_bid,
1274
-    root_contract_bid,shipping_type,contract_pay_type,finished_quantity,money_of_finished_quantity,remark,plant_acreage,
1275
-    plan_number,mobile,bank_name,account_name,account_number,breach_liability,dissolution_conditions,dispute_settlement_method,change_record_flag
1276
-    change_reason,change_time,change_content,changing,plan_bid,audit_state,process_instance_id,process_definition_id,agree_time,
1277
-    create_man,creater,create_time,create_unit,create_depot,update_time,org_id,in_application,
1278
-    creater_id,identification,updatetime
1279
-    from business_contract contract 
1280
-  </select> -->
1269
+
1270
+  <select id="getCountQYzl" parameterType="java.util.Map" resultType="java.lang.String">
1271
+    SELECT
1272
+    sum(grain_quantity) qyzl
1273
+    FROM
1274
+    business_contract
1275
+    WHERE
1276
+    org_id = #{orgId} AND in_application = '1'
1277
+    <if test="contractNumber != null and contractNumber != ''">
1278
+      AND contract_number = #{contractNumber}
1279
+    </if>
1280
+  </select>
1281 1281
 </mapper>

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

@@ -130,4 +130,6 @@ public interface BusinessDeliveryStorageNoticeMapper {
130 130
 	Integer selectCustomer(Map<String, Object> mapCustomer);
131 131
 
132 132
     List<BusinessDeliveryStorageNotice> selectByExampleDetails(Map<String,Object> map);
133
+
134
+    String getCountQYzl(Map<String,Object> map);
133 135
 }

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

@@ -1265,4 +1265,19 @@
1265 1265
     </foreach>
1266 1266
     group by notice.id
1267 1267
   </select>
1268
+
1269
+  <select id="getCountQYzl" parameterType="java.util.Map" resultType="java.lang.String">
1270
+    SELECT
1271
+    sum(shiping_count) qyzl
1272
+    FROM
1273
+    business_delivery_storage_notice
1274
+    WHERE
1275
+    org_id = #{orgId} AND in_application = '1'
1276
+    <if test="billNumber != null and billNumber != ''">
1277
+      AND bill_number = #{billNumber}
1278
+    </if>
1279
+    <if test="billType != null and billType != ''">
1280
+      AND bill_type = #{billType}
1281
+    </if>
1282
+  </select>
1268 1283
 </mapper>

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

@@ -124,4 +124,6 @@ public interface BusinessPlanMapper {
124 124
 
125 125
     List<Map<String, Object>> getHouseByPlanRK(Map<String, Object> map);
126 126
     List<Map<String, Object>> getHouseByPlanCK(Map<String, Object> map);
127
+
128
+    Map<String, Object> getCountQYzl(Map<String, Object> map);
127 129
 }

+ 13 - 0
src/main/java/com/chinaitop/depot/business/mapper/BusinessPlanMapper.xml

@@ -1258,4 +1258,17 @@
1258 1258
     </where>
1259 1259
     ORDER BY DATE_FORMAT(plan.create_time,'%Y-%m-%d') DESC
1260 1260
   </select>
1261
+
1262
+  <select id="getCountQYzl" parameterType="java.util.Map" resultType="java.util.Map">
1263
+    SELECT
1264
+      sum(out_amount) outAmount,
1265
+      sum(in_amount) inAmount
1266
+    FROM
1267
+      business_plan
1268
+    WHERE
1269
+          org_id = #{orgId} AND in_application = '1'
1270
+    <if test="planNumber != null and planNumber != ''">
1271
+      AND plan_number = #{planNumber}
1272
+    </if>
1273
+  </select>
1261 1274
 </mapper>

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

@@ -177,6 +177,6 @@ public interface BusinessContractService {
177 177
 
178 178
 	List<BusinessContract> queryContractChangeList(Integer userId, Integer pageNum, Integer pageSize);
179 179
 
180
-	/*List<BusinessContract> getAllContractInfo();*/
180
+	String getCountQYzl(Integer orgId, String contractNumber);
181 181
 
182 182
 }

+ 2 - 0
src/main/java/com/chinaitop/depot/business/service/BusinessDeliveryStorageNoticeService.java

@@ -118,4 +118,6 @@ public interface BusinessDeliveryStorageNoticeService {
118 118
 			
119 119
     List<BusinessDeliveryStorageNotice> queryNoticeChangeList(Integer userId, Integer pageNum, Integer pageSize);
120 120
     List<BusinessDeliveryStorageNotice> getChangeDetailList(Integer id, String type);
121
+
122
+    String getCountQYzl(Integer orgId, String billNumber, String billType);
121 123
 }

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

@@ -160,4 +160,6 @@ public interface BusinessPlanService {
160 160
 
161 161
 	List<Map<String,Object>> getHouseByPlan(String warehouseId,Integer orgId,String ckOrRk);
162 162
 
163
+	Map<String, Object> getCountQYzl(Integer orgId,String planNumber);
164
+
163 165
 }

+ 10 - 5
src/main/java/com/chinaitop/depot/business/service/impl/BusinessContractServiceImpl.java

@@ -10,6 +10,7 @@ import java.util.Map;
10 10
 
11 11
 import javax.annotation.Resource;
12 12
 
13
+import com.chinaitop.depot.utils.ParameterUtil;
13 14
 import org.activiti.engine.runtime.ProcessInstance;
14 15
 import org.apache.commons.lang.StringUtils;
15 16
 import org.springframework.stereotype.Service;
@@ -1522,10 +1523,14 @@ public class BusinessContractServiceImpl implements BusinessContractService {
1522 1523
 		return list;
1523 1524
 	}
1524 1525
 
1525
-	/*@Override
1526
-	public List<BusinessContract> getAllContractInfo() {
1527
-		// TODO Auto-generated method stub
1528
-		return contractMapper.getAllContractInfo();
1529
-	}*/
1526
+    @Override
1527
+    public String getCountQYzl(Integer orgId,String contractNumber) {
1528
+        Map<String,Object> paramMap = new HashMap<String, Object>();
1529
+        paramMap.put("orgId",orgId);
1530
+        if (ParameterUtil.isnotnull(contractNumber)) {
1531
+            paramMap.put("contractNumber",contractNumber);
1532
+        }
1533
+        return contractMapper.getCountQYzl(paramMap);
1534
+    }
1530 1535
 
1531 1536
 }

+ 12 - 1
src/main/java/com/chinaitop/depot/business/service/impl/BusinessDeliveryStorageNoticeServiceImpl.java

@@ -1453,5 +1453,16 @@ public class BusinessDeliveryStorageNoticeServiceImpl implements BusinessDeliver
1453 1453
         return null;
1454 1454
     }
1455 1455
 
1456
-    
1456
+    @Override
1457
+    public String getCountQYzl(Integer orgId, String billNumber, String billType) {
1458
+        Map<String,Object> paramMap = new HashMap<String, Object>();
1459
+        paramMap.put("orgId",orgId);
1460
+        if (ParameterUtil.isnotnull(billNumber)) {
1461
+            paramMap.put("billNumber",billNumber);
1462
+        }
1463
+        if (ParameterUtil.isnotnull(billType)) {
1464
+            paramMap.put("billType",billType);
1465
+        }
1466
+        return businessDeliveryStorageNoticeMapper.getCountQYzl(paramMap);
1467
+    }
1457 1468
 }

+ 12 - 0
src/main/java/com/chinaitop/depot/business/service/impl/BusinessPlanServiceImpl.java

@@ -1007,6 +1007,8 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
1007 1007
 			}
1008 1008
         	createCriteria.andCustomerPlanStateIn(list);
1009 1009
         }
1010
+
1011
+        example.setOrderByClause("report_date asc");
1010 1012
         
1011 1013
         PageHelper.startPage(pageNum, pageSize);
1012 1014
         
@@ -1107,4 +1109,14 @@ public class BusinessPlanServiceImpl implements BusinessPlanService {
1107 1109
 		return businessPlanList;
1108 1110
 	}
1109 1111
 
1112
+	@Override
1113
+	public Map<String, Object> getCountQYzl(Integer orgId,String planNumber) {
1114
+        Map<String,Object> paramMap = new HashMap<String, Object>();
1115
+        paramMap.put("orgId",orgId);
1116
+        if (ParameterUtil.isnotnull(planNumber)) {
1117
+            paramMap.put("planNumber",planNumber);
1118
+        }
1119
+		return planMapper.getCountQYzl(paramMap);
1120
+	}
1121
+
1110 1122
 }

+ 6 - 4
src/main/java/com/chinaitop/depot/pushs/service/impl/PushServiceImpl.java

@@ -143,16 +143,18 @@ public class PushServiceImpl implements PushsService{
143 143
 				}
144 144
 
145 145
 				//获取数据
146
-				String ids = json_object.get("tzdId").toString();
146
+//				String ids = json_object.get("tzdId").toString();
147
+				String numbers = json_object.get("tzdNumber").toString();
147 148
 				String inApplication = json_object.get("inApplication").toString();
148 149
 
149 150
 				//添加查询通知单id方法
150 151
 				BusinessDeliveryStorageNoticeExample noticeExample = new BusinessDeliveryStorageNoticeExample();
151 152
 				com.chinaitop.depot.business.model.BusinessDeliveryStorageNoticeExample.Criteria noticeCriteria = noticeExample.createCriteria();
152 153
 				//传输过来的ids转换成list<Integer>类型的。
153
-				int[] intIds = Arrays.stream(ids.split(",")).mapToInt(Integer::parseInt).toArray();
154
-				Integer[] IntegerIds = ArrayUtils.toObject(intIds);
155
-				noticeCriteria.andIdIn(Arrays.asList(IntegerIds));
154
+//				int[] intIds = Arrays.stream(ids.split(",")).mapToInt(Integer::parseInt).toArray();
155
+				String[] strNumbers = numbers.split(",");
156
+//				Integer[] IntegerIds = ArrayUtils.toObject(intIds);
157
+				noticeCriteria.andBillNumberIn(Arrays.asList(strNumbers));
156 158
 				noticeExample.setOrderByClause(" create_time DESC");
157 159
 				//添加要修改的状态值
158 160
 				BusinessDeliveryStorageNotice businessDeliveryStorageNotice = new BusinessDeliveryStorageNotice();