Commit 7550fcb8 authored by dahai's avatar dahai

添加并修改添加退证API

parent 0c011dae
package com.yxproject.start.api;
import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.PreproPersonEntity;
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.PreproPersonService;
import com.yxproject.start.service.SpecialCardService;
import com.yxproject.start.service.TaskListService;
import com.yxproject.start.utils.YXJSONResponse;
......@@ -38,6 +40,8 @@ public class TaskListApi {
private SpecialCardService specialCardService;
@Autowired
private GroupNoService groupNoService;
@Autowired
private PreproPersonService preproPersonService;
/**
* 查询以区为单位的制证数量
......@@ -204,8 +208,9 @@ public class TaskListApi {
* 生成快证任务单
* <p>
* name 提交人姓名
* groupList 组号列表
* countyList 区县列表 {typeCode:1,countyCode:'123456'}
* acceptNo 受理组号
* cardType 制证类型(原有)
* countyCode 区县代码
*
* @return
*/
......@@ -224,40 +229,40 @@ public class TaskListApi {
//查询快证是否存在受理库
List<Object> objects = taskListService.selectFastCardAtACCU(acceptNo.substring(0, 8));
//存在受理库
if (objects.size()==1){
taskListService.saveFastTask(objects,name,acceptNo,Long.valueOf(cardType));
}else{
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);
if (specialCardEntities.size() > 0) {
for (SpecialCardEntity specialCardEntity : specialCardEntities) {
specialCardEntity.setSpecialType((long) 2);
specialCardService.updateSpecialCardSpecialType(specialCardEntity);
}
}else {
} 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);
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.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.setSpecialType((long) 2);
specialCardEntity.setInitiator(name);
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0,8));
specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
specialCardEntity.setTaskId(taskEntity.getTaskId());
specialCardService.saveSpecialCard(specialCardEntity);
}
......@@ -267,9 +272,50 @@ public class TaskListApi {
}
return null;
return "成功添加快证任务单";
}
/**
* 生成退证
* name 提交人姓名
* acceptNo 受理组号
* taskId 任务单流水号
*
* @return
*/
@RequestMapping("addBackCard")
@Transactional
public String addBackCard(@RequestBody String object, HttpServletResponse resp) {
JSONObject jsonObject = JSONObject.fromObject(object);
String acceptNo = jsonObject.getString("acceptNo");
String taskId = jsonObject.getString("taskId");
String name = jsonObject.getString("name");
List<Object> objects = preproPersonService.selectUploadNoByAcceptNo(acceptNo);
for (Object o :objects){
PreproPersonEntity preproPersonEntity = new PreproPersonEntity();
Map<String,Object> map=(Map<String,Object>)o;
preproPersonEntity.setJmsfzslh(map.get("UPLOAD_NO").toString());
preproPersonEntity.setIsValid(0);
preproPersonService.updatePreproPersonIsValid(preproPersonEntity);
}
//存在任务单
//更改组号详情的特证数量+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);
}
SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setSpecialType((long) 3);
specialCardEntity.setInitiator(name);
specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
specialCardEntity.setTaskId(Long.valueOf(taskId));
specialCardService.saveSpecialCard(specialCardEntity);
}
return "成功添加退证";
}
/**
* 字符串去除空格
......
......@@ -419,6 +419,7 @@ public class PersonPostEntity {
this.formDeadline = formDeadline;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......@@ -460,6 +461,7 @@ public class PersonPostEntity {
Objects.equals(printDate, that.printDate) &&
Objects.equals(formStartTime, that.formStartTime) &&
Objects.equals(id, that.id) &&
Objects.equals(formDeadline, that.formDeadline);
}
......
......@@ -39,6 +39,8 @@ public class PreproPersonEntity {
private Long newFileId;
private Long state;
private long id;
private long isValid;
@Id
@Column(name = "ID")
public long getId() {
......@@ -328,7 +330,15 @@ public class PreproPersonEntity {
public void setState(Long state) {
this.state = state;
}
@Basic
@Column(name = "IS_VALID")
public long getIsValid() {
return isValid;
}
public void setIsValid(long isValid) {
this.isValid = isValid;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
......@@ -362,11 +372,12 @@ public class PreproPersonEntity {
Objects.equals(cardTypeId, that.cardTypeId) &&
Objects.equals(newFileId, that.newFileId) &&
Objects.equals(id, that.id) &&
Objects.equals(isValid, that.isValid) &&
Objects.equals(state, that.state);
}
@Override
public int hashCode() {
return Objects.hash(id,jmsfzslh, gmsfhm, xm, xbdm, mzdm, csrq, ssxqdm, dzmc, sdxp, zwyZwtxsj, zwyZwtzsj, zweZwtxsj, zweZwtzsj, qfjgGajgmc, yxqqsrq, yxqjzrq, jmsfzslyydm, jmsfzzzlxdm, jmsfzlzfsdm, sjrXm, sjrLxdh, sjrYzbm, sjrTxdz, sid, fileId, cardTypeId, newFileId, state);
return Objects.hash(id,jmsfzslh, gmsfhm, xm, xbdm, mzdm, isValid,csrq, ssxqdm, dzmc, sdxp, zwyZwtxsj, zwyZwtzsj, zweZwtxsj, zweZwtzsj, qfjgGajgmc, yxqqsrq, yxqjzrq, jmsfzslyydm, jmsfzzzlxdm, jmsfzlzfsdm, sjrXm, sjrLxdh, sjrYzbm, sjrTxdz, sid, fileId, cardTypeId, newFileId, state);
}
}
......@@ -62,4 +62,23 @@ public interface PreproPersonMapper {
@Update("UPDATE PREPRO_PERSON SET NEW_FILE_ID=#{newFileId} where JMSFZSLH=#{jmsfzslh}")
public boolean updateNewFileName(PreproPersonEntity personEntity);
/**
* 更新制证数据是否有效
* @param personEntity
* @return
*/
@Update("UPDATE PREPRO_PERSON SET IS_VALID=#{isValid} where JMSFZSLH=#{jmsfzslh}")
public boolean updatePreproPersonIsValid(PreproPersonEntity personEntity);
/**
* 查询制证信息的上传受理号
* 受理库和制证库
* @param acceptNo 受理组号
* @return
*/
@Select("select UPLOAD_NO,ACCEPT_NO from ACC_CARD_T@ACCU_LINK WHERE ACCEPT_NO =#{acceptNo}\n" +
"UNION all \n" +
"select UPLOAD_NO,ACCEPT_NO from PROD_CARD_T@PROD_LINK WHERE ACCEPT_NO =#{acceptNo}")
public List<Object> selectUploadNoByAcceptNo(String acceptNo);
}
\ No newline at end of file
......@@ -12,6 +12,9 @@ public interface PreproPersonService {
public boolean uploadState(String acceptNo,String state);
public List<Object> selectUploadNoByAcceptNo(String acceptNo);
public boolean updatePreproPersonIsValid(PreproPersonEntity preproPersonEntity);
public List<PreproPersonEntity> selectPreproPerson(String uploadNo, String IDCard, String oldFile, String newFile, String SSXQDM, String cardType, String state, String uploadDate);
......
......@@ -27,6 +27,18 @@ public class PreproPersonServiceImpl implements PreproPersonService {
List<PreproPersonEntity> preproPersonEntities = preproPersonMapper.selectPreproPerson(replace(uploadNo), replace(IDCard), replace(oldFile), replace(newFile), replace(SSXQDM), replace(cardType), replace(state), replace(uploadDate));
return preproPersonEntities;
}
/**
* 更新制证数据是否有效
* @param preproPersonEntity
* @return
*/
@Override
public boolean updatePreproPersonIsValid(PreproPersonEntity preproPersonEntity) {
return preproPersonMapper.updatePreproPersonIsValid(preproPersonEntity);
}
private String replace(String str){
if ("".equals(str)){
return null;
......@@ -49,4 +61,14 @@ public class PreproPersonServiceImpl implements PreproPersonService {
return true;
}
/**
* 查询制证信息中
* @param acceptNo
* @return
*/
@Override
public List<Object> selectUploadNoByAcceptNo(String acceptNo) {
return preproPersonMapper.selectUploadNoByAcceptNo(acceptNo);
}
}
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