Commit ebfd2ca9 authored by liboyang's avatar liboyang

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

parents 84befaac 0c011dae
package com.yxproject.start.api;
import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity;
import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.service.GroupNoService;
import com.yxproject.start.service.SpecialCardService;
import com.yxproject.start.service.TaskListService;
import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray;
......@@ -23,23 +28,27 @@ import java.util.*;
/**
* @author Administrator
* 任务单流程接口
*
*/
@RestController
@RequestMapping("TaskList")
public class TaskListApi {
@Autowired
private TaskListService taskListService;
private TaskListService taskListService;
@Autowired
private SpecialCardService specialCardService;
@Autowired
private GroupNoService groupNoService;
/**
* 查询以区为单位的制证数量
* 受理库
*
* @param submitDate
* @return
*/
@RequestMapping("selectByCounty")
public JSONObject selectByCounty(@RequestParam(value = "submitDate") String submitDate){
List<CountCountyEntity> resultList= taskListService.selectByCounty(submitDate);
public JSONObject selectByCounty(@RequestParam(value = "submitDate") String submitDate) {
List<CountCountyEntity> resultList = taskListService.selectByCounty(submitDate);
JSONObject resultJson = JSONObject.fromObject(resultList);
return resultJson;
}
......@@ -47,13 +56,14 @@ public class TaskListApi {
/**
* 查询以派出所为单位的制证数量
* 受理库
*
* @param submitDate
* @param countyCode
* @return
*/
@RequestMapping("selectByGajg")
public JSONObject selectByGajg(@RequestParam(value = "submitDate") String submitDate,@RequestParam(value = "countyCode") String countyCode){
List<CountGajgEntity> resultList= taskListService.selectByGajg(submitDate,countyCode);
public JSONObject selectByGajg(@RequestParam(value = "submitDate") String submitDate, @RequestParam(value = "countyCode") String countyCode) {
List<CountGajgEntity> resultList = taskListService.selectByGajg(submitDate, countyCode);
JSONObject resultJson = JSONObject.fromObject(resultList);
return resultJson;
}
......@@ -61,14 +71,15 @@ public class TaskListApi {
/**
* 生成任务单
* 受理库
*
* @param submitDate
* @param countyCode
* @param Gajg
* @return
*/
@RequestMapping("createTaskList")
public boolean createTaskList(@RequestParam(value = "submitDate") String submitDate,@RequestParam(value = "countyCode") String countyCode,@RequestParam(value = "Gajg") String Gajg){
List<TaskListEntity> resultList= taskListService.selectACCU(submitDate,countyCode,Gajg);
public boolean createTaskList(@RequestParam(value = "submitDate") String submitDate, @RequestParam(value = "countyCode") String countyCode, @RequestParam(value = "Gajg") String Gajg) {
List<TaskListEntity> resultList = taskListService.selectACCU(submitDate, countyCode, Gajg);
taskListService.createTaskList(resultList);
return true;
}
......@@ -76,48 +87,52 @@ public class TaskListApi {
/**
* 更改任务单状态
* taskId 任务单ID
* name 下发人姓名
* name 下发人姓名
* process 下发人所在工序
*
* @return
*/
@RequestMapping("updateState")
public boolean updateState(@RequestBody String json){
public boolean updateState(@RequestBody String json) {
JSONObject jsonObject = JSONObject.fromObject(json);
JSONArray jsonArray =(JSONArray)jsonObject.get("taskIdList");
JSONArray jsonArray = (JSONArray) jsonObject.get("taskIdList");
String process = jsonObject.get("process").toString();
String name = jsonObject.get("name").toString();
Boolean b = true;
List<String> list= (List<String>)jsonArray;
return taskListService.updateState(list,process,name);
List<String> list = (List<String>) jsonArray;
return taskListService.updateState(list, process, name);
}
/**
* 查询任务单详情
* (受理库)
*
* @param process 工序
* @param date 查询时间
* @param date 查询时间
* @param resp
* @return
*/
@RequestMapping("queryByCountyAtACCU")
public List<Object> queryByCountyAtACCU(@RequestParam("process") String process,@RequestParam("date") String date, HttpServletResponse resp){
public List<Object> queryByCountyAtACCU(@RequestParam("process") String process, @RequestParam("date") String date, HttpServletResponse resp) {
List<Object> objects = taskListService.selectByCountyAtACCU(replaceDate(date));
return objects;
}
/**
* 查询组号列表详情
* 受理库
* @param date 查询时间
* @param typeCode 制证类型
* @param countyCode 区县代码
* 受理库
*
* @param date 查询时间
* @param typeCode 制证类型
* @param countyCode 区县代码
* @param resp
* @return
*/
@RequestMapping("queryByGroupNoAtACCU")
public Map<String ,Object> queryByPoliceAtACCU(@RequestParam("date") String date,@RequestParam("typeCode") String typeCode,@RequestParam("countyCode") String countyCode,@RequestParam("currPage") String currPage,@RequestParam("pageSize") String pageSize, HttpServletResponse resp){
Map<String ,Object> objects = taskListService.selectByGroupNoAtACCU(replaceDate(date), typeCode, countyCode,Long.valueOf(currPage),Long.valueOf(pageSize));
public Map<String, Object> queryByPoliceAtACCU(@RequestParam("date") String date, @RequestParam("typeCode") String typeCode, @RequestParam("countyCode") String countyCode, @RequestParam("currPage") String currPage, @RequestParam("pageSize") String pageSize, HttpServletResponse resp) {
Map<String, Object> objects = taskListService.selectByGroupNoAtACCU(replaceDate(date), typeCode, countyCode, Long.valueOf(currPage), Long.valueOf(pageSize));
return objects;
}
......@@ -126,30 +141,31 @@ public class TaskListApi {
/**
* 查询任务单详情
* (辅助库)
*
* @param process 工序
* @param resp
* @return
*/
@RequestMapping("queryByCountyAtAuxiliary")
public List<Object> queryByCountyAtAuxiliary(@RequestParam("process") String process, HttpServletResponse resp){
List<Object> objects = taskListService.selectByCountyAtAuxiliary(Long.valueOf(process)-1);
public List<Object> queryByCountyAtAuxiliary(@RequestParam("process") String process, HttpServletResponse resp) {
List<Object> objects = taskListService.selectByCountyAtAuxiliary(Long.valueOf(process) - 1);
return objects;
}
/**
* 生成任务单
*
* date 查询时间
* name 提交人姓名
* <p>
* date 查询时间
* name 提交人姓名
* groupList 组号列表
* countyList 区县列表 {typeCode:1,countyCode:'123456'}
* countyList 区县列表 {typeCode:1,countyCode:'123456'}
*
* @return
*/
@RequestMapping("createTask")
@Transactional
public String queryByCountyAtACCU(@RequestBody String str, HttpServletResponse resp){
public String queryByCountyAtACCU(@RequestBody String str, HttpServletResponse resp) {
System.out.println(str);
JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date");
......@@ -157,28 +173,28 @@ public class TaskListApi {
// String process = jsonObject.getString("tag");
JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String,Object>> countyList =(List<Map<String,Object>>)jsonCounty;
List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty;
//正常生成区县任务单
for (Map<String,Object> map :countyList){
for (Map<String, Object> map : countyList) {
String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString();
List<Object> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
boolean b = taskListService.saveTask(objects,name,0+"");
boolean b = taskListService.saveTask(objects, name, 0 + "");
}
//生成某几个组的区县任务单
if (jsonGroup.size()>0){
List<String> groupList =(List<String>)jsonGroup;
if (jsonGroup.size() > 0) {
List<String> groupList = (List<String>) jsonGroup;
//查询组号详情
String groupNo = "(";
for ( int i= 0; i<groupList.size();i++){
if (i!=groupList.size()-1){
groupNo=groupNo+groupList.get(i)+",";
}else {
groupNo=groupNo+groupList.get(i)+")";
for (int i = 0; i < groupList.size(); i++) {
if (i != groupList.size() - 1) {
groupNo = groupNo + groupList.get(i) + ",";
} else {
groupNo = groupNo + groupList.get(i) + ")";
}
}
List<Object> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects,name,0+"");
boolean b = taskListService.saveTask(objects, name, 0 + "");
}
return "成功生成循环单";
}
......@@ -186,237 +202,95 @@ public class TaskListApi {
/**
* 生成快证任务单
*
* name 提交人姓名
* <p>
* name 提交人姓名
* groupList 组号列表
* countyList 区县列表 {typeCode:1,countyCode:'123456'}
* countyList 区县列表 {typeCode:1,countyCode:'123456'}
*
* @return
*/
@RequestMapping("createFastTask")
@Transactional
public String createFastTask(@RequestParam("acceptNo") String acceptNo, HttpServletResponse resp){
//todo
// JSONObject jsonObject = (JSONObject) object;
// String cardID = jsonObject.getString("cardID");
// String makeType = jsonObject.getString("makeType");
// String cityCode = jsonObject.getString("cityCode");
// if ("null".equals(cityCode.substring(0, 4))) {
// cityCode = "000000";
// }
// String createDate = df2.format(new Date());
// if ("null".equals(createDate + "")) {
// createDate = df2.format(new Date()).substring(0, 8);
// }
// List<Object[]> list = processinfoDao.querySpecialCardInfo(cardID.substring(0, 8));
// String queryGroupMakeType = groupinfoDao.queryGroupMakeType(cardID.substring(0, 8));
// /**
// * 未保存循环单 在受理库中添加快证
// */
// try {
// if (list.size() == 0) {
// //添加快证时保存派出所上传照片的情况
// ManagerACC managerACC = (ManagerACC) SpringBeanUtil.getContext().getBean("managerACC");
// List<String> stringList = new ArrayList<>();
// stringList.add("('" + cardID.substring(0, 8) + "')");
// List<Object[]> policeStationInfo = managerACC.getPoliceStationInfo(stringList);
// int i1 = 0;
// while (i1 == 0) {
// i1 = updatePoliceStationInfo(policeStationInfo);
// }
// //生成快证循环单
// String cycleid = updateCycleSheet(1 + "", df2.format(new Date()), cityCode.substring(0, 4) + "00", createDate, 1 + "", 0 + "", "", "", "1", Long.valueOf(queryGroupMakeType));
// //插入新的组
// GroupinfoEntity groupinfoEntity1 = new GroupinfoEntity();
// groupinfoEntity1.setGroupinfoid(groupinfoDao.findCount(GroupinfoEntity.class) + 1);
// groupinfoEntity1.setCyclesheetid(cycleid);
// groupinfoEntity1.setCount(Long.valueOf(1));
// groupinfoEntity1.setType(Long.valueOf(1));
// groupinfoEntity1.setGroupNo(cardID);
// groupinfoDao.update(groupinfoEntity1);
// //快证循环单添加工序
// ProcessinfoEntity processinfoEntity1 = new ProcessinfoEntity();
// processinfoEntity1.setCyclesheet(cycleid);
// processinfoEntity1.setProcessid(processinfoDao.queryProcessID() + 1);
// processinfoEntity1.setProcess(1 + "");
// processinfoEntity1.setCreatedate(df2.format(new Date()));
// processinfoDao.update(processinfoEntity1);
// String sql = "select DATA_VERIFICATION_SEQ.currval,DATA_VERIFICATION_SEQ.NEXTVAL from dual";
// List<Object[]> listWithSQL = dataVerificationEntityDao.findListWithSQL(sql);
// AutoCreateCycleID autoCreateCycleID = new AutoCreateCycleID();
// String dataVerificationID = autoCreateCycleID.createCycleID(listWithSQL.get(0)[0] + "");
// SimpleDateFormat simpleDateFormat2 = new SimpleDateFormat("yyyyMMdd");
// DataVerificationEntity dataVerificationEntity = new DataVerificationEntity();
// dataVerificationEntity.setDataVerificationId(dataVerificationID);
// dataVerificationEntity.setCitycode(cityCode.substring(0, 4) + "00");
// dataVerificationEntity.setMaketype(Long.valueOf(queryGroupMakeType));
// dataVerificationEntity.setSaveDate(simpleDateFormat2.format(new Date()));
// dataVerificationEntity.setValidCount((long) 1);
// dataVerificationEntity.setInvalidCount((long) 0);
// dataVerificationEntityDao.update(dataVerificationEntity);
//
// List<Object[]> groupInfoList = groupinfoDao.queryGroupInfoAtAcc(cardID.substring(0, 8));
// int i = Integer.valueOf((groupInfoList.get(0)[1]).toString()) - 1;
// /**
// * 判断组内剩下的人数
// * 如果超过1人 则加入新的循环单
// *
// */
// if (i > 0) {
// String cycleid1 = updateCycleSheet(makeType, df2.format(new Date()), cityCode.substring(0, 4) + "00", createDate, i + "", groupInfoList.get(0)[2].toString(), "", "", "0", Long.valueOf(-1));
// GroupinfoEntity groupinfoEntity2 = new GroupinfoEntity();
// //插入组号原有的信息
//// long count = groupinfoDao.findCount(GroupinfoEntity.class);
// long count = groupinfoDao.queryGroupinfoCount();
// groupinfoEntity2.setGroupinfoid(count + 1);
// groupinfoEntity2.setCyclesheetid(cycleid1);
// groupinfoEntity2.setCount(Long.valueOf(groupInfoList.get(0)[1].toString()));
// groupinfoEntity2.setGroupNo(cardID.substring(0, 8));
// groupinfoDao.update(groupinfoEntity2);
// //插入快证的信息
// GroupinfoEntity groupinfoEntity3 = new GroupinfoEntity();
// groupinfoEntity3.setGroupinfoid(groupinfoDao.findCount(GroupinfoEntity.class) + 1);
// groupinfoEntity3.setCyclesheetid(cycleid1);
// groupinfoEntity3.setCount(Long.valueOf("-1"));
// groupinfoEntity3.setGroupNo(cardID);
// groupinfoEntity3.setType(Long.valueOf("1"));
// groupinfoDao.update(groupinfoEntity3);
// }
// yxresp.outPutSuccess("1");
// } else if (list.size() == 1) {
// /**]
// * 已保存循环单 在盈信库中 添加快证
// */
// //更新原来循环单数据核验数量
// cyclesheetinfoEntityDao.updateCycleSheetInfoVaild(list.get(0)[0].toString());
// GroupinfoEntity groupinfoEntity = new GroupinfoEntity();
// groupinfoEntity.setGroupNo(cardID);
// groupinfoEntity.setType((long) 1);
// groupinfoEntity.setCount(0 - Long.valueOf(1));
// groupinfoEntity.setCyclesheetid(list.get(0)[0].toString());
// groupinfoEntity.setGroupinfoid(groupinfoDao.findCount(GroupinfoEntity.class) + 1);
// groupinfoDao.update(groupinfoEntity);
// //插入新的循环单
//// CyclesheetinfoEntity findcyclesheetinfoEntity = cyclesheetinfoEntityDao.findCyclesheetinfoEntityByCycleID(groupinfoEntity.getCyclesheetid());
//// //在新的余证循环单中添加原有循环单的生成时间
//// String cycleid = updateCycleSheetBySQL(1 + "", findcyclesheetinfoEntity.getSubmitdate(), findcyclesheetinfoEntity.getCitycode(), findcyclesheetinfoEntity.getCreatedate(), 1 + "", 0 + "", findcyclesheetinfoEntity.getWorkshop(), findcyclesheetinfoEntity.getMachine(), "1");
//
//// 插入新的循环单
// String cycleid = updateCycleSheet(1 + "", df2.format(new Date()), list.get(0)[3].toString(), df2.format(new Date()), 1 + "", 0 + "", ((list.get(0)[7] == null) ? "" : list.get(0)[7].toString()), ((list.get(0)[8] == null) ? "" : list.get(0)[8].toString()), "1", Long.valueOf(queryGroupMakeType));
// //插入新的组
// GroupinfoEntity groupinfoEntity1 = new GroupinfoEntity();
// long count = groupinfoDao.findCount(GroupinfoEntity.class);
// groupinfoEntity1.setGroupinfoid(count + 1);
// groupinfoEntity1.setCyclesheetid(cycleid);
// groupinfoEntity1.setCount(Long.valueOf(1));
// groupinfoEntity1.setType(Long.valueOf(1));
// groupinfoEntity1.setGroupNo(cardID);
// groupinfoDao.update(groupinfoEntity1);
// //在未下发循环单中添加快证 工序为null设置为 1
// if (list.get(0)[11] == null) {
// ProcessinfoEntity processinfoEntity1 = new ProcessinfoEntity();
// processinfoEntity1.setCyclesheet(cycleid);
// processinfoEntity1.setProcessid(processinfoDao.queryProcessID() + 1);
// processinfoEntity1.setProcess("1");
// processinfoEntity1.setCreatedate(df2.format(new Date()));
// processinfoDao.update(processinfoEntity1);
// } else {
// int num = Integer.valueOf((list.get(0)[11] == null ? null : list.get(0)[11].toString()));
// for (int i = 1; i <= num; i++) {
// ProcessinfoEntity processinfoEntity1 = new ProcessinfoEntity();
// processinfoEntity1.setCyclesheet(cycleid);
// processinfoEntity1.setProcessid(processinfoDao.queryProcessID() + 1);
// processinfoEntity1.setProcess(i + "");
// processinfoEntity1.setCreatedate(df2.format(new Date()));
// processinfoDao.update(processinfoEntity1);
// }
// }
// yxresp.outPutSuccess("1");
// } else {
// /**
// * 已经成为余证或者废证 添加快证
// */
// List<GroupinfoEntity> groupinfoEntities = groupinfoDao.queryGroupInfoEntityList(cardID);
// /**
// * 判断是否是余证 添加快证
// */
// if (groupinfoEntities.get(0).getType() == 2) {
// for (GroupinfoEntity groupinfoEntity : groupinfoEntities) {
// /**
// * 修改组号表中 余证 改快证
// */
// groupinfoEntity.setType(Long.valueOf(1));
// groupinfoDao.update(groupinfoEntity);
// if (groupinfoEntity.getCount() == 1) {
// /**
// * 找到余证循环单 改为快证循环单
// */
// CyclesheetinfoEntity cyclesheetinfoEntity = cyclesheetinfoEntityDao.queryCyclesheetinfoEntityByCycleID(groupinfoEntity.getCyclesheetid());
// cyclesheetinfoEntity.setMktype(Long.valueOf(1));
// cyclesheetinfoEntity.setWorkshop(null);
// cyclesheetinfoEntityDao.update(cyclesheetinfoEntity);
// }
// }
// } else {
// /**
// * 废证 添加快证
// */
// for (GroupinfoEntity groupinfoEntity : groupinfoEntities) {
// /**
// * 修改组号表中 废证 改快证
// */
// groupinfoEntity.setType(Long.valueOf(1));
// groupinfoDao.update(groupinfoEntity);
// if (groupinfoEntity.getCount() == 1) {
// /**
// * 找到废证循环单 改为快证循环单
// */
// CyclesheetinfoEntity cyclesheetinfoEntity = cyclesheetinfoEntityDao.queryCyclesheetinfoEntityByCycleID(groupinfoEntity.getCyclesheetid());
// cyclesheetinfoEntity.setMktype(Long.valueOf(1));
// cyclesheetinfoEntity.setIsshow(Long.valueOf(1));
// cyclesheetinfoEntity.setWorkshop(null);
// cyclesheetinfoEntityDao.update(cyclesheetinfoEntity);
// }
// if (groupinfoEntity.getCount() == -1) {
// //更新原来循环单数据核验数量
// cyclesheetinfoEntityDao.updateCycleSheetInfoVaild(groupinfoEntity.getCyclesheetid());
// }
// }
// }
// yxresp.outPutSuccess("1");
// }
// } catch (Exception e) {
// logger.error("添加快证循环单在制证库异常 addQuickCyclesheetInfoImpl" + " cardID " + cardID + " makeType " + makeType + " cityCode " + cityCode + "createDate" + createDate);
// logger.error("", e.fillInStackTrace());
// throw e;
// }
return null;
}
public String createFastTask(@RequestBody String object, HttpServletResponse resp) {
//todo 添加没有解析进去受理库情况
JSONObject jsonObject = JSONObject.fromObject(object);
String acceptNo = jsonObject.getString("acceptNo");
String cardType = jsonObject.getString("cardType");
String countyCode = jsonObject.getString("countyCode");
String name = jsonObject.getString("name");
if ("null".equals(countyCode.substring(0, 4))) {
countyCode = "000000";
}
//查询快证是否存在受理库
List<Object> objects = taskListService.selectFastCardAtACCU(acceptNo.substring(0, 8));
//存在受理库
if (objects.size()==1){
taskListService.saveFastTask(objects,name,acceptNo,Long.valueOf(cardType));
}else{
//存在任务单(余证任务单 普通证任务单)
//1 存在余证任务单
List<SpecialCardEntity> specialCardEntities = specialCardService.selectSpecialCardAtSpecialCard(acceptNo);
if (specialCardEntities.size()>0){
for (SpecialCardEntity specialCardEntity :specialCardEntities){
specialCardEntity.setSpecialType((long)2);
specialCardService.updateSpecialCardSpecialType(specialCardEntity);
}
}else {
//2 存在普通证任务单
//更改组号详情的特证数量+1
List<GroupNoEntity> groupNoEntities = groupNoService.selectGroupNoEntityByGroupNo(acceptNo.substring(0, 8));
if (groupNoEntities.size()>0){
for (GroupNoEntity groupNoEntity :groupNoEntities){
groupNoEntity.setSpecialCardCount(groupNoEntity.getSpecialCardCount()+1);
groupNoService.updateGroupNoSpecialCount(groupNoEntity);
}
List<TaskEntity> taskEntities = taskListService.selectTaskEntityByTaskId(groupNoEntities.get(0).getTaskId());
//添加快证任务单
TaskEntity taskEntity = new TaskEntity();
taskEntity.setOldCardType(Long.valueOf(cardType));
taskEntity.setCardType((long)1);
taskEntity.setCountyCode(countyCode);
taskEntity.setSubmitName(name);
taskEntity.setTaskStateId(taskEntities.get(0).getTaskStateId());
taskListService.saveFastTask(taskEntity);
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setSpecialType((long)2);
specialCardEntity.setInitiator(name);
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardService.saveSpecialCard(specialCardEntity);
}
}
}
return null;
}
/**
* 字符串去除空格
*
* @param str 原始字符串
* @return 返回新的字符串
*/
private String replaceNullString(String str) {
if (str == ""){
private String replaceNullString(String str) {
if (str == "") {
return null;
} else return str;
}
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str){
return str.replace("-","");
private String replaceDate(String str) {
return str.replace("-", "");
}
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.GroupNoEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface GroupNoMapper {
......@@ -23,4 +22,20 @@ public interface GroupNoMapper {
@Insert("insert into group_no (GROUP_NO,TASK_ID,VALID_COUNT,INVALID_COUNT,SPECIAL_CARD_COUNT) " +
"values(#{groupNo},#{taskId},#{validCount},#{invalidCount},#{specialCardCount})")
public boolean saveGroupNo (GroupNoEntity groupNoEntity);
/**
* 查询组号详情
* @param groupNo 组号
* @return
*/
@Select("select * from group_No where group_No = #{groupNo}")
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo);
/**
* 更新组号详情中 的特证数量
* @param groupNoEntity
* @return
*/
@Update("update GROUP_NO set SPECIAL_CARD_COUNT = #{specialCardCount} where id = #{id}")
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity);
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.SpecialCardEntity;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:09
*/
@Mapper
public interface SpecialCardMapper {
/**
* 保存特证信息
* @param specialCardEntity
* @return
*/
@Insert("INSERT into SPECIAL_CARD (ACCEPT_NO,TASK_ID,SPECIAL_TYPE,GROUP_NO,INITIATOR) " +
"values (#{acceptNo},#{taskId},#{specialType},#{groupNo},#{initiator})")
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity);
/**
* 查询特证信息
* @param acceptNo 受理组号
* @return
*/
@Select("select * from SPECIAL_CARD where ACCEPT_NO = #{acceptNo}")
public List<SpecialCardEntity> selectSpecialCardByAcceptNo(String acceptNo);
/**
* 更新特证受理类型
* @param specialCardEntity
* @return
*/
@Update("update SPECIAL_CARD set SPECIAL_TYPE = #{specialType} where SPECIAL_CARD_ID = #{specialCardId}")
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity);
}
......@@ -20,8 +20,8 @@ public interface TaskListMapper {
* @param submitDate
* @return
*/
@Select(" SELECT coun.COUNTYNAME,substr(act.upload_no,0,6),count(*) as count FROM ACC_CARD_T@ACCU_DBLINK act ,count()" +
" LEFT JOIN ACC_GROUP_T@ACCU_DBLINK agt on substr(act.accept_no,0,8) = agt.group_no " +
@Select(" SELECT coun.COUNTYNAME,substr(act.upload_no,0,6),count(*) as count FROM ACC_CARD_T@ACCU_LINK act ,count()" +
" LEFT JOIN ACC_GROUP_T@ACCU_LINK agt on substr(act.accept_no,0,8) = agt.group_no " +
" LEFT JOIN COUNTY_DIC coun on substr(act.upload_no,0,6) = coun.county_code " +
" WHERE agt.group_no not in (select GROUP_NO.group_no from GROUP_NO) " +
" and to_char(IMPORT_TIME,'yyyymmdd') = #{submitDate} " +
......@@ -121,13 +121,21 @@ public interface TaskListMapper {
/**
* 生成任务单
* 生成快证任务单
* @param taskEntity 任务单
* @return
*/
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID) values(#{cardType},#{countyCode},#{submitName},#{taskStateId})")
@Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID,OLD_CARD_TYPE) values(#{cardType},#{countyCode},#{submitName},#{taskStateId},#{oldCardType})")
@Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
public boolean saveTask(TaskEntity taskEntity);
public boolean saveFastTask(TaskEntity taskEntity);
// /**
// * 生成任务单
// * @param taskEntity 任务单
// * @return
// */
// @Insert("insert into task (CARD_TYPE,COUNTY_CODE,SUBMIT_NAME,TASK_STATE_ID) values(#{cardType},#{countyCode},#{submitName},#{taskStateId})")
// @Options(useGeneratedKeys=true, keyProperty="taskId", keyColumn="TASK_ID")
// public boolean saveTask(TaskEntity taskEntity);
......@@ -186,10 +194,10 @@ public interface TaskListMapper {
* @return
*/
@Select("SELECT act.ACCEPT_NO, agt.deal_flag, gajg.gajg_mc, gajg.gajg_dm, coun.COUNTYNAME,agt.group_no\n" +
" FROM ACC_CARD_T@ACCU_DBLINK act \n"+
" FROM ACC_CARD_T@ACCU_LINK act \n"+
" LEFT JOIN COUNTY_DIC coun on substr(act.upload_no,0,6) = coun.county_code " +
" LEFT JOIN ACC_GROUP_T@ACCU_DBLINK agt on substr(act.accept_no,0,8) = agt.group_no \n" +
" LEFT JOIN GAJG_MC gajg on substr(act.upload_no,0,9) = gajg.gajg_dm\n"+
" LEFT JOIN ACC_GROUP_T@ACCU_LINK agt on substr(act.accept_no,0,8) = agt.group_no \n" +
" LEFT JOIN GAJG_DM gajg on substr(act.upload_no,0,9) = gajg.gajg_dm\n"+
" WHERE agt.group_no not in (select GROUP_NO.group_no from GROUP_NO) " +
" and to_char(IMPORT_TIME,'yyyymmdd') = #{submitDate} " +
" and gajg.gajg_dm = #{Gajg} " +
......@@ -203,7 +211,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},ISSUED_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState1(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -213,7 +220,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},PRINT_OUT_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState2(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -223,7 +229,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},POSITION_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState3(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -233,7 +238,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},CONCORA_CRUSH_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState4(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -243,7 +247,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},PUNCHING_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState5(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -253,7 +256,6 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},SORTING_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState6(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
......@@ -263,9 +265,39 @@ public interface TaskListMapper {
* @param taskId
* @return
*/
//todo 编写上传工序SQL
@Update("UPDATE TASK SET TASK_STATE_ID=#{process},CONNECT_NAME=#{name} WHERE TASK_ID = #{taskId} ")
public boolean updateState7(@Param("taskId") String taskId,@Param("process") String process,@Param("name") String name);
/**
*查询快证是否存在受理库
* @param groupNo
* @return
*/
@Select("select DISTINCT CARD_TYPE_DIC.card_type_id, ACC_GROUP_T.group_no ,ACC_GROUP_T.valid_count,ACC_GROUP_T.invalid_count, county_dic.county_code\n" +
"from ACC_CARD_T@ACCU_LINK \n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH = acc_card_t.upload_no\n" +
"left join ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\n" +
"left join CARD_TYPE_DIC on PREPRO_PERSON.card_type_id = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE is not null and ACC_GROUP_T.deal_flag =3\n" +
"and ACC_GROUP_T.group_no =#{groupNo}")
public List<Object> selectFastCardAtACCU(@Param("groupNo") String groupNo);
/**
* 查询任务单详情
* @param taskId
* @return
*/
@Select("select * from task where task_ID = #{taskId}")
public List<TaskEntity> selectTaskEntityByTaskId(long taskId);
/**
* 保存快证任务单
* 辅助库
* @param taskEntity
* @return
*/
public boolean saveTask(TaskEntity taskEntity);
}
......@@ -2,10 +2,14 @@ package com.yxproject.start.service;
import com.yxproject.start.entity.GroupNoEntity;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/6 21:12
*/
public interface GroupNoService {
public boolean saveGroupNo(GroupNoEntity groupNoEntity);
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo);
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.SpecialCardEntity;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:10
*/
public interface SpecialCardService {
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity);
public List<SpecialCardEntity> selectSpecialCardAtSpecialCard(String acceptNo);
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity);
}
package com.yxproject.start.service;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity;
import com.yxproject.start.entity.TaskList.CountGajgEntity;
......@@ -33,4 +34,12 @@ public interface TaskListService {
public boolean saveTask(TaskEntity taskEntity);
public boolean saveTask(List<Object> list,String submitName,String process);
public List<Object> selectFastCardAtACCU(String groupNo);
public boolean saveFastTask(List<Object> list,String submitName,String acceptNo,long cardType);
public List<TaskEntity> selectTaskEntityByTaskId(long taskId);
public boolean saveFastTask(TaskEntity taskEntity);
}
......@@ -6,6 +6,8 @@ import com.yxproject.start.service.GroupNoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/6 21:12
......@@ -23,4 +25,24 @@ public class GroupNoServiceImpl implements GroupNoService {
public boolean saveGroupNo(GroupNoEntity groupNoEntity) {
return groupNoMapper.saveGroupNo(groupNoEntity);
}
/**
* 查询组号详情
* @param groupNo 组号
* @return
*/
@Override
public List<GroupNoEntity> selectGroupNoEntityByGroupNo(String groupNo) {
return groupNoMapper.selectGroupNoEntityByGroupNo(groupNo);
}
/**
* 更新组号详情的特证数量
* @param groupNoEntity
* @return
*/
@Override
public boolean updateGroupNoSpecialCount(GroupNoEntity groupNoEntity) {
return groupNoMapper.updateGroupNoSpecialCount(groupNoEntity);
}
}
package com.yxproject.start.service.impl;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.service.SpecialCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @auther zhangyusheng
* 2019/3/8 21:10
*/
@Service
public class SpecialCardServiceImpl implements SpecialCardService {
@Autowired
private SpecialCardMapper specialCardMapper;
/**
* 保存特证信息
* @param specialCardEntity
* @return
*/
@Override
public boolean saveSpecialCard(SpecialCardEntity specialCardEntity) {
return specialCardMapper.saveSpecialCard(specialCardEntity);
}
/**
* 查询快证是否存在于特证表中
* @param acceptNo 特证手里组号
* @return
*/
@Override
public List<SpecialCardEntity> selectSpecialCardAtSpecialCard(String acceptNo) {
return specialCardMapper.selectSpecialCardByAcceptNo(acceptNo);
}
/**
* 更新特证的受理类型
* @param specialCardEntity
* @return
*/
@Override
public boolean updateSpecialCardSpecialType(SpecialCardEntity specialCardEntity) {
return specialCardMapper.updateSpecialCardSpecialType(specialCardEntity);
}
}
package com.yxproject.start.service.impl;
import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.SpecialCardEntity;
import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity;
import com.yxproject.start.entity.TaskList.CountGajgEntity;
import com.yxproject.start.entity.TaskList.TaskListEntity;
import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.SpecialCardMapper;
import com.yxproject.start.mapper.TaskListMapper;
import com.yxproject.start.service.TaskListService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.jws.Oneway;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
......@@ -26,6 +25,8 @@ public class TaskListServiceImpl implements TaskListService {
private TaskListMapper taskListMapper;
@Autowired
private GroupNoMapper groupNoMapper;
@Autowired
private SpecialCardMapper specialCardMapper;
@Override
public List<CountCountyEntity> selectByCounty(String submitDate) {
......@@ -226,11 +227,6 @@ public class TaskListServiceImpl implements TaskListService {
list = formateMap(mapList_common);
list.addAll(mapList_fast);
list.addAll(mapList_remaind);
//todo 写逻辑0.0........
return list;
}
......@@ -297,6 +293,86 @@ public class TaskListServiceImpl implements TaskListService {
return true;
}
/**
* 查询快证在受理库信息
* @param groupNo 组号
* @return
*/
@Override
public List<Object> selectFastCardAtACCU(String groupNo) {
return taskListMapper.selectFastCardAtACCU(groupNo);
}
/**
* 保存快证任务单
* @param list
* @param submitName
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveFastTask(List<Object> list, String submitName,String acceptNo,long cardType) {
//保存普通证件信息
Map<String,Object> stringObjectMap =(Map<String,Object>)list.get(0);
TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType(cardType);
taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+"");
taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId((long)0);
saveTask(taskEntity);
for (Object object :list){
Map<String,Object> map =(Map<String,Object>)object;
GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(map.get("GROUP_NO")+"");
groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT")+""));
groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT")+""));
groupNoEntity.setSpecialCardCount((long)1);
groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity);
}
//保存快证件信息
TaskEntity fastTaskEntity = new TaskEntity();
fastTaskEntity.setCardType((long)1);
fastTaskEntity.setOldCardType(cardType);
fastTaskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+"");
fastTaskEntity.setSubmitName(submitName);
fastTaskEntity.setTaskStateId((long)1);
taskListMapper.saveFastTask(fastTaskEntity);
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
specialCardEntity.setTaskId(fastTaskEntity.getTaskId());
specialCardEntity.setSpecialType((long)2);
specialCardEntity.setInitiator(submitName);
specialCardMapper.saveSpecialCard(specialCardEntity);
return true;
}
/**
* 查询任务单详情
* @param taskId 任务单流水号
* @return
*/
@Override
public List<TaskEntity> selectTaskEntityByTaskId(long taskId) {
return taskListMapper.selectTaskEntityByTaskId(taskId);
}
/**
* 保存快证任务单
* 辅助库
* @param taskEntity
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public boolean saveFastTask(TaskEntity taskEntity) {
return taskListMapper.saveFastTask(taskEntity);
}
private String createGroupNo(List<Integer> c, List<Integer> nsList) {
try {
String groupNo = "";
......
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