Commit dcde5c44 authored by xuwang's avatar xuwang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/yxproject/start/mapper/TaskMapper.java
parents 3a1614ea 28db2beb
......@@ -180,5 +180,4 @@ public class ReceiptListEntity {
}
}
......@@ -17,9 +17,12 @@ import java.util.Map;
@Mapper
public interface CountyListMapper {
public List<CountyEntity> findCountyList(@Param("taskListId") String taskListId,@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateBoundCount(@Param("county_List_Id") String county_List_Id,@Param("out_Storage_Count") String out_Storage_Count,@Param("in_Storage_Count") String in_Storage_Count);
public int reviseStorageCount( @Param("taskListId") String taskListId, @Param("countyCode") String countyCode,@Param("in_Storage_Count") String in_Storage_Count,@Param("out_Storage_Count") String out_Storage_Count);
public List<ReceiptListEntity> getReceiptList( @Param("startDate")String startDate , @Param("endDate") String endDate);
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
public int totalFinshCount ();
public int totalInStorageCount ();
public int totalOutStorageCount ();
// public List<Map<String, Object>> PrintCountyListXML();
}
......@@ -18,10 +18,9 @@ public interface TaskMapper {
public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo);
public List<TaskEntity> findTaskEntityByState(int state);
public int replaceExceptionInformation(TaskEntity taskEntity);
public int totalNum (int i);
public List<TypeListEntity> findTypeListByTaskStateId(String taskStateId);
public List <CityListEntity> findCityList(@Param("taskStateId") String taskStateId,@Param("cardType") String cardType);
public int updateOutStorageDate( @Param("taskListId")String taskId, @Param("inStorageCount")String inStorageCount, @Param("outStorageCount")String outStorageCount);
public int updateInStorageDate(String taskListId,String inStorageCount,String outStorageCount);
public List<Map<String,Object>> findStationCountByDealDate(@Param("submitDate") String submitDate,@Param("state") String state);
public int updateOutStorageDate(String taskListId);
public int updateInStorageDate(String taskListId);
public int updateStorageDate(String taskListId);
}
......@@ -9,5 +9,5 @@ import java.util.Map;
public interface CountyListService {
public List<CountyListEntity> findStorageCountByTaskListId(String taskListId);
public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count);
public int reviseStorageCount(String taskListId,String countyCode, String in_Storage_Count, String out_Storage_Count);
}
......@@ -28,7 +28,7 @@ public interface TaskService {
public int addExceptionState(TaskEntity state);
public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount);
// public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount);
......
......@@ -2,10 +2,12 @@ package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CountyListEntity;
import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.mapper.TaskMapper;
import com.yxproject.start.service.CountyListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -18,21 +20,29 @@ import java.util.Map;
public class CountyListServiceImpl implements CountyListService {
@Autowired
public CountyListMapper countyListMapper;
@Autowired
public TaskMapper taskMapper;
@Override
public int reviseBoundCount(String county_List_Id, String out_Storage_Count, String in_Storage_Count) {
int i= 0;
if(out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
public int reviseStorageCount(String taskListId,String countyCode, String in_Storage_Count, String out_Storage_Count) {
int i = 0;
int totalFinshCount = 0;
int totalInStorageCount = 0;
int totalOutStorageCount = 0;
totalFinshCount = countyListMapper.totalFinshCount();
totalInStorageCount = countyListMapper.totalInStorageCount();
totalOutStorageCount = countyListMapper.totalOutStorageCount();
i = countyListMapper.reviseStorageCount(taskListId, countyCode, in_Storage_Count, out_Storage_Count);
if(totalInStorageCount == totalFinshCount){
taskMapper.updateInStorageDate(taskListId);
}
if(!out_Storage_Count.equals(0)&&in_Storage_Count.equals(0)){
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
if(totalOutStorageCount == totalFinshCount){
taskMapper.updateOutStorageDate(taskListId);
}
if(!out_Storage_Count.equals(0)&&!in_Storage_Count.equals(0)){
i=countyListMapper.updateBoundCount(county_List_Id, out_Storage_Count, in_Storage_Count);
if(totalInStorageCount == totalFinshCount && totalOutStorageCount == totalFinshCount){
taskMapper.updateStorageDate(taskListId);
}
return i;
return i;
}
@Override
......
......@@ -433,24 +433,24 @@ public class TaskServiceImpl implements TaskService {
return i;
}
/**
* 更新出入库时间
* @param
* @return
*/
@Override
public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount ) {
int i=0;
i= taskMapper.totalNum(i);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
if (inStorageCount.equals(i)){
return taskMapper.updateInStorageDate(taskListId,inStorageCount,outStorageCount);
}
if(outStorageCount.equals(i)){
return taskMapper.updateOutStorageDate(taskListId,inStorageCount,outStorageCount);
}
return 0;
}
// /**
// * 更新出入库时间
// * @param
// * @return
// */
// @Override
// public int updateStorageDate(String taskListId,String inStorageCount,String outStorageCount ) {
// int j=0;
// j= taskMapper.totalNum(j);
// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
// if (inStorageCount.equals(j)){
// taskMapper.updateInStorageDate(taskListId,inStorageCount,outStorageCount);
// }
// if(outStorageCount.equals(j)){
// taskMapper.updateOutStorageDate(taskListId,inStorageCount,outStorageCount);
// }
// return 0;
// }
/**
......
......@@ -21,15 +21,11 @@
WHERE TASK.TASK_ID=#{taskListId} AND TASK.CARD_TYPE=#{cardType} AND TASK.TASK_STATE_ID=#{taskStateId}
</select>
<update id="updateBoundCount" parameterType="String" >
update COUNTY_LIST SET OUT_STORAGE_COUNT =#{out_Storage_Count},IN_STORAGE_COUNT =#{in_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id}
</update>
<select id="getReceiptList" resultType="com.yxproject.start.entity.ReceiptListEntity" parameterType="String">
WITH
t_county
AS(
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS BOX_COUNT,SAVE_DATE
SELECT COUNTYNAME,CARD_TYPE_DIC.CARD_TYPE,SUM(COUNTY_LIST.OUT_STORAGE_COUNT) AS TYPE_COUNT,floor(SUM(COUNTY_LIST.OUT_STORAGE_COUNT)/250)+1 AS boxCount,SAVE_DATE
FROM (SELECT CARD_TYPE_ID,CARD_TYPE FROM CARD_TYPE_DIC GROUP BY CARD_TYPE_ID,CARD_TYPE ) CARD_TYPE_DIC
LEFT JOIN (SELECT TASK_ID,CARD_TYPE FROM TASK GROUP BY TASK_ID,CARD_TYPE) TASK ON CARD_TYPE_DIC.CARD_TYPE_ID = TASK.CARD_TYPE
LEFT JOIN (SELECT COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE FROM COUNTY_LIST GROUP BY COUNTY_CODE,TASK_ID,OUT_STORAGE_COUNT,SAVE_DATE) COUNTY_LIST ON COUNTY_LIST.TASK_ID = TASK.TASK_ID
......@@ -38,7 +34,7 @@
),
t_total_count
AS(
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,BOX_COUNT,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
SELECT * FROM (SELECT COUNTYNAME,CARD_TYPE,TYPE_COUNT,boxCount,SAVE_DATE FROM t_county) PIVOT(SUM(TYPE_COUNT) FOR CARD_TYPE IN ('普通证' AS PTZ,'快证' AS KZ,'省内异地快速通道邮' AS YDKSY,'省内异地快速通道
普' AS YDKSP,'省内异地邮' AS YDY,'省内异地普' AS YDP,'军人证' AS JRZ,'快速通道普' AS KSP,'快速通道邮' AS KSY,'邮寄证' AS YJZ))
),
county_xiaoji
......@@ -46,18 +42,18 @@
SELECT COUNTYNAME,SUM(TYPE_COUNT) AS XIAOJI FROM t_county GROUP BY COUNTYNAME
)
SELECT DECODE(GROUPING(t_total_count.COUNTYNAME),1,'总计',t_total_count.COUNTYNAME)COUNTYNAME,
SUM(PTZ)PTZ,
SUM(KZ)KZ,
SUM(YDKSY)YDKSY,
SUM(YDKSP)YDKSP,
SUM(YDY)YDY,
SUM(YDP)YDP,
SUM(JRZ)JRZ,
SUM(KSP)KSP,
SUM(KSY)KSY,
SUM(YJZ)YJZ,
SUM(XIAOJI)XIAOJI,
SUM(BOX_COUNT)BOX_COUNT
nvl(SUM(PTZ),0)AS PTZ ,
nvl(SUM(KZ),0)AS KZ,
nvl(SUM(YDKSY),0) AS YDKSY,
nvl(SUM(YDKSP),0)AS YDKSP,
nvl(SUM(YDY),0)AS YDY,
nvl(SUM(YDP),0)AS YDP,
nvl(SUM(JRZ),0)AS JRZ,
nvl(SUM(KSP),0)AS KSP,
nvl(SUM(KSY),0)AS KSY,
nvl(SUM(YJZ),0)AS YJZ,
SUM(XIAOJI)XIAOJI,
SUM(boxCount)boxCount
FROM t_total_count,county_xiaoji WHERE t_total_count.COUNTYNAME=county_xiaoji.COUNTYNAME AND substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8) >= #{startDate} AND #{endDate} >= substr(TO_CHAR(SAVE_DATE,'yyyyMMdd'),0,8)
GROUP BY ROLLUP(t_total_count.COUNTYNAME)
</select>
......@@ -69,6 +65,23 @@
WHERE TASK_ID=#{task_Id}
</select>
<insert id="reviseStorageCount" parameterType="String" >
INSERT INTO COUNTY_LIST (TASK_ID,COUNTY_CODE,IN_STORAGE_COUNT,OUT_STORAGE_COUNT) VALUES ( #{taskListId},#{countyCode},#{in_Storage_Count},#{out_Storage_Count} )
</insert>
<select id="totalFinshCount" resultType="Integer">
select nvl(SUM(FINISH_COUNT),0) FROM COUNTY_LIST
</select>
<select id="totalInStorageCount" resultType="Integer">
select nvl(SUM(IN_STORAGE_COUNT),0) FROM COUNTY_LIST
</select>
<select id="totalOutStorageCount" resultType="Integer">
select nvl(SUM(OUT_STORAGE_COUNT),0) FROM COUNTY_LIST
</select>
<!--<select id="PrintCountyListXML" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String">-->
<!--SELECT * FROM COUNTY_LIST-->
<!--</select>-->
......
......@@ -72,16 +72,16 @@
update TASK set exception_Information = NULL and IS_EXCEPTION =#{is_Exception} where TASK_ID =#{task_Id}
</update>
<select id="totalNum" resultType="Integer">
select nvl(SUM(VALID_COUNT),0) FROM GROUP_NO
</select>
<update id="updateOutStorageDate">
UPDATE TASK SET OUT_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</update>
<update id="updateOutStorageDate" parameterType="String">
update TASK SET OUT_STORAGE_DATE = SYSDATE where TASK_ID =#{task_Id}
<update id="updateInStorageDate" >
UPDATE TASK SET IN_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</update>
<update id="updateInStorageDate" parameterType="String">
update TASK SET IN_STORAGE_DATE = SYSDATE where TASK_ID =#{task_Id}
<update id="updateStorageDate" >
UPDATE TASK SET IN_STORAGE_DATE = SYSDATE , OUT_STORAGE_DATE = SYSDATE WHERE TASK_ID = #{taskListId}
</update>
<select id="findTypeListByTaskStateId" resultType="com.yxproject.start.entity.TypeListEntity" parameterType="String">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment