Commit 6b2078e8 authored by liboyang's avatar liboyang

完成保存派出所申领表数据

parent 46a955db
package com.yxproject.start.api; package com.yxproject.start.api;
import com.yxproject.start.dto.CardsStatusAndCardsMsgDto; import com.yxproject.start.service.PoliceStationApplyReasonService;
import com.yxproject.start.dto.CardsStatusAndPostMsgDto;
import com.yxproject.start.entity.PersonPostAbnormalEntity;
import com.yxproject.start.entity.PersonPostEntity;
import com.yxproject.start.entity.PersonalProgressStatusEntity;
import com.yxproject.start.service.PersonPostAbnormalService;
import com.yxproject.start.service.PersonPostService;
import com.yxproject.start.service.PersonalProgressStatusService;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -29,77 +22,20 @@ import java.util.Map; ...@@ -29,77 +22,20 @@ import java.util.Map;
public class BizApi { public class BizApi {
@Autowired @Autowired
private PersonPostAbnormalService personPostAbnormalService; private PoliceStationApplyReasonService policeStationApplyReasonService;
@Autowired
private PersonalProgressStatusService personalProgressStatusService;
@Autowired
private PersonPostService personPostService;
/**
* 查询个人邮寄信息异常数据
* @param date
* @param police
* @return
*/
@RequestMapping("getErrorPostMsg")
public List<PersonPostAbnormalEntity> getErrorPostMsg(@RequestParam("date")String date, @RequestParam("police")String police) {
List<PersonPostAbnormalEntity> list = personPostAbnormalService.getPersonPostAbnormal(date,police);
return list;
}
/** /**
* 查询对公邮寄包查询 * 保存派出所申领表数据
* @param date * @param taskIdList
* @param police
* @return * @return
*/ */
@RequestMapping("getCardsPostMsg") @RequestMapping("savePoliceApplicationData")
public List<CardsStatusAndPostMsgDto> getCardsPostMsg(@RequestParam("date")String date, @RequestParam("police")String police) { public int savePoliceApplicationData(@RequestBody String taskIdList) {
List<CardsStatusAndPostMsgDto> list = personalProgressStatusService.getStatusAndPostMsg(date,police); JSONArray jsonArray = JSONArray.fromObject(taskIdList);
return list; int i = policeStationApplyReasonService.getAndSavePoliceStationApplyReason(jsonArray);
return i;
} }
/**
* 通过运单号查询邮寄信息
* @param waybillNumber
* @return
*/
@RequestMapping("getPostMsgByWaybillNo")
public PersonPostEntity getPostMsgByWaybillNo(@RequestParam("waybillNumber")String waybillNumber) {
PersonPostEntity personPostEntity = personPostService.getPersonPostMsg(waybillNumber);
return personPostEntity;
}
/**
*查询个人证件信息和证件状态
* @param date
* @param police
* @return
*/
@RequestMapping("getCardsStatusAndCardMsg")
public List<CardsStatusAndCardsMsgDto> getCardsStatusAndCardMsg(@RequestParam("date")String date, @RequestParam("police")String police) {
List<CardsStatusAndCardsMsgDto> list = personalProgressStatusService.getStatusAndCardMsg(date,police);
return list;
}
/**
* 签收(修改状态表中的状态)
* @param uploadNoList
* @return
*/
@RequestMapping("setSignInDate")
public Map<String,String> setSignInDate(@RequestBody String uploadNoList) {
Map<String,String> map = new HashMap<>();
JSONArray jsonArray = JSONArray.fromObject(uploadNoList);
Boolean flag = personalProgressStatusService.updateSignInDate(jsonArray);
if(flag){
map.put("msg","修改成功");
}else {
map.put("msg","修改失败");
}
return map;
}
} }
package com.yxproject.start.dto;
/**
* @author Administrator
*/
public class PoliceApplyCountDto {
private String policeStationCode;
private String drawType;
private int applyCount;
public String getPoliceStationCode() {
return policeStationCode;
}
public void setPoliceStationCode(String policeStationCode) {
this.policeStationCode = policeStationCode;
}
public String getDrawType() {
return drawType;
}
public void setDrawType(String drawType) {
this.drawType = drawType;
}
public int getApplyCount() {
return applyCount;
}
public void setApplyCount(int applyCount) {
this.applyCount = applyCount;
}
}
package com.yxproject.start.entity;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "SLH_GAJG_DM", schema = "AUXILIARY", catalog = "")
public class SlhGajgDmEntity {
private String gajgDm;
private String slhGajgDm;
@Basic
@Column(name = "GAJG_DM")
public String getGajgDm() {
return gajgDm;
}
public void setGajgDm(String gajgDm) {
this.gajgDm = gajgDm;
}
@Basic
@Column(name = "SLH_GAJG_DM")
public String getSlhGajgDm() {
return slhGajgDm;
}
public void setSlhGajgDm(String slhGajgDm) {
this.slhGajgDm = slhGajgDm;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SlhGajgDmEntity that = (SlhGajgDmEntity) o;
if (gajgDm != null ? !gajgDm.equals(that.gajgDm) : that.gajgDm != null) return false;
if (slhGajgDm != null ? !slhGajgDm.equals(that.slhGajgDm) : that.slhGajgDm != null) return false;
return true;
}
@Override
public int hashCode() {
int result = gajgDm != null ? gajgDm.hashCode() : 0;
result = 31 * result + (slhGajgDm != null ? slhGajgDm.hashCode() : 0);
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
@Entity
@Table(name = "SYS_PERMISSION", schema = "AUXILIARY", catalog = "")
public class SysPermissionEntity {
private int id;
private Boolean available;
private String name;
private Long parentId;
private String parentIds;
private String permission;
private String resourceType;
private String url;
@Id
@Column(name = "ID")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "AVAILABLE")
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean available) {
this.available = available;
}
@Basic
@Column(name = "NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "PARENT_ID")
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
@Basic
@Column(name = "PARENT_IDS")
public String getParentIds() {
return parentIds;
}
public void setParentIds(String parentIds) {
this.parentIds = parentIds;
}
@Basic
@Column(name = "PERMISSION")
public String getPermission() {
return permission;
}
public void setPermission(String permission) {
this.permission = permission;
}
@Basic
@Column(name = "RESOURCE_TYPE")
public String getResourceType() {
return resourceType;
}
public void setResourceType(String resourceType) {
this.resourceType = resourceType;
}
@Basic
@Column(name = "URL")
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysPermissionEntity that = (SysPermissionEntity) o;
if (id != that.id) return false;
if (available != null ? !available.equals(that.available) : that.available != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (parentId != null ? !parentId.equals(that.parentId) : that.parentId != null) return false;
if (parentIds != null ? !parentIds.equals(that.parentIds) : that.parentIds != null) return false;
if (permission != null ? !permission.equals(that.permission) : that.permission != null) return false;
if (resourceType != null ? !resourceType.equals(that.resourceType) : that.resourceType != null) return false;
if (url != null ? !url.equals(that.url) : that.url != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (available != null ? available.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (parentId != null ? parentId.hashCode() : 0);
result = 31 * result + (parentIds != null ? parentIds.hashCode() : 0);
result = 31 * result + (permission != null ? permission.hashCode() : 0);
result = 31 * result + (resourceType != null ? resourceType.hashCode() : 0);
result = 31 * result + (url != null ? url.hashCode() : 0);
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
@Entity
@Table(name = "SYS_ROLE", schema = "AUXILIARY", catalog = "")
public class SysRoleEntity {
private int id;
private Boolean available;
private String description;
private String role;
@Id
@Column(name = "ID")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "AVAILABLE")
public Boolean getAvailable() {
return available;
}
public void setAvailable(Boolean available) {
this.available = available;
}
@Basic
@Column(name = "DESCRIPTION")
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Basic
@Column(name = "ROLE")
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysRoleEntity that = (SysRoleEntity) o;
if (id != that.id) return false;
if (available != null ? !available.equals(that.available) : that.available != null) return false;
if (description != null ? !description.equals(that.description) : that.description != null) return false;
if (role != null ? !role.equals(that.role) : that.role != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (available != null ? available.hashCode() : 0);
result = 31 * result + (description != null ? description.hashCode() : 0);
result = 31 * result + (role != null ? role.hashCode() : 0);
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "SYS_ROLE_PERMISSION", schema = "AUXILIARY", catalog = "")
public class SysRolePermissionEntity {
private int roleId;
private int permissionId;
@Basic
@Column(name = "ROLE_ID")
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
@Basic
@Column(name = "PERMISSION_ID")
public int getPermissionId() {
return permissionId;
}
public void setPermissionId(int permissionId) {
this.permissionId = permissionId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysRolePermissionEntity that = (SysRolePermissionEntity) o;
if (roleId != that.roleId) return false;
if (permissionId != that.permissionId) return false;
return true;
}
@Override
public int hashCode() {
int result = roleId;
result = 31 * result + permissionId;
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "SYS_USER_ROLE", schema = "AUXILIARY", catalog = "")
public class SysUserRoleEntity {
private int userId;
private int roleId;
@Basic
@Column(name = "USER_ID")
public int getUserId() {
return userId;
}
public void setUserId(int userId) {
this.userId = userId;
}
@Basic
@Column(name = "ROLE_ID")
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SysUserRoleEntity that = (SysUserRoleEntity) o;
if (userId != that.userId) return false;
if (roleId != that.roleId) return false;
return true;
}
@Override
public int hashCode() {
int result = userId;
result = 31 * result + roleId;
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
@Entity
@Table(name = "TASK_STATE_DIC", schema = "AUXILIARY", catalog = "")
public class TaskStateDicEntity {
private long taskStateId;
private String taskState;
@Id
@Column(name = "TASK_STATE_ID")
public long getTaskStateId() {
return taskStateId;
}
public void setTaskStateId(long taskStateId) {
this.taskStateId = taskStateId;
}
@Basic
@Column(name = "TASK_STATE")
public String getTaskState() {
return taskState;
}
public void setTaskState(String taskState) {
this.taskState = taskState;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TaskStateDicEntity that = (TaskStateDicEntity) o;
if (taskStateId != that.taskStateId) return false;
if (taskState != null ? !taskState.equals(that.taskState) : that.taskState != null) return false;
return true;
}
@Override
public int hashCode() {
int result = (int) (taskStateId ^ (taskStateId >>> 32));
result = 31 * result + (taskState != null ? taskState.hashCode() : 0);
return result;
}
}
package com.yxproject.start.entity;
import javax.persistence.*;
@Entity
@Table(name = "USER_INFO", schema = "AUXILIARY", catalog = "")
public class UserInfoEntity {
private int id;
private String name;
private String password;
private String salt;
private byte state;
private String username;
private String workshop;
@Id
@Column(name = "ID")
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Basic
@Column(name = "NAME")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Basic
@Column(name = "PASSWORD")
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Basic
@Column(name = "SALT")
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
@Basic
@Column(name = "STATE")
public byte getState() {
return state;
}
public void setState(byte state) {
this.state = state;
}
@Basic
@Column(name = "USERNAME")
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
@Basic
@Column(name = "WORKSHOP")
public String getWorkshop() {
return workshop;
}
public void setWorkshop(String workshop) {
this.workshop = workshop;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UserInfoEntity that = (UserInfoEntity) o;
if (id != that.id) return false;
if (state != that.state) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (password != null ? !password.equals(that.password) : that.password != null) return false;
if (salt != null ? !salt.equals(that.salt) : that.salt != null) return false;
if (username != null ? !username.equals(that.username) : that.username != null) return false;
if (workshop != null ? !workshop.equals(that.workshop) : that.workshop != null) return false;
return true;
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (password != null ? password.hashCode() : 0);
result = 31 * result + (salt != null ? salt.hashCode() : 0);
result = 31 * result + (int) state;
result = 31 * result + (username != null ? username.hashCode() : 0);
result = 31 * result + (workshop != null ? workshop.hashCode() : 0);
return result;
}
}
package com.yxproject.start.mapper;
import com.yxproject.start.dto.PoliceApplyCountDto;
import com.yxproject.start.entity.PoliceStationApplyReasonEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @author Administrator
*/
@Mapper
public interface PoliceStationApplyReasonMapper {
@Select("SELECT SUBSTR(B.UPLOAD_NO,0,9) police_station_code,B.DRAW_TYPE,count(b.UPLOAD_NO) apply_count from GROUP_NO a\n" +
" LEFT JOIN PROD_APPLY_INFO_T@prod_link b ON a.GROUP_NO=substr(b.ACCEPT_NO,0,8)\n" +
"WHERE TASK_ID=#{taskId} GROUP BY SUBSTR(B.UPLOAD_NO,0,9),B.DRAW_TYPE")
public List<PoliceApplyCountDto> getPoliceStationApplyReason(@Param("taskId") String taskId);
@Insert("INSERT INTO POLICE_STATION_APPLY_REASON(SAVE_DATE,TASK_ID,POLICE_STATION_CODE,APPLY_CODE,APPLY_COUNT)\n" +
"VALUES(SYSDATE,#{taskId},#{policeStationCode},#{drawType},#{applyCount})")
public int savePoliceStationApplyReason(@Param("taskId") String taskId,@Param("policeStationCode")String policeStationCode,@Param("drawType")String drawType,@Param("applyCount")int applyCount);
}
package com.yxproject.start.service;
import net.sf.json.JSONArray;
public interface PoliceStationApplyReasonService {
public int getAndSavePoliceStationApplyReason(JSONArray jsonArray);
}
package com.yxproject.start.service.impl;
import com.yxproject.start.dto.PoliceApplyCountDto;
import com.yxproject.start.entity.PoliceStationApplyReasonEntity;
import com.yxproject.start.mapper.PoliceStationApplyReasonMapper;
import com.yxproject.start.service.PoliceStationApplyReasonService;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Service
public class PoliceStationApplyReasonServiceImpl implements PoliceStationApplyReasonService{
@Autowired
private PoliceStationApplyReasonMapper policeStationApplyReasonMapper;
@Override
@Transactional(rollbackFor=Exception.class)
public int getAndSavePoliceStationApplyReason(JSONArray taskIdArray) {
int count = 0;
for (Object object:taskIdArray){
List<PoliceApplyCountDto> list = policeStationApplyReasonMapper.getPoliceStationApplyReason(object.toString());
System.out.println(object.toString());
System.out.println(list);
for(int i=0;i<list.size();i++){
int saveCount = policeStationApplyReasonMapper.savePoliceStationApplyReason(object.toString(),list.get(i).getPoliceStationCode(),list.get(i).getDrawType(),list.get(i).getApplyCount());
count+=saveCount;
}
}
return count;
}
}
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