Commit a2d94781 authored by Administrator's avatar Administrator

Merge branch 'dev' of http://121.22.111.250:8000/zhangyusheng/YX_IDENT_REFACTORING into dev

# Conflicts:
#	src/main/java/com/yxproject/start/api/UserInfoApi.java
parents a25d8490 ade1220f
...@@ -63,6 +63,11 @@ ...@@ -63,6 +63,11 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.13</version>
</dependency>
<!--引入log4j2作为日志组件--> <!--引入log4j2作为日志组件-->
<!--<dependency>--> <!--<dependency>-->
......
...@@ -463,11 +463,11 @@ public class UserInfoApi { ...@@ -463,11 +463,11 @@ public class UserInfoApi {
@Path("findProductionTaskListByState") @Path("findProductionTaskListByState")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String findProductionTaskListByState(@RequestParam("state") String state, @Context HttpServletResponse resp){ public String findProductionTaskListByState(@QueryParam("state") String state, @Context HttpServletResponse resp){
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<ProductionTaskListEntity> taskListEntityList = productionTaskListService.findProductionTaskListEntityByState(Integer.valueOf(state)); List<Map<String, Object>> productionTaskInfoList = productionTaskListService.findProductionTaskListEntityByState(Integer.valueOf(state));
yxjsonResponse.outPutSuccess(taskListEntityList); yxjsonResponse.outPutSuccess(productionTaskInfoList);
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
...@@ -489,7 +489,7 @@ public class UserInfoApi { ...@@ -489,7 +489,7 @@ public class UserInfoApi {
/** /**
* 打印装箱单 * 下载装箱单
*/ */
@GET @GET
@Path("printPackingList") @Path("printPackingList")
...@@ -630,18 +630,18 @@ public class UserInfoApi { ...@@ -630,18 +630,18 @@ public class UserInfoApi {
row.setHeightInPoints(Short.parseShort("16"));//设置行高 row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据 //创建单元格并且添加数据
cell = row.createCell(0); cell = row.createCell(0);
cell.setCellValue((String) map.get("countyName")); cell.setCellValue((String) map.get("COUNTYNAME"));
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(map.get("download").toString().equals("0") ? "" : map.get("download").toString()); cell.setCellValue(map.get("DOWNLOAD").toString().equals("0") ? "" : map.get("DOWNLOAD").toString());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellValue(((Integer.parseInt(map.get("download").toString()) % 250==0?Integer.parseInt(map.get("download").toString()) / 250:Integer.parseInt(map.get("download").toString()) / 250+1)) + ""); cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250==0?Integer.parseInt(map.get("DOWNLOAD").toString()) / 250:Integer.parseInt(map.get("DOWNLOAD").toString()) / 250+1)) + "");
num += ((Integer.parseInt(map.get("download").toString()) % 250==0?Integer.parseInt(map.get("download").toString()) / 250:Integer.parseInt(map.get("download").toString()) / 250+1)); num += ((Integer.parseInt(map.get("DOWNLOAD").toString()) % 250==0?Integer.parseInt(map.get("DOWNLOAD").toString()) / 250:Integer.parseInt(map.get("DOWNLOAD").toString()) / 250+1));
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
...@@ -844,7 +844,7 @@ public class UserInfoApi { ...@@ -844,7 +844,7 @@ public class UserInfoApi {
for (int a = 0; a < countyInfoList.size(); a++) { for (int a = 0; a < countyInfoList.size(); a++) {
Map<String, Object> map = countyInfoList.get(a); Map<String, Object> map = countyInfoList.get(a);
//第二步创建sheet //第二步创建sheet
if (map.get("countyName").toString().contains("区")) { if (map.get("COUNTYNAME").toString().contains("区")) {
//第三步创建行row:添加表头0行 //第三步创建行row:添加表头0行
row = mergeSheet.createRow(0); row = mergeSheet.createRow(0);
row.setHeightInPoints(Short.parseShort("20"));//设置行高 row.setHeightInPoints(Short.parseShort("20"));//设置行高
...@@ -899,19 +899,19 @@ public class UserInfoApi { ...@@ -899,19 +899,19 @@ public class UserInfoApi {
row.setHeightInPoints(Short.parseShort("16"));//设置行高 row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据 //创建单元格并且添加数据
cell = row.createCell(0); cell = row.createCell(0);
cell.setCellValue(map.get("countyName").toString()); cell.setCellValue(map.get("COUNTYNAME").toString());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(map.get("download") + ""); cell.setCellValue(map.get("DOWNLOAD") + "");
mergeSum += Integer.valueOf(map.get("download") + ""); mergeSum += Integer.valueOf(map.get("DOWNLOAD") + "");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellStyle(style); cell.setCellStyle(style);
cell.setCellValue(((Integer.parseInt(map.get("download") + "") % 250==0?Integer.parseInt(map.get("download") + "") / 250:Integer.parseInt(map.get("download") + "") / 250+1)) + ""); cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250==0?Integer.parseInt(map.get("DOWNLOAD") + "") / 250:Integer.parseInt(map.get("DOWNLOAD") + "") / 250+1)) + "");
boxNum += ((Integer.parseInt(map.get("download") + "") % 250==0?Integer.parseInt(map.get("download") + "") / 250:Integer.parseInt(map.get("download") + "") / 250+1)); boxNum += ((Integer.parseInt(map.get("DOWNLOAD") + "") % 250==0?Integer.parseInt(map.get("DOWNLOAD") + "") / 250:Integer.parseInt(map.get("DOWNLOAD") + "") / 250+1));
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
...@@ -1025,7 +1025,7 @@ public class UserInfoApi { ...@@ -1025,7 +1025,7 @@ public class UserInfoApi {
mergeSheet.addMergedRegion(callRangeb); mergeSheet.addMergedRegion(callRangeb);
lineNum++; lineNum++;
} else { } else {
sheet = wb.createSheet(a + "-" + (String) map.get("countyName")); sheet = wb.createSheet(a + "-" + (String) map.get("COUNTYNAME"));
sheet.setColumnWidth(0, (int) 30 * 100); sheet.setColumnWidth(0, (int) 30 * 100);
sheet.setColumnWidth(1, (int) 30 * 70); sheet.setColumnWidth(1, (int) 30 * 70);
...@@ -1093,17 +1093,17 @@ public class UserInfoApi { ...@@ -1093,17 +1093,17 @@ public class UserInfoApi {
row.setHeightInPoints(Short.parseShort("16"));//设置行高 row.setHeightInPoints(Short.parseShort("16"));//设置行高
//创建单元格并且添加数据 //创建单元格并且添加数据
cell = row.createCell(0); cell = row.createCell(0);
cell.setCellValue(map.get("countyName").toString()); cell.setCellValue(map.get("COUNTYNAME").toString());
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(map.get("download") + ""); cell.setCellValue(map.get("DOWNLOAD") + "");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellStyle(style); cell.setCellStyle(style);
cell.setCellValue(((Integer.parseInt(map.get("download") + "") % 250==0?Integer.parseInt(map.get("download") + "") / 250:Integer.parseInt(map.get("download") + "") / 250+1)) + ""); cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250==0?Integer.parseInt(map.get("DOWNLOAD") + "") / 250:Integer.parseInt(map.get("DOWNLOAD") + "") / 250+1)) + "");
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(""); cell.setCellValue("");
cell.setCellStyle(style); cell.setCellStyle(style);
...@@ -1128,7 +1128,7 @@ public class UserInfoApi { ...@@ -1128,7 +1128,7 @@ public class UserInfoApi {
cell.setCellValue("合计"); cell.setCellValue("合计");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(1); cell = row.createCell(1);
cell.setCellValue(Integer.valueOf(map.get("download") + "")); cell.setCellValue(Integer.valueOf(map.get("DOWNLOAD") + ""));
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(2); cell = row.createCell(2);
cell.setCellValue("制证车间"); cell.setCellValue("制证车间");
...@@ -1144,7 +1144,7 @@ public class UserInfoApi { ...@@ -1144,7 +1144,7 @@ public class UserInfoApi {
} }
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(3); cell = row.createCell(3);
cell.setCellValue(((Integer.parseInt(map.get("download") + "") % 250==0?Integer.parseInt(map.get("download") + "") / 250:Integer.parseInt(map.get("download") + "") / 250+1)) + ""); cell.setCellValue(((Integer.parseInt(map.get("DOWNLOAD") + "") % 250==0?Integer.parseInt(map.get("DOWNLOAD") + "") / 250:Integer.parseInt(map.get("DOWNLOAD") + "") / 250+1)) + "");
cell.setCellStyle(style); cell.setCellStyle(style);
cell = row.createCell(4); cell = row.createCell(4);
cell.setCellValue(permanentPositionDate); cell.setCellValue(permanentPositionDate);
...@@ -1222,8 +1222,8 @@ public class UserInfoApi { ...@@ -1222,8 +1222,8 @@ public class UserInfoApi {
//第六步将生成excel文件保存到指定路径下 //第六步将生成excel文件保存到指定路径下
FileOutputStream fout = null; FileOutputStream fout = null;
try { try {
fout = new FileOutputStream("E:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("countyName") + ".xls"); fout = new FileOutputStream("F:\\Excel\\" + simpleDateFormat.format(new Date()) + countyInfoList.get(0).get("COUNTYNAME") + ".xls");
// fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("countyName") + ".xls"); // fout = new FileOutputStream("D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls");
wb.write(fout); wb.write(fout);
fout.close(); fout.close();
} catch (IOException e) { } catch (IOException e) {
...@@ -1231,8 +1231,8 @@ public class UserInfoApi { ...@@ -1231,8 +1231,8 @@ public class UserInfoApi {
} }
System.out.println("Excel文件生成成功..." + new Date()); System.out.println("Excel文件生成成功..." + new Date());
return "E:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("countyName") + ".xls"; return "F:\\Excel\\" + simpleDateFormat.format(new Date()) +countyInfoList.get(0).get("COUNTYNAME") + ".xls";
// return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("countyName") + ".xls"; // return "D:\\" + simpleDateFormat.format(new Date()) + list.get(0).getString("COUNTYNAME") + ".xls";
} }
......
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* Created by zhangyusheng on 2018/11/7 14:04
*/
@Entity
@Table(name = "ACCEPT_NO_INFO", schema = "DAHAI", catalog = "")
public class AcceptNoInfoEntity {
private String accept_No_Info_Id;
private String accept_No;
private String cyclesheetid;
private Long accept_Type;
private String group_No;
@Id
@Column(name = "ACCEPT_NO_INFO_ID", nullable = false, length = 20)
public String getAccept_No_Info_Id() {
return accept_No_Info_Id;
}
public void setAccept_No_Info_Id(String accept_No_Info_Id) {
this.accept_No_Info_Id = accept_No_Info_Id;
}
@Basic
@Column(name = "ACCEPT_NO", nullable = true, length = 20)
public String getAccept_No() {
return accept_No;
}
public void setAccept_No(String accept_No) {
this.accept_No = accept_No;
}
@Basic
@Column(name = "ACCEPT_TYPE", nullable = true, precision = 0)
public Long getAccept_Type() {
return accept_Type;
}
public void setAccept_Type(Long accept_Type) {
this.accept_Type = accept_Type;
}
@Basic
@Column(name = "CYCLESHEETID", nullable = true, length = 20)
public String getCyclesheetid() {
return cyclesheetid;
}
public void setCyclesheetid(String cyclesheetid) {
this.cyclesheetid = cyclesheetid;
}
@Basic
@Column(name = "GROUP_NO", nullable = true, length = 20)
public String getGroup_No() {
return group_No;
}
public void setGroup_No(String group_No) {
this.group_No = group_No;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
AcceptNoInfoEntity that = (AcceptNoInfoEntity) o;
return Objects.equals(accept_No_Info_Id, that.accept_No_Info_Id) &&
Objects.equals(accept_No, that.accept_No) &&
Objects.equals(cyclesheetid, that.cyclesheetid) &&
Objects.equals(group_No, that.group_No) &&
Objects.equals(accept_Type, that.accept_Type);
}
@Override
public int hashCode() {
return Objects.hash(accept_No_Info_Id, accept_No, cyclesheetid, accept_Type,group_No);
}
}
...@@ -9,10 +9,9 @@ public class GroupinfoEntity { ...@@ -9,10 +9,9 @@ public class GroupinfoEntity {
private String groupid; private String groupid;
private String groupno; private String groupno;
private String cyclesheetid; private String cyclesheetid;
private Long grouptype;
private Long valid_Count; private Long valid_Count;
private Long invalid_Count; private Long invalid_Count;
private Long special_Card_Count;
@Id @Id
@Column(name = "GROUPID", nullable = false, length = 20) @Column(name = "GROUPID", nullable = false, length = 20)
...@@ -44,16 +43,6 @@ public class GroupinfoEntity { ...@@ -44,16 +43,6 @@ public class GroupinfoEntity {
this.cyclesheetid = cyclesheetid; this.cyclesheetid = cyclesheetid;
} }
@Basic
@Column(name = "GROUPTYPE", nullable = true, precision = 0)
public Long getGrouptype() {
return grouptype;
}
public void setGrouptype(Long grouptype) {
this.grouptype = grouptype;
}
@Basic @Basic
@Column(name = "VAILD_COUNT", nullable = true, precision = 0) @Column(name = "VAILD_COUNT", nullable = true, precision = 0)
public Long getValid_Count() { public Long getValid_Count() {
...@@ -73,7 +62,15 @@ public class GroupinfoEntity { ...@@ -73,7 +62,15 @@ public class GroupinfoEntity {
public void setInvalid_Count(Long invalid_Count) { public void setInvalid_Count(Long invalid_Count) {
this.invalid_Count = invalid_Count; this.invalid_Count = invalid_Count;
} }
@Basic
@Column(name = "SPECIAL_CARD_COUNT", nullable = true, precision = 0)
public Long getSpecial_Card_Count() {
return special_Card_Count;
}
public void setSpecial_Card_Count(Long special_Card_Count) {
this.special_Card_Count = special_Card_Count;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
...@@ -82,13 +79,14 @@ public class GroupinfoEntity { ...@@ -82,13 +79,14 @@ public class GroupinfoEntity {
return Objects.equals(groupid, that.groupid) && return Objects.equals(groupid, that.groupid) &&
Objects.equals(groupno, that.groupno) && Objects.equals(groupno, that.groupno) &&
Objects.equals(cyclesheetid, that.cyclesheetid) && Objects.equals(cyclesheetid, that.cyclesheetid) &&
Objects.equals(grouptype, that.grouptype) &&
Objects.equals(valid_Count, that.valid_Count) && Objects.equals(valid_Count, that.valid_Count) &&
Objects.equals(special_Card_Count, that.special_Card_Count) &&
Objects.equals(invalid_Count, that.invalid_Count); Objects.equals(invalid_Count, that.invalid_Count);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(groupid, groupno, cyclesheetid, grouptype, valid_Count, invalid_Count); return Objects.hash(groupid, groupno, cyclesheetid, valid_Count, special_Card_Count,invalid_Count);
} }
} }
package com.yxproject.start.mapper;
import com.yxproject.start.entity.AcceptNoInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Created by zhangyusheng on 2018/11/7 15:06
*/
@Mapper
public interface AcceptNoInfoMapper {
public List<AcceptNoInfoEntity> findAcceptNoInfoEntityByAcceptNo(String acceptNo);
public void saveAcceptNoInfoEntity(AcceptNoInfoEntity acceptNoInfoEntity);
public void updateAcceptNoInfoEntity(AcceptNoInfoEntity acceptNoInfoEntity);
public List<AcceptNoInfoEntity> findAcceptNoInfoEntityByGroupNo(String groupNo);
}
...@@ -20,10 +20,10 @@ public interface GroupinfoMapper { ...@@ -20,10 +20,10 @@ public interface GroupinfoMapper {
public List<GroupinfoEntity> findGroupinfoEntityListByProductionTaskListId(String cyclesheetid); public List<GroupinfoEntity> findGroupinfoEntityListByProductionTaskListId(String cyclesheetid);
public List<Map<String, Object>> findCountyInfoList8_10(String groupinfo10, String groupinfo8); public int findGroupInfoCountByProductionTaskListId(String cyclesheetid);
public List<Map<String, Object>> findCountyInfoList8(String groupinfo8); public List<Map<String,Object>> findSpecialCountyList(String cyclesheetid);
public List<Map<String, Object>> findCountyInfoList10(String groupinfo10); public List<Map<String,Object>> findNormalCountyList(String cyclesheetid);
} }
...@@ -26,8 +26,11 @@ public interface UtilMapper { ...@@ -26,8 +26,11 @@ public interface UtilMapper {
/** /**
* 查询废证信息表序列值 * 查询废证信息表序列值
*/ */
@Select(" select FAILEDINFO_SEQ.nextval from dual")
public int findFailedinfoSequenceNextValue(); public int findFailedinfoSequenceNextValue();
/**
* 查询受理号表序列值
*/
public int findAcceptInfoSequenceNextValue();
} }
...@@ -6,6 +6,7 @@ import com.yxproject.start.entity.PoliceStationVailedInfoEntity; ...@@ -6,6 +6,7 @@ import com.yxproject.start.entity.PoliceStationVailedInfoEntity;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
import java.util.List; import java.util.List;
import java.util.Map;
public interface ProductionTaskListService { public interface ProductionTaskListService {
...@@ -25,7 +26,7 @@ public interface ProductionTaskListService { ...@@ -25,7 +26,7 @@ public interface ProductionTaskListService {
public List<PoliceStationVailedInfoEntity> find(String id); public List<PoliceStationVailedInfoEntity> find(String id);
public List<ProductionTaskListEntity> findProductionTaskListEntityByState(int state); public List<Map<String,Object>> findProductionTaskListEntityByState(int state);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.GroupinfoEntity;
import com.yxproject.start.mapper.GroupinfoMapper; import com.yxproject.start.mapper.GroupinfoMapper;
import com.yxproject.start.service.GroupinfoService; import com.yxproject.start.service.GroupinfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,46 +19,14 @@ public class GroupinfoServiceImpl implements GroupinfoService { ...@@ -20,46 +19,14 @@ public class GroupinfoServiceImpl implements GroupinfoService {
@Override @Override
public List<Map<String, Object>> findCountyInfoList(String cyclesheetid) { public List<Map<String, Object>> findCountyInfoList(String cyclesheetid) {
List<Map<String, Object>> countyInfoList = new ArrayList<>(); int count = groupinfoMapper.findGroupInfoCountByProductionTaskListId(cyclesheetid);
List<GroupinfoEntity> groupinfoEntityList = groupinfoMapper.findGroupinfoEntityListByProductionTaskListId(cyclesheetid); List<Map<String,Object>> list = new ArrayList<>();
List<String> groupnoLength10 = new ArrayList<String>(); if (count==0){
List<String> groupnoLength8 = new ArrayList<String>(); list = groupinfoMapper.findSpecialCountyList(cyclesheetid);
for (GroupinfoEntity groupinfoEntity : groupinfoEntityList) { }else{
if (groupinfoEntity.getGroupno().length() == 10) { list = groupinfoMapper.findNormalCountyList(cyclesheetid);
groupnoLength10.add(groupinfoEntity.getGroupno());
} else {
groupnoLength8.add(groupinfoEntity.getGroupno());
}
}
String group_no10 = "";
for (int i = 0; i < groupnoLength10.size(); i++) {
if (i != groupnoLength10.size() - 1) {
group_no10 += "'" + groupnoLength10.get(i) + "',";
} else {
group_no10 += "'" + groupnoLength10.get(i) + "'";
}
}
String group_no8 = "";
for (int i = 0; i < groupnoLength8.size(); i++) {
if (i != groupnoLength8.size() - 1) {
group_no8 += "'" + groupnoLength8.get(i) + "',";
} else {
group_no8 += "'" + groupnoLength8.get(i) + "'";
}
} }
//数组中有长度为10和8 的 return list;
if (groupnoLength8.size() != 0 && groupnoLength10.size() != 0) {
countyInfoList = groupinfoMapper.findCountyInfoList8_10(group_no10, group_no8);
} else if (groupnoLength8.size() == 0 && groupnoLength10.size() != 10) {
//数组中只有长度为10 的
countyInfoList = groupinfoMapper.findCountyInfoList10(group_no10);
} else if (groupnoLength8.size() != 0 && groupnoLength10.size() == 0) {
//数组中只有长度为8 的
countyInfoList = groupinfoMapper.findCountyInfoList8(group_no8);
}
return countyInfoList;
} }
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.AcceptNoInfoEntity;
import com.yxproject.start.entity.GroupinfoEntity; import com.yxproject.start.entity.GroupinfoEntity;
import com.yxproject.start.entity.PoliceStationVailedInfoEntity; import com.yxproject.start.entity.PoliceStationVailedInfoEntity;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
...@@ -13,10 +14,7 @@ import org.springframework.stereotype.Service; ...@@ -13,10 +14,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @author Administrator * @author Administrator
...@@ -42,9 +40,14 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -42,9 +40,14 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
@Autowired @Autowired
public PoliceStationVailedInfoMapper policeStationVailedInfoMapper; public PoliceStationVailedInfoMapper policeStationVailedInfoMapper;
@Autowired
public AcceptNoInfoMapper acceptNoInfoMapper;
/** /**
* 查询任务单 * 查询任务单
* 通过任务单ID * 通过任务单ID
*
* @param id * @param id
* @return * @return
*/ */
...@@ -56,13 +59,43 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -56,13 +59,43 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 更新任务单信息 * 更新任务单信息
* 通过新的任务单信息 * 通过新的任务单信息
*
* @param productionTaskListEntity * @param productionTaskListEntity
* @return * @return
*/ */
@Override @Override
public int updateProductionTask(ProductionTaskListEntity productionTaskListEntity) { public int updateProductionTask(ProductionTaskListEntity productionTaskListEntity) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
//todo 状态更新时间 //todo 状态更新时间
Long state = productionTaskListEntity.getState();
switch (Integer.valueOf(state.toString())) {
case 1:
productionTaskListEntity.setHandout_Date(simpleDateFormat.format(new Date()));
break;
case 2:
productionTaskListEntity.setDownload_Date(simpleDateFormat.format(new Date()));
break;
case 3:
productionTaskListEntity.setPrint_Out(simpleDateFormat.format(new Date()));
break;
case 4:
productionTaskListEntity.setPermanent_Position_Date(simpleDateFormat.format(new Date()));
break;
case 5:
productionTaskListEntity.setRoll_Out_Workshop_Date(simpleDateFormat.format(new Date()));
break;
case 6:
productionTaskListEntity.setQualityinspection_Date(simpleDateFormat.format(new Date()));
break;
case 7:
productionTaskListEntity.setPutinstorage_Date(simpleDateFormat.format(new Date()));
break;
case 8:
productionTaskListEntity.setOutbound_Date(simpleDateFormat.format(new Date()));
break;
default:
break;
}
return productionTaskListMapper.updateProductionTask(productionTaskListEntity); return productionTaskListMapper.updateProductionTask(productionTaskListEntity);
} }
...@@ -70,21 +103,21 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -70,21 +103,21 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
* 生成任务单并保存组号列表 * 生成任务单并保存组号列表
* *
* @param productionTaskListEntity 任务单详情 * @param productionTaskListEntity 任务单详情
* @param groupinfoEntities 组号列表 * @param groupinfoEntities 组号列表
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor = Exception.class)
public int addProductionTaskListEntity(ProductionTaskListEntity productionTaskListEntity, List<GroupinfoEntity> groupinfoEntities) { public int addProductionTaskListEntity(ProductionTaskListEntity productionTaskListEntity, List<GroupinfoEntity> groupinfoEntities) {
int production_task_list_seq = utilMapper.findProductionTaskListSequenceNextValue(); int production_task_list_seq = utilMapper.findProductionTaskListSequenceNextValue();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
productionTaskListEntity.setProduction_Task_List_Id(simpleDateFormat.format(new Date())+production_task_list_seq); productionTaskListEntity.setProduction_Task_List_Id(simpleDateFormat.format(new Date()) + production_task_list_seq);
productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntity); productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntity);
for (GroupinfoEntity groupinfoEntity:groupinfoEntities) { for (GroupinfoEntity groupinfoEntity : groupinfoEntities) {
int groupInfoSequenceValue = utilMapper.findGroupInfoSequenceNextValue(); int groupInfoSequenceValue = utilMapper.findGroupInfoSequenceNextValue();
groupinfoEntity.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValue); groupinfoEntity.setGroupid(simpleDateFormat.format(new Date()) + groupInfoSequenceValue);
groupinfoEntity.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seq); groupinfoEntity.setCyclesheetid(simpleDateFormat.format(new Date()) + production_task_list_seq);
groupinfoMapper.insertGroupinfoEntity(groupinfoEntity); groupinfoMapper.insertGroupinfoEntity(groupinfoEntity);
} }
...@@ -94,25 +127,26 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -94,25 +127,26 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 查询证件信息(搜索框) * 查询证件信息(搜索框)
* 包括受理库、制证库的证件信息,以及该证件所在任务单的详细情况 * 包括受理库、制证库的证件信息,以及该证件所在任务单的详细情况
*
* @param cardInfo * @param cardInfo
* @return * @return
*/ */
@Override @Override
public List<Object> findCardInfoByCardIDOrAcceptNo(String cardInfo) { public List<Object> findCardInfoByCardIDOrAcceptNo(String cardInfo) {
List<Object> list= new ArrayList<>(); List<Object> list = new ArrayList<>();
String accept_no =""; String accept_no = "";
List<AccCardTEntity> accCardTEntityByCardIdOrAcceptNo = accCardTMapper.findAccCardTEntityByCardIdOrAcceptNo(cardInfo); List<AccCardTEntity> accCardTEntityByCardIdOrAcceptNo = accCardTMapper.findAccCardTEntityByCardIdOrAcceptNo(cardInfo);
if (accCardTEntityByCardIdOrAcceptNo.size()!=0){ if (accCardTEntityByCardIdOrAcceptNo.size() != 0) {
list.addAll(accCardTEntityByCardIdOrAcceptNo); list.addAll(accCardTEntityByCardIdOrAcceptNo);
for (AccCardTEntity accCardTEntity :accCardTEntityByCardIdOrAcceptNo) { for (AccCardTEntity accCardTEntity : accCardTEntityByCardIdOrAcceptNo) {
accept_no=accCardTEntity.getAccept_No(); accept_no = accCardTEntity.getAccept_No();
} }
} }
List<ProdCardTEntity> prodCardTEntityByCardIdOrAcceptNo = prodCardTMapper.findCardInfo(cardInfo); List<ProdCardTEntity> prodCardTEntityByCardIdOrAcceptNo = prodCardTMapper.findCardInfo(cardInfo);
if (prodCardTEntityByCardIdOrAcceptNo.size()!=0){ if (prodCardTEntityByCardIdOrAcceptNo.size() != 0) {
list.addAll(prodCardTEntityByCardIdOrAcceptNo); list.addAll(prodCardTEntityByCardIdOrAcceptNo);
for (ProdCardTEntity prodCardTEntity:prodCardTEntityByCardIdOrAcceptNo) { for (ProdCardTEntity prodCardTEntity : prodCardTEntityByCardIdOrAcceptNo) {
accept_no = prodCardTEntity.getAccept_No() ; accept_no = prodCardTEntity.getAccept_No();
} }
} }
List<ProductionTaskListEntity> productionTaskListEntityByAcceptNo = productionTaskListMapper.findProductionTaskListEntityByAcceptNo(accept_no); List<ProductionTaskListEntity> productionTaskListEntityByAcceptNo = productionTaskListMapper.findProductionTaskListEntityByAcceptNo(accept_no);
...@@ -123,37 +157,39 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -123,37 +157,39 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 添加快证 * 添加快证
* 包含已经下发的任务单、没有下发的任务单 * 包含已经下发的任务单、没有下发的任务单
*
* @param cardInfo * @param cardInfo
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor = Exception.class)
public int addQuickCyclesheetInfo(String cardInfo) { public int addQuickCyclesheetInfo(String cardInfo) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
/** /**
* 查询证件的受理号 * 查询证件的受理号
*/ */
String accept_no =""; String accept_no = "";
List<AccCardTEntity> accCardTEntityByCardIdOrAcceptNo = accCardTMapper.findAccCardTEntityByCardIdOrAcceptNo(cardInfo); List<AccCardTEntity> accCardTEntityByCardIdOrAcceptNo = accCardTMapper.findAccCardTEntityByCardIdOrAcceptNo(cardInfo);
if (accCardTEntityByCardIdOrAcceptNo.size()!=0){ if (accCardTEntityByCardIdOrAcceptNo.size() != 0) {
for (AccCardTEntity accCardTEntity :accCardTEntityByCardIdOrAcceptNo) { for (AccCardTEntity accCardTEntity : accCardTEntityByCardIdOrAcceptNo) {
accept_no=accCardTEntity.getAccept_No(); accept_no = accCardTEntity.getAccept_No();
} }
} }
List<ProdCardTEntity> prodCardTEntityByCardIdOrAcceptNo = prodCardTMapper.findCardInfo(cardInfo); List<ProdCardTEntity> prodCardTEntityByCardIdOrAcceptNo = prodCardTMapper.findCardInfo(cardInfo);
if (prodCardTEntityByCardIdOrAcceptNo.size()!=0){ if (prodCardTEntityByCardIdOrAcceptNo.size() != 0) {
for (ProdCardTEntity prodCardTEntity:prodCardTEntityByCardIdOrAcceptNo) { for (ProdCardTEntity prodCardTEntity : prodCardTEntityByCardIdOrAcceptNo) {
accept_no = prodCardTEntity.getAccept_No() ; accept_no = prodCardTEntity.getAccept_No();
} }
} }
List<GroupinfoEntity> groupinfoEntityByAcceptNo = groupinfoMapper.findGroupinfoEntityByAcceptNo(accept_no); List<GroupinfoEntity> groupinfoEntityByAcceptNo = groupinfoMapper.findGroupinfoEntityByAcceptNo(accept_no);
List<AcceptNoInfoEntity> acceptNoInfoEntityList = acceptNoInfoMapper.findAcceptNoInfoEntityByAcceptNo(accept_no);
/** /**
* 没有下发任务单的情况 * 没有下发任务单的情况
* 即 在组号列表中没有没有该受理组号 * 即 在组号列表中没有没有该受理组号
*/ */
if (groupinfoEntityByAcceptNo.size()==0){ if (groupinfoEntityByAcceptNo.size() == 0) {
List<Map<String, Object>> entity = accCardTMapper.findAccGroupTEntityByCardIdOrAcceptNo(accept_no); List<Map<String, Object>> entity = accCardTMapper.findAccGroupTEntityByCardIdOrAcceptNo(accept_no);
for (Map<String,Object> map :entity){ for (Map<String, Object> map : entity) {
Object group_no = map.get("GROUP_NO"); Object group_no = map.get("GROUP_NO");
Object valid_count = map.get("VALID_COUNT"); Object valid_count = map.get("VALID_COUNT");
Object invalid_count = map.get("INVALID_COUNT"); Object invalid_count = map.get("INVALID_COUNT");
...@@ -163,130 +199,165 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -163,130 +199,165 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
*/ */
ProductionTaskListEntity productionTaskListEntity = new ProductionTaskListEntity(); ProductionTaskListEntity productionTaskListEntity = new ProductionTaskListEntity();
int production_task_list_seq = utilMapper.findProductionTaskListSequenceNextValue(); int production_task_list_seq = utilMapper.findProductionTaskListSequenceNextValue();
productionTaskListEntity.setProduction_Task_List_Id(simpleDateFormat.format(new Date()) + production_task_list_seq);
productionTaskListEntity.setProduction_Task_List_Id(simpleDateFormat.format(new Date())+production_task_list_seq); productionTaskListEntity.setCitycode(original_no.toString().substring(0, 6));
productionTaskListEntity.setCitycode(original_no.toString().substring(0,6)); productionTaskListEntity.setMake_Type(Long.valueOf(original_no.toString().substring(20, 21)));
productionTaskListEntity.setMake_Type(Long.valueOf(original_no.toString().substring(20,21)));
productionTaskListEntity.setSubmit_Date(simpleDateFormat.format(new Date())); productionTaskListEntity.setSubmit_Date(simpleDateFormat.format(new Date()));
productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntity); productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntity);
/** /**
* 生成原来任务单的组号列表 * 生成原来任务单的组号列表
* 原组号和快证组号 * 原组号
*/ */
int groupInfoSequenceValue = utilMapper.findGroupInfoSequenceNextValue(); int groupInfoSequenceValue = utilMapper.findGroupInfoSequenceNextValue();
GroupinfoEntity groupinfoEntity = new GroupinfoEntity(); GroupinfoEntity groupinfoEntity = new GroupinfoEntity();
groupinfoEntity.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValue); groupinfoEntity.setGroupid(simpleDateFormat.format(new Date()) + groupInfoSequenceValue);
groupinfoEntity.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seq); groupinfoEntity.setCyclesheetid(simpleDateFormat.format(new Date()) + production_task_list_seq);
groupinfoEntity.setGroupno(group_no.toString()); groupinfoEntity.setGroupno(group_no.toString());
groupinfoEntity.setInvalid_Count(Long.valueOf(invalid_count.toString())); groupinfoEntity.setInvalid_Count(Long.valueOf(invalid_count.toString()));
groupinfoEntity.setValid_Count(Long.valueOf(valid_count.toString())); groupinfoEntity.setValid_Count(Long.valueOf(valid_count.toString()));
groupinfoEntity.setSpecial_Card_Count((long) 1);
groupinfoMapper.insertGroupinfoEntity(groupinfoEntity); groupinfoMapper.insertGroupinfoEntity(groupinfoEntity);
int groupInfoSequenceValue2 = utilMapper.findGroupInfoSequenceNextValue();
GroupinfoEntity groupinfoEntity2 = new GroupinfoEntity();
groupinfoEntity2.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValue2);
groupinfoEntity2.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seq);
groupinfoEntity2.setGroupno(accept_no);
groupinfoEntity2.setGrouptype((long)1);
groupinfoEntity2.setInvalid_Count((long)0);
groupinfoEntity2.setValid_Count((long)-1);
groupinfoMapper.insertGroupinfoEntity(groupinfoEntity2);
/** /**
* 生成快证任务单并下发 * 生成快证任务单并下发
*/ */
ProductionTaskListEntity productionTaskListEntityQ = new ProductionTaskListEntity(); ProductionTaskListEntity productionTaskListEntityQ = new ProductionTaskListEntity();
int production_task_list_seqQ = utilMapper.findProductionTaskListSequenceNextValue(); int production_task_list_seqQ = utilMapper.findProductionTaskListSequenceNextValue();
productionTaskListEntityQ.setProduction_Task_List_Id(simpleDateFormat.format(new Date())+production_task_list_seqQ); productionTaskListEntityQ.setProduction_Task_List_Id(simpleDateFormat.format(new Date()) + production_task_list_seqQ);
productionTaskListEntityQ.setCitycode(original_no.toString().substring(0,6)); productionTaskListEntityQ.setCitycode(original_no.toString().substring(0, 6));
productionTaskListEntityQ.setMake_Type((long)1); productionTaskListEntityQ.setMake_Type((long) 1);
productionTaskListEntityQ.setOld_Make_Type(Long.valueOf(original_no.toString().substring(20,21))); productionTaskListEntityQ.setOld_Make_Type(Long.valueOf(original_no.toString().substring(20, 21)));
productionTaskListEntityQ.setSubmit_Date(simpleDateFormat.format(new Date())); productionTaskListEntityQ.setSubmit_Date(simpleDateFormat.format(new Date()));
productionTaskListEntityQ.setHandout_Date(simpleDateFormat.format(new Date())); productionTaskListEntityQ.setHandout_Date(simpleDateFormat.format(new Date()));
productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntityQ); productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntityQ);
// /**
// * 生成快证任务单的组号列表
// * 快证组号
// */
// int groupInfoSequenceValueQ = utilMapper.findGroupInfoSequenceNextValue();
// GroupinfoEntity groupinfoEntityQ = new GroupinfoEntity();
// groupinfoEntityQ.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValueQ);
// groupinfoEntityQ.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seqQ);
// groupinfoEntityQ.setGroupno(accept_no);
// groupinfoEntityQ.setInvalid_Count((long)0);
// groupinfoEntityQ.setValid_Count((long)1);
// groupinfoMapper.insertGroupinfoEntity(groupinfoEntityQ);
/** /**
* 生成快证任务单的组号列表 * 生成快证任务单的受理号信息
* 快证组号
*/ */
int groupInfoSequenceValueQ = utilMapper.findGroupInfoSequenceNextValue(); int acceptInfoSequenceNextValue = utilMapper.findAcceptInfoSequenceNextValue();
GroupinfoEntity groupinfoEntityQ = new GroupinfoEntity(); AcceptNoInfoEntity acceptNoInfoEntity = new AcceptNoInfoEntity();
groupinfoEntityQ.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValueQ); acceptNoInfoEntity.setAccept_No_Info_Id(simpleDateFormat.format(new Date()) + acceptInfoSequenceNextValue);
groupinfoEntityQ.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seqQ); acceptNoInfoEntity.setAccept_No(accept_no);
groupinfoEntityQ.setGroupno(accept_no); //设置受理类型为快证
groupinfoEntityQ.setGrouptype((long)1); acceptNoInfoEntity.setAccept_Type((long) 1);
groupinfoEntityQ.setInvalid_Count((long)0); acceptNoInfoEntity.setCyclesheetid(simpleDateFormat.format(new Date()) + production_task_list_seq);
groupinfoEntityQ.setValid_Count((long)1); acceptNoInfoEntity.setGroup_No(accept_no.substring(0, 8));
groupinfoMapper.insertGroupinfoEntity(groupinfoEntityQ); acceptNoInfoMapper.saveAcceptNoInfoEntity(acceptNoInfoEntity);
} }
}else if (groupinfoEntityByAcceptNo.size()==1){ } else if (groupinfoEntityByAcceptNo.size() == 1 && acceptNoInfoEntityList.size() == 0) {
/** /**
* 下发任务单 但没有产生余证的情况 * 下发任务单 但没有产生余证的情况
* 即 在组号列表中只有一个受理组号 * 即 只有一个受理组号
*/ */
List<ProductionTaskListEntity> productionTaskListEntity = productionTaskListMapper.findProductionTaskListEntity(groupinfoEntityByAcceptNo.get(0).getCyclesheetid()); List<ProductionTaskListEntity> productionTaskListEntity = productionTaskListMapper.findProductionTaskListEntity(groupinfoEntityByAcceptNo.get(0).getCyclesheetid());
// /**
// * 从原来的任务单中减去快证
// * 即从原来任务单组号列表中插入一条-1的组号
// */
// int groupInfoSequenceValue2 = utilMapper.findGroupInfoSequenceNextValue();
// GroupinfoEntity groupinfoEntity2 = new GroupinfoEntity();
// groupinfoEntity2.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValue2);
// groupinfoEntity2.setCyclesheetid(productionTaskListEntity.get(0).getProduction_Task_List_Id());
// groupinfoEntity2.setGroupno(accept_no);
// groupinfoEntity2.setInvalid_Count((long)0);
// groupinfoEntity2.setValid_Count((long)-1);
// groupinfoMapper.insertGroupinfoEntity(groupinfoEntity2);
/** /**
* 从原来的任务单中减去快证 * 更新组号信息表中的特殊证数量
* 即从原来任务单组号列表中插入一条-1的组号
*/ */
int groupInfoSequenceValue2 = utilMapper.findGroupInfoSequenceNextValue(); GroupinfoEntity groupinfoEntity = groupinfoEntityByAcceptNo.get(1);
GroupinfoEntity groupinfoEntity2 = new GroupinfoEntity(); groupinfoEntity.setSpecial_Card_Count(groupinfoEntity.getSpecial_Card_Count() + 1);
groupinfoEntity2.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValue2); groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
groupinfoEntity2.setCyclesheetid(productionTaskListEntity.get(0).getProduction_Task_List_Id());
groupinfoEntity2.setGroupno(accept_no);
groupinfoEntity2.setGrouptype((long)1);
groupinfoEntity2.setInvalid_Count((long)0);
groupinfoEntity2.setValid_Count((long)-1);
groupinfoMapper.insertGroupinfoEntity(groupinfoEntity2);
/** /**
* 生成快证任务单并下发 * 生成快证任务单并下发
*/ */
ProductionTaskListEntity productionTaskListEntityQ = new ProductionTaskListEntity(); ProductionTaskListEntity productionTaskListEntityQ = new ProductionTaskListEntity();
int production_task_list_seqQ = utilMapper.findProductionTaskListSequenceNextValue(); int production_task_list_seqQ = utilMapper.findProductionTaskListSequenceNextValue();
productionTaskListEntityQ.setProduction_Task_List_Id(simpleDateFormat.format(new Date())+production_task_list_seqQ); productionTaskListEntityQ.setProduction_Task_List_Id(simpleDateFormat.format(new Date()) + production_task_list_seqQ);
productionTaskListEntityQ.setCitycode(productionTaskListEntity.get(0).getCitycode()); productionTaskListEntityQ.setCitycode(productionTaskListEntity.get(0).getCitycode());
productionTaskListEntityQ.setMake_Type((long)1); productionTaskListEntityQ.setMake_Type((long) 1);
productionTaskListEntityQ.setOld_Make_Type(productionTaskListEntity.get(0).getMake_Type()); productionTaskListEntityQ.setOld_Make_Type(productionTaskListEntity.get(0).getMake_Type());
productionTaskListEntityQ.setSubmit_Date(simpleDateFormat.format(new Date())); productionTaskListEntityQ.setSubmit_Date(simpleDateFormat.format(new Date()));
productionTaskListEntityQ.setHandout_Date(simpleDateFormat.format(new Date())); productionTaskListEntityQ.setHandout_Date(simpleDateFormat.format(new Date()));
productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntityQ); productionTaskListMapper.insertProductionTaskListEntity(productionTaskListEntityQ);
// /**
// * 生成快证任务单的组号列表
// * 快证组号
// */
// int groupInfoSequenceValueQ = utilMapper.findGroupInfoSequenceNextValue();
// GroupinfoEntity groupinfoEntityQ = new GroupinfoEntity();
// groupinfoEntityQ.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValueQ);
// groupinfoEntityQ.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seqQ);
// groupinfoEntityQ.setGroupno(accept_no);
// groupinfoEntityQ.setGrouptype((long)1);
// groupinfoEntityQ.setInvalid_Count((long)0);
// groupinfoEntityQ.setValid_Count((long)1);
// groupinfoMapper.insertGroupinfoEntity(groupinfoEntityQ);
/** /**
* 生成快证任务单的组号列表 * 生成快证任务单的受理号信息
* 快证组号
*/ */
int groupInfoSequenceValueQ = utilMapper.findGroupInfoSequenceNextValue(); int acceptInfoSequenceNextValue = utilMapper.findAcceptInfoSequenceNextValue();
GroupinfoEntity groupinfoEntityQ = new GroupinfoEntity(); AcceptNoInfoEntity acceptNoInfoEntity = new AcceptNoInfoEntity();
groupinfoEntityQ.setGroupid(simpleDateFormat.format(new Date())+groupInfoSequenceValueQ); acceptNoInfoEntity.setAccept_No_Info_Id(simpleDateFormat.format(new Date()) + acceptInfoSequenceNextValue);
groupinfoEntityQ.setCyclesheetid(simpleDateFormat.format(new Date())+production_task_list_seqQ); acceptNoInfoEntity.setAccept_No(accept_no);
groupinfoEntityQ.setGroupno(accept_no); //设置受理类型为快证
groupinfoEntityQ.setGrouptype((long)1); acceptNoInfoEntity.setAccept_Type((long) 1);
groupinfoEntityQ.setInvalid_Count((long)0); acceptNoInfoEntity.setCyclesheetid(simpleDateFormat.format(new Date()) + production_task_list_seqQ);
groupinfoEntityQ.setValid_Count((long)1); acceptNoInfoEntity.setGroup_No(accept_no.substring(0, 8));
groupinfoMapper.insertGroupinfoEntity(groupinfoEntityQ); acceptNoInfoMapper.saveAcceptNoInfoEntity(acceptNoInfoEntity);
}else { } else {
// /**
// * 下发任务单 存在产生余证的情况
// *即更新组号列表的组号类型
// * 以及更新余证任务单的制证类型和原制证类型
// */
// List<GroupinfoEntity> groupinfoEntities = groupinfoMapper.findGroupinfoEntityByAcceptNo(accept_no);
// for (GroupinfoEntity groupinfoEntity:groupinfoEntities){
// /*
// 找到余证任务单 并更新制证类型和原制证类型
// */
// if (accept_no.equals(groupinfoEntity.getGroupno()) &&groupinfoEntity.getValid_Count()==1){
// /**
// * 找到余证任务单
// */
// List<ProductionTaskListEntity> productionTaskListEntities = productionTaskListMapper.findProductionTaskListEntity(groupinfoEntity.getCyclesheetid());
// for (ProductionTaskListEntity productionTaskListEntity:productionTaskListEntities){
// productionTaskListEntity.setOld_Make_Type(productionTaskListEntity.getMake_Type());
// productionTaskListEntity.setMake_Type((long)1);
// productionTaskListMapper.updateProductionTask(productionTaskListEntity);
// }
// groupinfoEntity.setGrouptype((long)1);
// groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
// }else if (accept_no.equals(groupinfoEntity.getGroupno())){
// groupinfoEntity.setGrouptype((long)1);
// groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
// }
// }
/** /**
* 下发任务单 存在产生余证的情况 * 下发任务单 存在产生余证的情况
*即更新组号列表的组号类型 以及更新余证任务单的制证类型和原制证类型 * 更新余证任务单的制证类型以及更新受理号信息的受理类型
*/ */
List<GroupinfoEntity> groupinfoEntities = groupinfoMapper.findGroupinfoEntityByAcceptNo(accept_no); List<ProductionTaskListEntity> productionTaskListEntities = productionTaskListMapper.findProductionTaskListEntity(groupinfoEntityByAcceptNo.get(0).getCyclesheetid());
for (GroupinfoEntity groupinfoEntity:groupinfoEntities){ for (ProductionTaskListEntity productionTaskListEntity : productionTaskListEntities) {
/* productionTaskListEntity.setOld_Make_Type(productionTaskListEntity.getMake_Type());
找到余证任务单 并更新制证类型和原制证类型 productionTaskListEntity.setMake_Type((long) 1);
*/ productionTaskListMapper.updateProductionTask(productionTaskListEntity);
if (accept_no.equals(groupinfoEntity.getGroupno()) &&groupinfoEntity.getValid_Count()==1){ }
/** for (AcceptNoInfoEntity acceptNoInfoEntity : acceptNoInfoEntityList) {
* 找到余证任务单 acceptNoInfoEntity.setAccept_Type((long) 1);
*/ acceptNoInfoMapper.updateAcceptNoInfoEntity(acceptNoInfoEntity);
List<ProductionTaskListEntity> productionTaskListEntities = productionTaskListMapper.findProductionTaskListEntity(groupinfoEntity.getCyclesheetid());
for (ProductionTaskListEntity productionTaskListEntity:productionTaskListEntities){
productionTaskListEntity.setOld_Make_Type(productionTaskListEntity.getMake_Type());
productionTaskListEntity.setMake_Type((long)1);
productionTaskListMapper.updateProductionTask(productionTaskListEntity);
}
groupinfoEntity.setGrouptype((long)1);
groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
}else if (accept_no.equals(groupinfoEntity.getGroupno())){
groupinfoEntity.setGrouptype((long)1);
groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
}
} }
} }
return 1; return 1;
...@@ -295,27 +366,29 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -295,27 +366,29 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 查询受理库制证信息 * 查询受理库制证信息
* 按查询处理时间 * 按查询处理时间
*
* @param importDate * @param importDate
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor = Exception.class)
public List<Object> findAccuProductionInfo(String importDate) { public List<Object> findAccuProductionInfo(String importDate) {
return new ArrayList<>(); return new ArrayList<>();
} }
/** /**
* 保持派出所照片质量详情 * 保持派出所照片质量详情
*
* @param policeStationVailedInfoEntities * @param policeStationVailedInfoEntities
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor = Exception.class)
public int savePoliceStationVailedInfoEntity(List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities) { public int savePoliceStationVailedInfoEntity(List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
for (PoliceStationVailedInfoEntity policeEntity:policeStationVailedInfoEntities) { for (PoliceStationVailedInfoEntity policeEntity : policeStationVailedInfoEntities) {
int policeStationVailedSequenceNextValue = utilMapper.findPoliceStationVailedSequenceNextValue(); int policeStationVailedSequenceNextValue = utilMapper.findPoliceStationVailedSequenceNextValue();
policeEntity.setPolice_Station_Vailed_Info_Id(simpleDateFormat.format(new Date())+policeStationVailedSequenceNextValue); policeEntity.setPolice_Station_Vailed_Info_Id(simpleDateFormat.format(new Date()) + policeStationVailedSequenceNextValue);
policeStationVailedInfoMapper.savePoliceStationVailedInfoEntity(policeEntity); policeStationVailedInfoMapper.savePoliceStationVailedInfoEntity(policeEntity);
} }
return 1; return 1;
...@@ -324,11 +397,30 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -324,11 +397,30 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 查询任务单详情 * 查询任务单详情
* 通过查询任务单状态 * 通过查询任务单状态
*
* @param state * @param state
* @return * @return
*/ */
@Override @Override
public List<ProductionTaskListEntity> findProductionTaskListEntityByState(int state) { public List<Map<String, Object>> findProductionTaskListEntityByState(int state) {
List<ProductionTaskListEntity> productionTaskListEntities = productionTaskListMapper.findProductionTaskListEntityByState(state);
List<Map<String, Object>> productionTaskMapList = new ArrayList<>();
for (ProductionTaskListEntity productionTaskListEntity : productionTaskListEntities) {
Map<String, Object> map = new HashMap<>();
map.put("productionTaskListEntity", productionTaskListEntity);
List<Map<String, Object>> groupinfoMapList = new ArrayList<>();
List<GroupinfoEntity> groupinfoEntityList = groupinfoMapper.findGroupinfoEntityListByProductionTaskListId(productionTaskListEntity.getProduction_Task_List_Id());
for (GroupinfoEntity groupinfoEntity : groupinfoEntityList) {
Map<String, Object> groupinfoMap = new HashMap<>();
groupinfoMap.put("groupinfoEntity", groupinfoEntity);
List<AcceptNoInfoEntity> acceptNoInfoEntity = acceptNoInfoMapper.findAcceptNoInfoEntityByGroupNo(groupinfoEntity.getGroupno());
groupinfoMap.put("acceptNoInfoEntity", acceptNoInfoEntity);
groupinfoMapList.add(groupinfoMap);
}
map.put("groupinfoMapList", groupinfoMapList);
productionTaskMapList.add(map);
}
return null; return null;
...@@ -336,6 +428,7 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -336,6 +428,7 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
/** /**
* 测试查询 * 测试查询
*
* @param id * @param id
* @return * @return
*/ */
......
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yxproject.start.mapper.AcceptNoInfoMapper">
<resultMap id="AcceptNoInfoMapper" type="com.yxproject.start.entity.AcceptNoInfoEntity">
<id column="ACCEPT_NO_INFO_ID" property="accept_No_Info_Id" jdbcType="VARCHAR"/>
<result column="ACCEPT_NO" property="accept_No" jdbcType="VARCHAR"/>
<result column="CYCLESHEETID" property="cyclesheetid" jdbcType="VARCHAR"/>
<result column="GROUP_NO" property="group_No" jdbcType="VARCHAR"/>
<result column="ACCEPT_TYPE" property="accept_Type" jdbcType="NUMERIC"/>
</resultMap>
<select id="findAcceptNoInfoEntityByAcceptNo" resultType="com.yxproject.start.entity.AcceptNoInfoEntity" parameterType="String">
select * from ACCEPT_NO_INFO where ACCEPT_NO =#{accept_No}
</select>
<insert id="saveAcceptNoInfoEntity" parameterType="com.yxproject.start.entity.AcceptNoInfoEntity">
INSERT INTO ACCEPT_NO_INFO (ACCEPT_NO_INFO_ID, ACCEPT_NO, CYCLESHEETID, ACCEPT_TYPE,GROUP_NO) VALUES (#{accept_No_Info_Id}, #{accept_No}, #{cyclesheetid}, #{accept_Type},#{group_No})
</insert>
<update id="updateAcceptNoInfoEntity" parameterType="com.yxproject.start.entity.AcceptNoInfoEntity">
update ACCEPT_NO_INFO
<set>
<if test="accept_No" >accept_No=#{accept_No} </if>
<if test="cyclesheetid" >cyclesheetid=#{cyclesheetid} </if>
<if test="group_No" >group_No=#{group_No} </if>
<if test="accept_Type" >accept_Type=#{accept_Type} </if>
</set>
where accept_No_Info_Id =#{accept_No_Info_Id}
</update>
<select id="findAcceptNoInfoEntityByGroupNo" resultType="com.yxproject.start.entity.AcceptNoInfoEntity" parameterType="String">
select * from ACCEPT_NO_INFO where GROUP_NO =#{group_No}
</select>
</mapper>
\ No newline at end of file
...@@ -34,6 +34,7 @@ update FAILEDINFO ...@@ -34,6 +34,7 @@ update FAILEDINFO
<if test="print_Date" >print_Date=#{print_Date} </if> <if test="print_Date" >print_Date=#{print_Date} </if>
<if test="state" >state=#{state} </if> <if test="state" >state=#{state} </if>
</set> </set>
where failedinfoid =#{failedinfoid}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
<id column="GROUPID" property="groupid" jdbcType="VARCHAR"/> <id column="GROUPID" property="groupid" jdbcType="VARCHAR"/>
<result column="GROUPNO" property="groupno" jdbcType="VARCHAR"/> <result column="GROUPNO" property="groupno" jdbcType="VARCHAR"/>
<result column="CYCLESHEETID" property="cyclesheetid" jdbcType="VARCHAR"/> <result column="CYCLESHEETID" property="cyclesheetid" jdbcType="VARCHAR"/>
<result column="GROUPTYPE" property="grouptype" jdbcType="NUMERIC"/> <result column="VAILD_COUNT" property="vaild_Count" jdbcType="NUMERIC"/>
<result column="VAILD_COUNT" property="vaildCount" jdbcType="NUMERIC"/> <result column="INVALID_COUNT" property="invalid_Count" jdbcType="NUMERIC"/>
<result column="INVALID_COUNT" property="invalidCount" jdbcType="NUMERIC"/> <result column="SPECIAL_CARD_COUNT" property="special_Card_Count" jdbcType="NUMERIC"/>
</resultMap> </resultMap>
<select id="findGroupinfoEntityListByProductionTaskListId" resultType="com.yxproject.start.entity.GroupinfoEntity" parameterType="String"> <select id="findGroupinfoEntityListByProductionTaskListId" resultType="com.yxproject.start.entity.GroupinfoEntity" parameterType="String">
...@@ -15,32 +15,35 @@ ...@@ -15,32 +15,35 @@
</select> </select>
<insert id="insertGroupinfoEntity" parameterType="com.yxproject.start.entity.GroupinfoEntity"> <insert id="insertGroupinfoEntity" parameterType="com.yxproject.start.entity.GroupinfoEntity">
Insert into GROUPINFO (GROUPID,GROUPNO,CYCLESHEETID,GROUPTYPE,VAILD_COUNT,INVALID_COUNT) values Insert into GROUPINFO (GROUPID,GROUPNO,CYCLESHEETID,VAILD_COUNT,INVALID_COUNT,special_Card_Count) values
(#{groupid},#{groupno},#{grouptype},#{cyclesheetid},#{grouptype},#{vaildCount},#{invalidCount}) (#{groupid},#{groupno},#{grouptype},#{cyclesheetid},#{vaildCount},#{invalidCount},#{special_Card_Count})
</insert> </insert>
<select id="findGroupinfoEntityByAcceptNo" resultType="com.yxproject.start.entity.GroupinfoEntity" parameterType="String"> <select id="findGroupinfoEntityByAcceptNo" resultType="com.yxproject.start.entity.GroupinfoEntity" parameterType="String">
select * from GROUPINFO where GROUPNO =#{acceptNo} or GROUPNO =substr(#{acceptNo},0,8) select * from GROUPINFO where GROUPNO =substr(#{acceptNo},0,8)
</select> </select>
<update id="updateGroupinfoEntity" parameterType="com.yxproject.start.entity.GroupinfoEntity"> <update id="updateGroupinfoEntity" parameterType="com.yxproject.start.entity.GroupinfoEntity">
update GROUPINFO set GROUPID=#{groupid} update GROUPINFO set GROUPID=#{groupid}
<if test="groupno">,groupno =#{groupno}</if> <if test="groupno">,groupno =#{groupno}</if>
<if test="makeType">,MAKE_TYPE =#{makeType}</if>
<if test="cyclesheetid">,cyclesheetid =#{cyclesheetid}</if> <if test="cyclesheetid">,cyclesheetid =#{cyclesheetid}</if>
<if test="grouptype">,grouptype =#{grouptype}</if> <if test="grouptype">,grouptype =#{grouptype}</if>
<if test="valid_Count">,valid_Count =#{valid_Count}</if> <if test="valid_Count">,valid_Count =#{valid_Count}</if>
<if test="invalid_Count">,invalid_Count =#{invalid_Count}</if> <if test="invalid_Count">,invalid_Count =#{invalid_Count}</if>
<if test="special_Card_Count">,special_Card_Count =#{special_Card_Count}</if>
where GROUPID=#{groupid} where GROUPID=#{groupid}
</update> </update>
<select id="findCountyInfoList8_10" resultType="java.util.HashMap" parameterType="String"> <select id="findGroupInfoCountByProductionTaskListId" parameterType="String" resultType="int">
select * from FINDPRODCOUNTYLIST8_10_VIEW where p_view_param.set_param(#{groupinfo10})=#{groupinfo10} AND p_view_param.set_param2(#{groupinfo8})=#{groupinfo8} select count(GROUPNO) from GROUPINFO where CYCLESHEETID =#{cyclesheetid}
</select> </select>
<select id="findCountyInfoList8" resultType="java.util.HashMap" parameterType="String">
select * from FINDPRODCOUNTYLIST8_VIEW where p_view_param.set_param2(#{groupinfo8})=#{groupinfo8} <select id="findSpecialCountyList" resultType="java.util.HashMap" parameterType="String">
SELECT * FROM TABLE(FIND_SPECIAL_COUNTY_LIST.GET_county_infos(#{cyclesheetid}))
</select> </select>
<select id="findCountyInfoList10" resultType="java.util.HashMap" parameterType="String">
select * from FINDPRODCOUNTYLIST10_VIEW where p_view_param.set_param(#{groupinfo10})=#{groupinfo10} <select id="findNormalCountyList" resultType="java.util.HashMap" parameterType="String">
SELECT * FROM TABLE(find_normal_county_list.GET_county_infos(#{cyclesheetid}))
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,4 +24,5 @@ ...@@ -24,4 +24,5 @@
select * from PROD_CARD_T@PROD_LINK where ACCEPT_NO=#{card} or ID_NO =#{card} select * from PROD_CARD_T@PROD_LINK where ACCEPT_NO=#{card} or ID_NO =#{card}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
<select id="findPoliceStationVailedSequenceNextValue" resultType="int" > <select id="findPoliceStationVailedSequenceNextValue" resultType="int" >
select POLICE_STATION_VAILED_SEQ.nextval from dual select POLICE_STATION_VAILED_SEQ.nextval from dual
</select> </select>
<select id="findFailedinfoSequenceNextValue" resultType="int">
select FAILEDINFO_SEQ.nextval from dual
</select>
<select id="findAcceptInfoSequenceNextValue" resultType="int">
select ACCEPTINFO_SEQ.nextval from dual
</select>
</mapper> </mapper>
\ No newline at end of file
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