Commit 2747e9c5 authored by Administrator's avatar Administrator

push

parent 601b1180
...@@ -6,6 +6,7 @@ import com.yxproject.start.service.SysPermissionService; ...@@ -6,6 +6,7 @@ import com.yxproject.start.service.SysPermissionService;
import com.yxproject.start.service.SysRoleService; import com.yxproject.start.service.SysRoleService;
import com.yxproject.start.service.UserInfoService; import com.yxproject.start.service.UserInfoService;
import com.yxproject.start.utils.YXJSONResponse; import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException; import org.apache.shiro.authc.AuthenticationException;
...@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -23,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Context; import javax.ws.rs.core.Context;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -225,7 +227,7 @@ public class ShiroApi { ...@@ -225,7 +227,7 @@ public class ShiroApi {
} }
/** /**
* 生成任务单; * 保存任务单;
* @return * @return
*/ */
@RequestMapping(value = "/addProductionTaskList",method = RequestMethod.GET) @RequestMapping(value = "/addProductionTaskList",method = RequestMethod.GET)
...@@ -293,5 +295,44 @@ public class ShiroApi { ...@@ -293,5 +295,44 @@ public class ShiroApi {
return "updatePermission"; return "updatePermission";
} }
/**
* 保存派出所照片质量详情;
* @return
*/
@RequestMapping(value = "/savePoliceStationVailedInfoEntity",method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody
public String savePoliceStationVailedInfoEntity(@RequestParam("id") String id,@Context HttpServletResponse resp){
String map ="[{\"cyclesheetid\":\"20181016001\",\"invalid_Count\":1,\"police_Station_Code\":\"41108201\",\"police_Station_Vailed_Info_Id\":\"1\",\"sava_Date\":\"20181025\",\"vailed_Count\":1}]";
JSONArray jsonArray = JSONArray.fromObject(map);
List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities = new ArrayList<>();
for (Object object: jsonArray) {
PoliceStationVailedInfoEntity o = (PoliceStationVailedInfoEntity)JSONObject.toBean((JSONObject) object, PoliceStationVailedInfoEntity.class);
policeStationVailedInfoEntities.add(o);
}
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.savePoliceStationVailedInfoEntity(policeStationVailedInfoEntities);
yxjsonResponse.outPutSuccess(i+"添加成功");
return yxjsonResponse.toJSONString();
}
/**
* test
* @return
*/
@RequestMapping("/test")
@RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody
public String test(@RequestParam("id") String permissionId,@Context HttpServletResponse resp){
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities = productionTaskListService.find(permissionId);
yxjsonResponse.outPutSuccess(policeStationVailedInfoEntities);
System.out.println(yxjsonResponse);
return yxjsonResponse.toJSONString();
}
} }
...@@ -27,7 +27,7 @@ import java.util.*; ...@@ -27,7 +27,7 @@ import java.util.*;
/** /**
* @author Administrator * @author Administrator
*/ */
@Controller @Path("user")
public class UserInfoApi { public class UserInfoApi {
@Autowired @Autowired
...@@ -42,7 +42,8 @@ public class UserInfoApi { ...@@ -42,7 +42,8 @@ public class UserInfoApi {
@Autowired @Autowired
private ProductionTaskListService productionTaskListService; private ProductionTaskListService productionTaskListService;
@RequestMapping("login") @GET
@Path("login")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public Map<String, Object> submitLogin(@QueryParam("username") String username, @QueryParam("password") String password) { public Map<String, Object> submitLogin(@QueryParam("username") String username, @QueryParam("password") String password) {
Map<String, Object> resultMap = new LinkedHashMap<String, Object>(); Map<String, Object> resultMap = new LinkedHashMap<String, Object>();
......
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* Created by zhangyusheng on 2018/10/25 13:38
*/
@Entity
@Table(name = "POLICE_STATION_VAILED_INFO", schema = "DAHAI", catalog = "")
public class PoliceStationVailedInfoEntity {
private String police_Station_Vailed_Info_Id;
private String cyclesheetid;
private String police_Station_Code;
private Long vailed_Count;
private Long invalid_Count;
private String sava_Date;
@Id
@Column(name = "POLICE_STATION_VAILED_INFO_ID", nullable = false, length = 20)
public String getPolice_Station_Vailed_Info_Id() {
return police_Station_Vailed_Info_Id;
}
public void setPolice_Station_Vailed_Info_Id(String police_Station_Vailed_Info_Id) {
this.police_Station_Vailed_Info_Id = police_Station_Vailed_Info_Id;
}
@Basic
@Column(name = "CYCLESHEETID", nullable = true, precision = 0)
public String getCyclesheetid() {
return cyclesheetid;
}
public void setCyclesheetid(String cyclesheetid) {
this.cyclesheetid = cyclesheetid;
}
@Basic
@Column(name = "POLICE_STATION_CODE", nullable = true, precision = 0)
public String getPolice_Station_Code() {
return police_Station_Code;
}
public void setPolice_Station_Code(String police_Station_Code) {
this.police_Station_Code = police_Station_Code;
}
@Basic
@Column(name = "VAILED_COUNT", nullable = true, precision = 0)
public Long getVailed_Count() {
return vailed_Count;
}
public void setVailed_Count(Long vailed_Count) {
this.vailed_Count = vailed_Count;
}
@Basic
@Column(name = "INVALID_COUNT", nullable = true, precision = 0)
public Long getInvalid_Count() {
return invalid_Count;
}
public void setInvalid_Count(Long invalid_Count) {
this.invalid_Count = invalid_Count;
}
@Basic
@Column(name = "SAVA_DATE", nullable = true, length = 20)
public String getSava_Date() {
return sava_Date;
}
public void setSava_Date(String sava_Date) {
this.sava_Date = sava_Date;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PoliceStationVailedInfoEntity that = (PoliceStationVailedInfoEntity) o;
return Objects.equals(police_Station_Vailed_Info_Id, that.police_Station_Vailed_Info_Id) &&
Objects.equals(cyclesheetid, that.cyclesheetid) &&
Objects.equals(police_Station_Code, that.police_Station_Code) &&
Objects.equals(vailed_Count, that.vailed_Count) &&
Objects.equals(invalid_Count, that.invalid_Count) &&
Objects.equals(sava_Date, that.sava_Date);
}
@Override
public int hashCode() {
return Objects.hash(police_Station_Vailed_Info_Id,cyclesheetid,police_Station_Code, vailed_Count, invalid_Count, sava_Date);
}
}
package com.yxproject.start.mapper;
import com.yxproject.start.entity.PoliceStationVailedInfoEntity;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
* Created by zhangyusheng on 2018/10/25 13:45
*/
@Mapper
public interface PoliceStationVailedInfoMapper {
/**
* 保存派出所照片质量报表
* @param policeStationVailedInfoEntity
* @return
*/
@Insert("INSERT INTO POLICE_STATION_VAILED_INFO (POLICE_STATION_VAILED_INFO_ID,CYCLESHEETID,POLICE_STATION_CODE,VAILED_COUNT,INVALID_COUNT,SAVA_DATE) " +
"values (#{police_Station_Vailed_Info_Id},#{cyclesheetid},#{police_Station_Code},#{vailed_Count},#{invalid_Count},#{sava_Date})")
@Options(useGeneratedKeys = true, keyProperty = "police_Station_Vailed_Info_Id",keyColumn = "police_Station_Vailed_Info_Id")
public void savePoliceStationVailedInfoEntity(PoliceStationVailedInfoEntity policeStationVailedInfoEntity);
@Select("select * from POLICE_STATION_VAILED_INFO WHERE POLICE_STATION_VAILED_INFO_ID=#{id}")
@Results({@Result(property = "police_Station_Vailed_Info_Id",column = "police_Station_Vailed_Info_Id"),
@Result(property = "cyclesheetid",column = "cyclesheetid"),
@Result(property = "police_Station_Code",column = "police_Station_Code"),
@Result(property = "vailed_Count",column = "vailed_Count"),
@Result(property = "invalid_Count",column = "invalid_Count"),
@Result(property = "sava_Date",column = "sava_Date")})
public List<PoliceStationVailedInfoEntity> findPoliceStationVailedInfoEntityByID(String id);
}
...@@ -15,7 +15,7 @@ public interface SysRoleMapper { ...@@ -15,7 +15,7 @@ public interface SysRoleMapper {
* 添加角色 * 添加角色
* @param sysRole * @param sysRole
*/ */
@Insert("INSERT INTO DAHAI.SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" + @Insert("INSERT INTO SYS_ROLE(ID,AVAILABLE,DESCRIPTION,ROLE)\n" +
"VALUES(PERMISSION_seq.nextval,0,#{description},#{role})") "VALUES(PERMISSION_seq.nextval,0,#{description},#{role})")
@Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id") @Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
public void addRoleByMap(SysRole sysRole); public void addRoleByMap(SysRole sysRole);
...@@ -25,7 +25,7 @@ public interface SysRoleMapper { ...@@ -25,7 +25,7 @@ public interface SysRoleMapper {
* @param roleId * @param roleId
* @param permissionId * @param permissionId
*/ */
@Insert("INSERT INTO DAHAI.SYS_ROLE_PERMISSION(ROLE_ID,PERMISSION_ID)VALUES(#{roleId},#{permissionId})") @Insert("INSERT INTO SYS_ROLE_PERMISSION(ROLE_ID,PERMISSION_ID)VALUES(#{roleId},#{permissionId})")
public void addRolePermission(@Param("roleId")Integer roleId,@Param("permissionId") Integer permissionId); public void addRolePermission(@Param("roleId")Integer roleId,@Param("permissionId") Integer permissionId);
/** /**
......
...@@ -15,7 +15,7 @@ public interface UserInfoMapper { ...@@ -15,7 +15,7 @@ public interface UserInfoMapper {
* @param userinfo * @param userinfo
* @return * @return
*/ */
@Insert("INSERT INTO DAHAI.USER_INFO(ID, NAME, PASSWORD, STATE, USERNAME, SALT) " + @Insert("INSERT INTO USER_INFO(ID, NAME, PASSWORD, STATE, USERNAME, SALT) " +
"VALUES(USER_INFO_seq.nextval,#{name},#{password},0,#{username},#{salt})\n") "VALUES(USER_INFO_seq.nextval,#{name},#{password},0,#{username},#{salt})\n")
@Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id") @Options(useGeneratedKeys = true, keyProperty = "id",keyColumn = "id")
public void saveUserInfo(UserInfo userinfo); public void saveUserInfo(UserInfo userinfo);
......
...@@ -17,4 +17,8 @@ public interface UtilMapper { ...@@ -17,4 +17,8 @@ public interface UtilMapper {
* 查询组号信息序列值 * 查询组号信息序列值
*/ */
public int findGroupInfoSequenceNextValue(); public int findGroupInfoSequenceNextValue();
/**
* 查询派出所照片质量表序列值
*/
public int findPoliceStationVailedSequenceNextValue();
} }
...@@ -2,6 +2,7 @@ package com.yxproject.start.service; ...@@ -2,6 +2,7 @@ package com.yxproject.start.service;
import com.yxproject.start.entity.GroupinfoEntity; import com.yxproject.start.entity.GroupinfoEntity;
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;
...@@ -14,6 +15,8 @@ public interface ProductionTaskListService { ...@@ -14,6 +15,8 @@ public interface ProductionTaskListService {
public int addQuickCyclesheetInfo(String acceptNo); public int addQuickCyclesheetInfo(String acceptNo);
public List<Object> findCardInfoByCardIDOrAcceptNo(String cardInfo); public List<Object> findCardInfoByCardIDOrAcceptNo(String cardInfo);
public List<Object> findAccuProductionInfo(String importDate); public List<Object> findAccuProductionInfo(String importDate);
public int savePoliceStationVailedInfoEntity(List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities);
public List<PoliceStationVailedInfoEntity> find(String id);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.GroupinfoEntity; import com.yxproject.start.entity.GroupinfoEntity;
import com.yxproject.start.entity.PoliceStationVailedInfoEntity;
import com.yxproject.start.entity.ProductionTaskListEntity; import com.yxproject.start.entity.ProductionTaskListEntity;
import com.yxproject.start.entity.accu.AccCardTEntity; import com.yxproject.start.entity.accu.AccCardTEntity;
import com.yxproject.start.entity.prod.ProdCardTEntity; import com.yxproject.start.entity.prod.ProdCardTEntity;
...@@ -31,11 +32,16 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -31,11 +32,16 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
@Autowired @Autowired
public UtilMapper utilMapper; public UtilMapper utilMapper;
@Autowired @Autowired
public AccCardTMapper accCardTMapper; public AccCardTMapper accCardTMapper;
@Autowired @Autowired
public ProdCardTMapper prodCardTMapper; public ProdCardTMapper prodCardTMapper;
@Autowired
public PoliceStationVailedInfoMapper policeStationVailedInfoMapper;
/** /**
* 查询任务单 * 查询任务单
* 通过任务单ID * 通过任务单ID
...@@ -108,8 +114,6 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -108,8 +114,6 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
accept_no = prodCardTEntity.getAccept_No() ; accept_no = prodCardTEntity.getAccept_No() ;
} }
} }
List<Map<String, Object>> accGroupTEntityByCardIdOrAcceptNo = accCardTMapper.findAccGroupTEntityByCardIdOrAcceptNo(accept_no);
System.out.println(accGroupTEntityByCardIdOrAcceptNo);
List<ProductionTaskListEntity> productionTaskListEntityByAcceptNo = productionTaskListMapper.findProductionTaskListEntityByAcceptNo(accept_no); List<ProductionTaskListEntity> productionTaskListEntityByAcceptNo = productionTaskListMapper.findProductionTaskListEntityByAcceptNo(accept_no);
list.addAll(productionTaskListEntityByAcceptNo); list.addAll(productionTaskListEntityByAcceptNo);
return list; return list;
...@@ -282,13 +286,9 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -282,13 +286,9 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
groupinfoEntity.setGrouptype((long)1); groupinfoEntity.setGrouptype((long)1);
groupinfoMapper.updateGroupinfoEntity(groupinfoEntity); groupinfoMapper.updateGroupinfoEntity(groupinfoEntity);
} }
} }
} }
return 1;
return 0;
} }
/** /**
...@@ -302,4 +302,32 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService ...@@ -302,4 +302,32 @@ public class ProductionTaskListServiceImpl implements ProductionTaskListService
public List<Object> findAccuProductionInfo(String importDate) { public List<Object> findAccuProductionInfo(String importDate) {
return new ArrayList<>(); return new ArrayList<>();
} }
/**
* 保持派出所照片质量详情
* @param policeStationVailedInfoEntities
* @return
*/
@Override
@Transactional(rollbackFor=Exception.class)
public int savePoliceStationVailedInfoEntity(List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntities) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
for (PoliceStationVailedInfoEntity policeEntity:policeStationVailedInfoEntities) {
int policeStationVailedSequenceNextValue = utilMapper.findPoliceStationVailedSequenceNextValue();
policeEntity.setPolice_Station_Vailed_Info_Id(simpleDateFormat.format(new Date())+policeStationVailedSequenceNextValue);
policeStationVailedInfoMapper.savePoliceStationVailedInfoEntity(policeEntity);
}
return 1;
}
/**
* 测试查询
* @param id
* @return
*/
@Override
public List<PoliceStationVailedInfoEntity> find(String id) {
List<PoliceStationVailedInfoEntity> policeStationVailedInfoEntityByID = policeStationVailedInfoMapper.findPoliceStationVailedInfoEntityByID(id);
return policeStationVailedInfoEntityByID;
}
} }
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