Commit b53ecaf6 authored by Administrator's avatar Administrator

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

# Conflicts:
#	src/main/java/com/yxproject/start/entity/CountyListInfoEntity.java
#	src/main/java/com/yxproject/start/service/impl/TaskServiceImpl.java
parents b4b3adcf 60d0b2da
...@@ -39,191 +39,200 @@ public class AdminApi { ...@@ -39,191 +39,200 @@ public class AdminApi {
@RequestMapping("test") @RequestMapping("test")
public String hello(){ public String hello() {
return "f1"; return "f1";
} }
/** /**
* 获得用户列表 * 获得用户列表
*
* @return * @return
*/ */
@RequestMapping("getUserList") @RequestMapping("getUserList")
public List<UserInfo> selectAllUser() { public List<UserInfo> selectAllUser() {
List<UserInfo> list = userInfoService.getAllUserInfo(); List<UserInfo> list = userInfoService.getAllUserInfo();
return list; return list;
} }
/** /**
* 用户添加; * 用户添加;
*
* @return * @return
*/ */
@PostMapping("userAdd") @PostMapping("userAdd")
public Map<String,String> userInfoAdd(@RequestBody String json){ public Map<String, String> userInfoAdd(@RequestBody String json) {
JSONObject jsonObject = JSONObject.fromObject(json); JSONObject jsonObject = JSONObject.fromObject(json);
String salt = UUID.randomUUID().toString(); String salt = UUID.randomUUID().toString();
UserInfo userInfo = new UserInfo(); UserInfo userInfo = new UserInfo();
userInfo.setPassword(Md5Utils.entryptPassword(jsonObject.getString("password"),salt)); userInfo.setPassword(Md5Utils.entryptPassword(jsonObject.getString("password"), salt));
userInfo.setSalt(salt); userInfo.setSalt(salt);
userInfo.setUsername(jsonObject.getString("username")); userInfo.setUsername(jsonObject.getString("username"));
userInfo.setName(jsonObject.getString("name")); userInfo.setName(jsonObject.getString("name"));
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
boolean flag = false; boolean flag = false;
flag = userInfoService.addUser(userInfo,Integer.parseInt(jsonObject.getString("roleId"))); flag = userInfoService.addUser(userInfo, Integer.parseInt(jsonObject.getString("roleId")));
if (flag){ if (flag) {
map.put("resultMsg","添加成功"); map.put("resultMsg", "添加成功");
}else { } else {
map.put("resultMsg","添加失败"); map.put("resultMsg", "添加失败");
} }
return map; return map;
} }
/** /**
* 通过id查询用户; * 通过id查询用户;
*
* @return * @return
*/ */
@RequestMapping(value = "getUserById",method = RequestMethod.GET) @RequestMapping(value = "getUserById", method = RequestMethod.GET)
public Map<String,Object> getUserById(@RequestParam("userId") String userId, HttpServletResponse response){ public Map<String, Object> getUserById(@RequestParam("userId") String userId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
UserInfo userInfo =userInfoService.getUserInfoByUserId(Integer.parseInt(userId)); UserInfo userInfo = userInfoService.getUserInfoByUserId(Integer.parseInt(userId));
map.put("user",userInfo); map.put("user", userInfo);
return map; return map;
} }
/** /**
* 用户删除; * 用户删除;
*
* @return * @return
*/ */
@RequestMapping(value = "userDel",method = RequestMethod.GET) @RequestMapping(value = "userDel", method = RequestMethod.GET)
public Map<String,Object> userInfoDel(@RequestParam("userId") String userId,HttpServletResponse response){ public Map<String, Object> userInfoDel(@RequestParam("userId") String userId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
boolean flag = false; boolean flag = false;
flag = userInfoService.deleteUserInfo(Integer.parseInt(userId)); flag = userInfoService.deleteUserInfo(Integer.parseInt(userId));
if(flag){ if (flag) {
map.put("returnMsg","删除成功"); map.put("returnMsg", "删除成功");
}else{ } else {
map.put("returnMsg","删除失败"); map.put("returnMsg", "删除失败");
} }
return map; return map;
} }
/** /**
* 用户启用; * 用户启用;
*
* @return * @return
*/ */
@RequestMapping(value = "userBack",method = RequestMethod.GET) @RequestMapping(value = "userBack", method = RequestMethod.GET)
public Map<String,Object> userInfoBack(@RequestParam("userId") String userId, HttpServletResponse response){ public Map<String, Object> userInfoBack(@RequestParam("userId") String userId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
boolean flag = false; boolean flag = false;
flag = userInfoService.BackUserInfo(Integer.parseInt(userId)); flag = userInfoService.BackUserInfo(Integer.parseInt(userId));
if(flag){ if (flag) {
map.put("returnMsg","启用成功"); map.put("returnMsg", "启用成功");
}else{ } else {
map.put("returnMsg","启用失败"); map.put("returnMsg", "启用失败");
} }
return map; return map;
} }
@RequestMapping("getRoleList") @RequestMapping("getRoleList")
public List<SysRole> selectAllRole() { public List<SysRole> selectAllRole() {
List<SysRole> list = sysRoleService.getAllRoleInfo(); List<SysRole> list = sysRoleService.getAllRoleInfo();
return list; return list;
} }
@RequestMapping("getPermissionList") @RequestMapping("getPermissionList")
public List<SysPermission> selectAllPermission() { public List<SysPermission> selectAllPermission() {
List<SysPermission> list = sysPermissionService.getAllPermission(); List<SysPermission> list = sysPermissionService.getAllPermission();
return list; return list;
} }
/** /**
* 权限删除; * 权限删除;
*
* @return * @return
*/ */
@RequestMapping("permissionDel") @RequestMapping("permissionDel")
public Map permissionDel(@RequestParam("permissionId") String permissionId,HttpServletResponse response){ public Map permissionDel(@RequestParam("permissionId") String permissionId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map map = new HashMap(); Map map = new HashMap();
boolean flag = false; boolean flag = false;
flag = sysPermissionService.deletePermission(Integer.parseInt(permissionId)); flag = sysPermissionService.deletePermission(Integer.parseInt(permissionId));
if(flag){ if (flag) {
map.put("returnMsg","删除成功"); map.put("returnMsg", "删除成功");
}else{ } else {
map.put("returnMsg","删除失败"); map.put("returnMsg", "删除失败");
} }
return map; return map;
} }
/** /**
* 权限启用; * 权限启用;
*
* @return * @return
*/ */
@RequestMapping("permissionOpen") @RequestMapping("permissionOpen")
public Map permissionBack(@RequestParam("permissionId") String permissionId,HttpServletResponse response){ public Map permissionBack(@RequestParam("permissionId") String permissionId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map map = new HashMap(); Map map = new HashMap();
boolean flag = false; boolean flag = false;
flag = sysPermissionService.backPermission(Integer.parseInt(permissionId)); flag = sysPermissionService.backPermission(Integer.parseInt(permissionId));
if(flag){ if (flag) {
map.put("returnMsg","启用成功"); map.put("returnMsg", "启用成功");
}else{ } else {
map.put("returnMsg","启用失败"); map.put("returnMsg", "启用失败");
} }
return map; return map;
} }
/** /**
* 通过id查询权限; * 通过id查询权限;
*
* @return * @return
*/ */
@RequestMapping(value = "getPermsById",method = RequestMethod.GET) @RequestMapping(value = "getPermsById", method = RequestMethod.GET)
public Map<String,Object> getPermsById(@RequestParam("permissionId") String permissionId, HttpServletResponse response){ public Map<String, Object> getPermsById(@RequestParam("permissionId") String permissionId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
SysPermission sysPermission =sysPermissionService.getPermissionByPId(Integer.parseInt(permissionId)); SysPermission sysPermission = sysPermissionService.getPermissionByPId(Integer.parseInt(permissionId));
map.put("permission",sysPermission); map.put("permission", sysPermission);
return map; return map;
} }
/** /**
* 通过id查询角色; * 通过id查询角色;
*
* @return * @return
*/ */
@RequestMapping(value = "getRoleById",method = RequestMethod.GET) @RequestMapping(value = "getRoleById", method = RequestMethod.GET)
public Map<String,Object> getRoleById(@RequestParam("roleId") String roleId, HttpServletResponse response){ public Map<String, Object> getRoleById(@RequestParam("roleId") String roleId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8");
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
SysRole sysRole =sysRoleService.getRoleByRoleId(Integer.parseInt(roleId)); SysRole sysRole = sysRoleService.getRoleByRoleId(Integer.parseInt(roleId));
map.put("role",sysRole); map.put("role", sysRole);
return map; return map;
} }
/** /**
* 添加权限 * 添加权限
*
* @param jsonStr * @param jsonStr
* @param resp * @param resp
* @return * @return
*/ */
@RequestMapping(value="permissionAdd",method = RequestMethod.POST) @RequestMapping(value = "permissionAdd", method = RequestMethod.POST)
public Map<String,String> userAdd(@RequestBody String jsonStr, HttpServletResponse resp){ public Map<String, String> userAdd(@RequestBody String jsonStr, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
boolean flag = false; boolean flag = false;
String str = "0"; String str = "0";
...@@ -240,44 +249,81 @@ public class AdminApi { ...@@ -240,44 +249,81 @@ public class AdminApi {
// } // }
System.out.println(sysPermission); System.out.println(sysPermission);
flag = sysPermissionService.addPermission(sysPermission); flag = sysPermissionService.addPermission(sysPermission);
if (flag){ if (flag) {
map.put("resultMsg","添加成功"); map.put("resultMsg", "添加成功");
}else { } else {
map.put("resultMsg","添加失败"); map.put("resultMsg", "添加失败");
} }
return map; return map;
} }
/** /**
* 查询所有非锁定角色; * 查询所有非锁定角色;
*
* @return * @return
*/ */
@RequestMapping(value = "getAllActiveRoleList",method = RequestMethod.GET) @RequestMapping(value = "getAllActiveRoleList", method = RequestMethod.GET)
public List<SysRole> userInfoAdd(){ public List<SysRole> userInfoAdd() {
List<SysRole> list = sysRoleService.getAllActiveRoleInfo(); List<SysRole> list = sysRoleService.getAllActiveRoleInfo();
return list; return list;
} }
/** /**
* 查询所有非锁定权限; * 查询所有非锁定权限;
*
* @return * @return
*/ */
@RequestMapping(value = "getAllActivePermissionList",method = RequestMethod.GET) @RequestMapping(value = "getAllActivePermissionList", method = RequestMethod.GET)
public List<SysPermission> getAllActivePermissionList(){ public List<SysPermission> getAllActivePermissionList() {
List<SysPermission> list = sysPermissionService.getAllActivePermission(); List<SysPermission> list = sysPermissionService.getAllActivePermission();
return list; return list;
} }
/**
* 角色删除;
*
* @return
*/
// @GET
// @Path("roleDel")
// @RequiresPermissions("role.del")
// public String roleDel(@QueryParam("roleId") String roleId,@Context HttpServletResponse response){
// response.setCharacterEncoding("UTF-8");
// Map map = new HashMap();
// boolean flag = false;
// flag = sysRoleService.deleteRole(Integer.parseInt(roleId));
// if(flag){
// map.put("returnMsg","删除成功");
// }else{
// map.put("returnMsg","删除失败");
// }
// return map.toString();
// }
// @GET
// @Path("roleBack")
// public String roleBack(@QueryParam("roleId") String roleId,@Context HttpServletResponse response){
// response.setCharacterEncoding("UTF-8");
// Map map = new HashMap();
// boolean flag = false;
// flag = sysRoleService.backRole(Integer.parseInt(roleId));
// if(flag){
// map.put("returnMsg","启用成功");
// }else{
// map.put("returnMsg","启用失败");
// }
// return map.toString();
// }
@RequestMapping("roleAdd") @RequestMapping("roleAdd")
public Map<String,String> roleAdd(@RequestBody String jsonStr,HttpServletResponse resp) { public Map<String, String> roleAdd(@RequestBody String jsonStr, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
boolean flag = false; boolean flag = false;
SysRole sysRole = new SysRole(); SysRole sysRole = new SysRole();
...@@ -286,42 +332,42 @@ public class AdminApi { ...@@ -286,42 +332,42 @@ public class AdminApi {
String permissionIds = jsonObject.getString("permissionIds"); String permissionIds = jsonObject.getString("permissionIds");
JSONArray jsonArray = JSONArray.fromObject(permissionIds); JSONArray jsonArray = JSONArray.fromObject(permissionIds);
flag = sysRoleService.addRole(sysRole,jsonArray); flag = sysRoleService.addRole(sysRole, jsonArray);
if (flag){ if (flag) {
map.put("resultMsg","添加成功"); map.put("resultMsg", "添加成功");
}else { } else {
map.put("resultMsg","添加失败"); map.put("resultMsg", "添加失败");
} }
return map; return map;
} }
@PostMapping("userUpdate") @PostMapping("userUpdate")
public Map<String,String> userInfoUpdate(@RequestBody String json,HttpServletResponse resp) { public Map<String, String> userInfoUpdate(@RequestBody String json, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
JSONObject jsonObject = JSONObject.fromObject(json); JSONObject jsonObject = JSONObject.fromObject(json);
UserInfo userInfo = new UserInfo(); UserInfo userInfo = new UserInfo();
userInfo.setUsername(jsonObject.getString("username")); userInfo.setUsername(jsonObject.getString("username"));
userInfo.setName(jsonObject.getString("name")); userInfo.setName(jsonObject.getString("name"));
userInfo.setId(Integer.parseInt(jsonObject.getString("id"))); userInfo.setId(Integer.parseInt(jsonObject.getString("id")));
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
boolean flag = false; boolean flag = false;
flag = userInfoService.updateUser(userInfo,Integer.parseInt(jsonObject.getString("roleId")),Integer.parseInt(jsonObject.getString("oldRoleId"))); flag = userInfoService.updateUser(userInfo, Integer.parseInt(jsonObject.getString("roleId")), Integer.parseInt(jsonObject.getString("oldRoleId")));
if (flag){ if (flag) {
map.put("resultMsg","修改成功"); map.put("resultMsg", "修改成功");
}else { } else {
map.put("resultMsg","修改失败"); map.put("resultMsg", "修改失败");
} }
return map; return map;
} }
@RequestMapping("roleUpdate") @RequestMapping("roleUpdate")
public Map roleUpdate(@RequestBody String jsonStr,HttpServletResponse resp) { public Map roleUpdate(@RequestBody String jsonStr, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
boolean flag = false; boolean flag = false;
SysRole sysRole = new SysRole(); SysRole sysRole = new SysRole();
...@@ -331,13 +377,13 @@ public class AdminApi { ...@@ -331,13 +377,13 @@ public class AdminApi {
String oldPermissionIds = jsonObject.getString("oldPermissionIds"); String oldPermissionIds = jsonObject.getString("oldPermissionIds");
JSONArray jsonArrayOldPids = JSONArray.fromObject(oldPermissionIds); JSONArray jsonArrayOldPids = JSONArray.fromObject(oldPermissionIds);
String permissionIds = jsonObject.getString("permissionId"); String permissionIds = jsonObject.getString("permissionId");
JSONArray jsonArrayPids = JSONArray.fromObject(permissionIds); JSONArray jsonArrayPids = JSONArray.fromObject(permissionIds);
flag = sysRoleService.updateRole(sysRole,jsonArrayPids,jsonArrayOldPids); flag = sysRoleService.updateRole(sysRole, jsonArrayPids, jsonArrayOldPids);
if (flag){ if (flag) {
map.put("resultMsg","修改成功"); map.put("resultMsg", "修改成功");
}else { } else {
map.put("resultMsg","修改失败"); map.put("resultMsg", "修改失败");
} }
return map; return map;
...@@ -345,10 +391,10 @@ public class AdminApi { ...@@ -345,10 +391,10 @@ public class AdminApi {
@PostMapping("permissionUpdate") @PostMapping("permissionUpdate")
public Map<String,String> permissionUpdate(@RequestBody String jsonStr,HttpServletResponse resp){ public Map<String, String> permissionUpdate(@RequestBody String jsonStr, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
JSONObject jsonObject = JSONObject.fromObject(jsonStr); JSONObject jsonObject = JSONObject.fromObject(jsonStr);
Map<String,String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
boolean flag = false; boolean flag = false;
// String str = "0"; // String str = "0";
SysPermission sysPermission = new SysPermission(); SysPermission sysPermission = new SysPermission();
...@@ -365,11 +411,11 @@ public class AdminApi { ...@@ -365,11 +411,11 @@ public class AdminApi {
// } // }
System.out.println(sysPermission); System.out.println(sysPermission);
flag = sysPermissionService.updatePermission(sysPermission); flag = sysPermissionService.updatePermission(sysPermission);
if (flag){ if (flag) {
map.put("resultMsg","修改成功"); map.put("resultMsg", "修改成功");
}else { } else {
map.put("resultMsg","修改失败"); map.put("resultMsg", "修改失败");
} }
return map; return map;
......
...@@ -41,9 +41,9 @@ public class UserApi { ...@@ -41,9 +41,9 @@ public class UserApi {
@Autowired @Autowired
private FailedCardService failedCardService; private FailedCardService failedCardService;
@Autowired @Autowired
private CountyListInfoService countyListInfoService; private CountyListService countyListService;
@Autowired @Autowired
private CardBodyInfoService cardBodyInfoService; private CardBodyService cardBodyService;
@PostMapping("login") @PostMapping("login")
public Map<String, Object> submitLogin(@RequestBody String jsonStr) { public Map<String, Object> submitLogin(@RequestBody String jsonStr) {
...@@ -59,14 +59,14 @@ public class UserApi { ...@@ -59,14 +59,14 @@ public class UserApi {
UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal(); UserInfo userInfo = (UserInfo) SecurityUtils.getSubject().getPrincipal();
resultMap.put("status", 200); resultMap.put("status", 200);
resultMap.put("message", "登录成功"); resultMap.put("message", "登录成功");
resultMap.put("user",userInfo); resultMap.put("user", userInfo);
} catch (UnknownAccountException e) { } catch (UnknownAccountException e) {
resultMap.put("status", 201); resultMap.put("status", 201);
resultMap.put("message", "账号不存在!"); resultMap.put("message", "账号不存在!");
}catch(IncorrectCredentialsException e1){ } catch (IncorrectCredentialsException e1) {
resultMap.put("status", 202); resultMap.put("status", 202);
resultMap.put("message", "密码错误!"); resultMap.put("message", "密码错误!");
}catch (Exception e) { } catch (Exception e) {
resultMap.put("status", 500); resultMap.put("status", 500);
resultMap.put("message", "用户名密码错误"); resultMap.put("message", "用户名密码错误");
} }
...@@ -80,13 +80,15 @@ public class UserApi { ...@@ -80,13 +80,15 @@ public class UserApi {
subject.logout(); subject.logout();
} }
} }
/** /**
* 查询任务单; * 查询任务单;
*
* @return * @return
*/ */
@RequestMapping(value = "/getProductionTaskListByID", method = RequestMethod.GET) @RequestMapping(value = "/getProductionTaskListByID", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public String getProductionTaskListByID(@RequestParam("id") String id, HttpServletResponse resp) { public String getProductionTaskListByID(@RequestParam("id") String id, HttpServletResponse resp) {
List<TaskEntity> productionTaskListEntity = taskService.findProductionTaskListEntityByID(Long.valueOf(id)); List<TaskEntity> productionTaskListEntity = taskService.findProductionTaskListEntityByID(Long.valueOf(id));
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
...@@ -99,12 +101,13 @@ public class UserApi { ...@@ -99,12 +101,13 @@ public class UserApi {
/** /**
* 更新任务单; * 更新任务单;
*
* @return * @return
*/ */
@RequestMapping(value = "/updateProductionTask", method = RequestMethod.GET) @RequestMapping(value = "/updateProductionTask", method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody @ResponseBody
public String updateProductionTask(@RequestParam("id") String id, HttpServletResponse resp) { public String updateProductionTask(@RequestParam("id") String id, HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} "; String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map); JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class); TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class);
...@@ -123,13 +126,13 @@ public class UserApi { ...@@ -123,13 +126,13 @@ public class UserApi {
@RequestMapping(value = "/addProductionTaskList", method = RequestMethod.GET) @RequestMapping(value = "/addProductionTaskList", method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody @ResponseBody
public String addProductionTaskList(@RequestParam("id") String id, HttpServletResponse resp) { public String addProductionTaskList(@RequestParam("id") String id, HttpServletResponse resp) {
String map = "{\"productionTaskListId\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}"; String map = "{\"productionTaskListId\":\"20181016001\",\"makeType\":4,\"oldMakeType\":7}";
JSONObject jsonObject = JSONObject.fromObject(map); JSONObject jsonObject = JSONObject.fromObject(map);
Object taskList = jsonObject.get("taskList"); Object taskList = jsonObject.get("taskList");
Object groupInfoList = jsonObject.get("groupInfoList"); Object groupInfoList = jsonObject.get("groupInfoList");
List<GroupNoEntity> groupNoEntities = (List<GroupNoEntity>) groupInfoList; List<GroupNoEntity> groupNoEntities = (List<GroupNoEntity>) groupInfoList;
TaskEntity taskEntity = (TaskEntity) taskList; TaskEntity taskEntity = (TaskEntity) taskList;
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
...@@ -140,12 +143,13 @@ public class UserApi { ...@@ -140,12 +143,13 @@ public class UserApi {
/** /**
* 查询证件信息; * 查询证件信息;
*
* @return * @return
*/ */
@RequestMapping(value = "/findCardInfoByCardIDOrAcceptNo", method = RequestMethod.GET) @RequestMapping(value = "/findCardInfoByCardIDOrAcceptNo", method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody @ResponseBody
public String findCardInfoByCardIDOrAcceptNo(@RequestParam("id") String id, HttpServletResponse resp) { public String findCardInfoByCardIDOrAcceptNo(@RequestParam("id") String id, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
...@@ -156,12 +160,13 @@ public class UserApi { ...@@ -156,12 +160,13 @@ public class UserApi {
/** /**
* 添加快证任务单; * 添加快证任务单;
*
* @return * @return
*/ */
@RequestMapping(value = "/addQuickCyclesheetInfo", method = RequestMethod.GET) @RequestMapping(value = "/addQuickCyclesheetInfo", method = RequestMethod.GET)
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody @ResponseBody
public String addQuickCyclesheetInfo(@RequestParam("id") String id, HttpServletResponse resp) { public String addQuickCyclesheetInfo(@RequestParam("id") String id, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
...@@ -202,7 +207,7 @@ public class UserApi { ...@@ -202,7 +207,7 @@ public class UserApi {
@RequestMapping("/test") @RequestMapping("/test")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
@ResponseBody @ResponseBody
public String test(@RequestParam("id") String permissionId,HttpServletResponse resp) { public String test(@RequestParam("id") String permissionId, HttpServletResponse resp) {
//TODO //TODO
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
...@@ -214,66 +219,70 @@ public class UserApi { ...@@ -214,66 +219,70 @@ public class UserApi {
/** /**
* 保存废证详情; * 保存废证详情;
*
* @return * @return
*/ */
@RequestMapping("addFailedinfo") @RequestMapping("addFailedinfo")
public String addFailedinfo(@RequestParam("id") String id,HttpServletResponse resp){ public String addFailedinfo(@RequestParam("id") String id, HttpServletResponse resp) {
String map ="[{\"failedinfoid\":\"20181016002\",\"failed_Reason\":1,\"groupno\":\"41108201\",\"cyclesheetid\":\"20181016001\"}]"; String map = "[{\"failedinfoid\":\"20181016002\",\"failed_Reason\":1,\"groupno\":\"41108201\",\"cyclesheetid\":\"20181016001\"}]";
JSONArray jsonArray = JSONArray.fromObject(map); JSONArray jsonArray = JSONArray.fromObject(map);
List<FailedCardEntity> failedinfoEntityList = new ArrayList<>(); List<FailedCardEntity> failedinfoEntityList = new ArrayList<>();
for (Object object: jsonArray) { for (Object object : jsonArray) {
FailedCardEntity o = (FailedCardEntity) JSONObject.toBean((JSONObject) object, FailedCardEntity.class); FailedCardEntity o = (FailedCardEntity) JSONObject.toBean((JSONObject) object, FailedCardEntity.class);
failedinfoEntityList.add(o); failedinfoEntityList.add(o);
} }
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
int i = failedCardService.saveFailedinfo(failedinfoEntityList); int i = failedCardService.saveFailedinfo(failedinfoEntityList);
yxjsonResponse.outPutSuccess(i+"添加成功"); yxjsonResponse.outPutSuccess(i + "添加成功");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
/** /**
* 更新废证详情; * 更新废证详情;
*
* @return * @return
*/ */
@RequestMapping("updateFailedinfo") @RequestMapping("updateFailedinfo")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String updateFailedinfo(@RequestParam("id") String id, HttpServletResponse resp){ public String updateFailedinfo(@RequestParam("id") String id, HttpServletResponse resp) {
String map ="[{\"failedinfoid\":\"201810302\",\"failed_Reason\":1,\"groupno\":\"411081\",\"cyclesheetid\":\"20181016001\"}]"; String map = "[{\"failedinfoid\":\"201810302\",\"failed_Reason\":1,\"groupno\":\"411081\",\"cyclesheetid\":\"20181016001\"}]";
JSONArray jsonArray = JSONArray.fromObject(map); JSONArray jsonArray = JSONArray.fromObject(map);
List<FailedCardEntity> failedinfoEntityList = new ArrayList<>(); List<FailedCardEntity> failedinfoEntityList = new ArrayList<>();
for (Object object: jsonArray) { for (Object object : jsonArray) {
FailedCardEntity o = (FailedCardEntity) JSONObject.toBean((JSONObject) object, FailedCardEntity.class); FailedCardEntity o = (FailedCardEntity) JSONObject.toBean((JSONObject) object, FailedCardEntity.class);
failedinfoEntityList.add(o); failedinfoEntityList.add(o);
} }
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
int i = failedCardService.updateFailedinfo(failedinfoEntityList); int i = failedCardService.updateFailedinfo(failedinfoEntityList);
yxjsonResponse.outPutSuccess(i+"更新成功"); yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
/** /**
* 查询废证详情; * 查询废证详情;
*
* @return * @return
*/ */
@RequestMapping("findFailedinfo") @RequestMapping("findFailedinfo")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String findFailedinfo(@RequestParam("id") String id, HttpServletResponse resp){ public String findFailedinfo(@RequestParam("id") String id, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> maps = failedCardService.selectFailedinfo(Integer.valueOf(id)); List<Map<String, Object>> maps = failedCardService.selectFailedinfo(Integer.valueOf(id));
yxjsonResponse.outPutSuccess(maps+"------添加成功---"+maps.size()); yxjsonResponse.outPutSuccess(maps + "------添加成功---" + maps.size());
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
/** /**
* 查询任务单详情; * 查询任务单详情;
*
* @return * @return
*/ */
@RequestMapping("findProductionTaskListByState") @RequestMapping("findProductionTaskListByState")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String findProductionTaskListByState(@RequestParam("state") String state, HttpServletResponse resp){ public String findProductionTaskListByState(@RequestParam("state") String state, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> productionTaskInfoList = taskService.findProductionTaskListEntityByState(Integer.valueOf(state)); List<Map<String, Object>> productionTaskInfoList = taskService.findProductionTaskListEntityByState(Integer.valueOf(state));
...@@ -282,12 +291,13 @@ public class UserApi { ...@@ -282,12 +291,13 @@ public class UserApi {
} }
/** /**
* 查询区县列表详情; * 查询区县列表详情;
*
* @return * @return
*/ */
@RequestMapping("findProdCountyList") @RequestMapping("findProdCountyList")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String findProdCountyList(@RequestParam("cyclesheetID") String cyclesheetID, HttpServletResponse resp){ public String findProdCountyList(@RequestParam("cyclesheetID") String cyclesheetID, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
List<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(cyclesheetID); List<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(cyclesheetID);
...@@ -296,16 +306,17 @@ public class UserApi { ...@@ -296,16 +306,17 @@ public class UserApi {
} }
/** /**
* 保存派出所申请类型数量; * 保存派出所申请类型数量;
*
* @return * @return
*/ */
@RequestMapping("savePoliceApplyCount") @RequestMapping("savePoliceApplyCount")
@RequiresPermissions("userInfo.add")//权限管理; @RequiresPermissions("userInfo.add")//权限管理;
public String savePoliceApplyCount(@RequestParam("cyclesheetID") String cyclesheetID, HttpServletResponse resp){ public String savePoliceApplyCount(@RequestParam("cyclesheetID") String cyclesheetID, HttpServletResponse resp) {
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
int i = policeStationApplyReasonService.savePoliceStationApplyReasonEntity(cyclesheetID); int i = policeStationApplyReasonService.savePoliceStationApplyReasonEntity(cyclesheetID);
yxjsonResponse.outPutSuccess(i+""); yxjsonResponse.outPutSuccess(i + "");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
...@@ -324,7 +335,7 @@ public class UserApi { ...@@ -324,7 +335,7 @@ public class UserApi {
String fout = null; String fout = null;
List<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(taskID); List<Map<String, Object>> countyInfoList = groupNoService.findCountyInfoList(taskID);
List<TaskEntity> taskEntities = taskService.findProductionTaskListEntityByID(Long.valueOf(taskID)); List<TaskEntity> taskEntities = taskService.findProductionTaskListEntityByID(Long.valueOf(taskID));
fout = exportExcel(countyInfoList, taskEntities.get(0).getCard_Type()+"", "p1", 6000, taskEntities.get(0).getCitycode() ,dateTime,taskID); fout = exportExcel(countyInfoList, taskEntities.get(0).getCard_Type() + "", "p1", 6000, taskEntities.get(0).getCitycode(), dateTime, taskID);
String outFile = dateTime + taskEntities.get(0).getCitycode() + "二代身份证统计表"; String outFile = dateTime + taskEntities.get(0).getCitycode() + "二代身份证统计表";
try { try {
FileInputStream fis = new FileInputStream(new File(fout)); FileInputStream fis = new FileInputStream(new File(fout));
...@@ -351,7 +362,7 @@ public class UserApi { ...@@ -351,7 +362,7 @@ public class UserApi {
// @RequiresPermissions("userInfo.add")//权限管理; // @RequiresPermissions("userInfo.add")//权限管理;
public String getCountyListInfoByTaskListID(@RequestParam("taskListID") String tasklistid, HttpServletResponse resp) { public String getCountyListInfoByTaskListID(@RequestParam("taskListID") String tasklistid, HttpServletResponse resp) {
List<CountyListInfoEntity> countyListInfoEntity = countyListInfoService.findCountyListByTaskListID(tasklistid); List<CountyListEntity> countyListInfoEntity = countyListService.findCountyListByTaskListID(tasklistid);
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countyListInfoEntity); yxjsonResponse.outPutSuccess(countyListInfoEntity);
...@@ -373,10 +384,10 @@ public class UserApi { ...@@ -373,10 +384,10 @@ public class UserApi {
Object cardBodyInfo = jsonObject.get("CardBody"); Object cardBodyInfo = jsonObject.get("CardBody");
Object groupInfoList = jsonObject.get("groupInfoList"); Object groupInfoList = jsonObject.get("groupInfoList");
List<GroupNoEntity> groupNoEntities = (List<GroupNoEntity>) groupInfoList; List<GroupNoEntity> groupNoEntities = (List<GroupNoEntity>) groupInfoList;
CardBodyInfoEntity cardBodyInfoEntity = (CardBodyInfoEntity) cardBodyInfo; CardBodyEntity cardBodyEntity = (CardBodyEntity) cardBodyInfo;
YXJSONResponse yxjsonResponse = new YXJSONResponse(); YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8"); resp.setCharacterEncoding("UTF-8");
int i = cardBodyInfoService.addCardBodyInfoEntity(cardBodyInfoEntity, groupNoEntities); int i = cardBodyService.addCardBodyEntity(cardBodyEntity, groupNoEntities);
yxjsonResponse.outPutSuccess(i + "添加成功"); yxjsonResponse.outPutSuccess(i + "添加成功");
return yxjsonResponse.toJSONString(); return yxjsonResponse.toJSONString();
} }
...@@ -458,14 +469,14 @@ public class UserApi { ...@@ -458,14 +469,14 @@ public class UserApi {
* 下载装箱单 * 下载装箱单
* *
* @param countyInfoList 装箱单信息 * @param countyInfoList 装箱单信息
* @param typeName 制证类型 * @param typeName 制证类型
* @param workShop 制证车间 * @param workShop 制证车间
* @param sum 总数 * @param sum 总数
* @param cityName 地市 * @param cityName 地市
*/ */
private String exportExcel(List<Map<String, Object>> countyInfoList, String typeName, String workShop, int sum, String cityName,String permanentPositionDate ,String cyclesheetid) { private String exportExcel(List<Map<String, Object>> countyInfoList, String typeName, String workShop, int sum, String cityName, String permanentPositionDate, String cyclesheetid) {
if (typeName.contains("null")){ if (typeName.contains("null")) {
typeName=typeName.replace("null",""); typeName = typeName.replace("null", "");
} }
//第一步创建workbook //第一步创建workbook
HSSFWorkbook wb = new HSSFWorkbook(); HSSFWorkbook wb = new HSSFWorkbook();
...@@ -572,8 +583,8 @@ public class UserApi { ...@@ -572,8 +583,8 @@ public class UserApi {
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("");
...@@ -842,8 +853,8 @@ public class UserApi { ...@@ -842,8 +853,8 @@ public class UserApi {
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);
...@@ -1035,7 +1046,7 @@ public class UserApi { ...@@ -1035,7 +1046,7 @@ public class UserApi {
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);
...@@ -1076,7 +1087,7 @@ public class UserApi { ...@@ -1076,7 +1087,7 @@ public class UserApi {
} }
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);
......
...@@ -38,10 +38,10 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -38,10 +38,10 @@ public class MyShiroRealm extends AuthorizingRealm {
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
System.out.println("权限配置-->MyShiroRealm.doGetAuthorizationInfo()"); System.out.println("权限配置-->MyShiroRealm.doGetAuthorizationInfo()");
SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo(); SimpleAuthorizationInfo authorizationInfo = new SimpleAuthorizationInfo();
UserInfo userInfo = (UserInfo)principals.getPrimaryPrincipal(); UserInfo userInfo = (UserInfo) principals.getPrimaryPrincipal();
for(SysRole role:userInfo.getRoleList()){ for (SysRole role : userInfo.getRoleList()) {
authorizationInfo.addRole(role.getRole()); authorizationInfo.addRole(role.getRole());
for(SysPermission p:role.getPermissions()){ for (SysPermission p : role.getPermissions()) {
authorizationInfo.addStringPermission(p.getPermission()); authorizationInfo.addStringPermission(p.getPermission());
} }
} }
...@@ -49,7 +49,6 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -49,7 +49,6 @@ public class MyShiroRealm extends AuthorizingRealm {
} }
/** /**
*
* @param token * @param token
* @return * @return
* @throws AuthenticationException * @throws AuthenticationException
...@@ -59,13 +58,13 @@ public class MyShiroRealm extends AuthorizingRealm { ...@@ -59,13 +58,13 @@ public class MyShiroRealm extends AuthorizingRealm {
throws AuthenticationException { throws AuthenticationException {
System.out.println("MyShiroRealm.doGetAuthenticationInfo()"); System.out.println("MyShiroRealm.doGetAuthenticationInfo()");
//获取用户的输入的账号. //获取用户的输入的账号.
String username = (String)token.getPrincipal(); String username = (String) token.getPrincipal();
System.out.println(username); System.out.println(username);
System.out.println(token.getCredentials().toString()); System.out.println(token.getCredentials().toString());
//通过username从数据库中查找 User对象,如果找到,没找到. //通过username从数据库中查找 User对象,如果找到,没找到.
//实际项目中,这里可以根据实际情况做缓存,如果不做,Shiro自己也是有时间间隔机制,2分钟内不会重复执行该方法 //实际项目中,这里可以根据实际情况做缓存,如果不做,Shiro自己也是有时间间隔机制,2分钟内不会重复执行该方法
UserInfo user = userInfoService.findByUsername(username); UserInfo user = userInfoService.findByUsername(username);
if(user == null || user.getState()==1){ if (user == null || user.getState() == 1) {
return null; return null;
} }
SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo( SimpleAuthenticationInfo authenticationInfo = new SimpleAuthenticationInfo(
......
...@@ -33,43 +33,43 @@ import java.util.*; ...@@ -33,43 +33,43 @@ import java.util.*;
@Configuration @Configuration
public class ShiroConfig { public class ShiroConfig {
@Autowired @Autowired
private MyShiroRealm realm; private MyShiroRealm realm;
@Bean @Bean
public MyShiroRealm customRealm() { public MyShiroRealm customRealm() {
return new MyShiroRealm(); return new MyShiroRealm();
} }
@Bean @Bean
public DefaultWebSecurityManager securityManager() { public DefaultWebSecurityManager securityManager() {
System.out.println("添加了DefaultWebSecurityManager"); System.out.println("添加了DefaultWebSecurityManager");
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
securityManager.setRealm(realm); securityManager.setRealm(realm);
return securityManager; return securityManager;
} }
@Bean @Bean
public static DefaultAdvisorAutoProxyCreator getDefaultAdvisorAutoProxyCreator(){ public static DefaultAdvisorAutoProxyCreator getDefaultAdvisorAutoProxyCreator() {
DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator=new DefaultAdvisorAutoProxyCreator(); DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator = new DefaultAdvisorAutoProxyCreator();
defaultAdvisorAutoProxyCreator.setUsePrefix(true); defaultAdvisorAutoProxyCreator.setUsePrefix(true);
return defaultAdvisorAutoProxyCreator; return defaultAdvisorAutoProxyCreator;
} }
@Bean @Bean
public ShiroFilterChainDefinition shiroFilterChainDefinition() { public ShiroFilterChainDefinition shiroFilterChainDefinition() {
System.out.println("添加了过滤器链"); System.out.println("添加了过滤器链");
DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition(); DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition();
chainDefinition.addPathDefinition("/admin/**", "authc"); chainDefinition.addPathDefinition("/admin/**", "authc");
chainDefinition.addPathDefinition("/admin/**", "roles[admin]"); chainDefinition.addPathDefinition("/admin/**", "roles[admin]");
chainDefinition.addPathDefinition("/user/login", "anon"); chainDefinition.addPathDefinition("/user/login", "anon");
chainDefinition.addPathDefinition("/user/logout", "anon"); chainDefinition.addPathDefinition("/user/logout", "anon");
chainDefinition.addPathDefinition("/user/**", "authc"); chainDefinition.addPathDefinition("/user/**", "authc");
chainDefinition.addPathDefinition("/**", "anon"); chainDefinition.addPathDefinition("/**", "anon");
return chainDefinition; return chainDefinition;
} }
} }
...@@ -2,72 +2,99 @@ package com.yxproject.start.entity; ...@@ -2,72 +2,99 @@ package com.yxproject.start.entity;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Time; import java.sql.Time;
import java.util.Date;
import java.util.Objects; import java.util.Objects;
/** /**
* Created by zhangyusheng on 2018/11/16 10:51 * Created by zhangyusheng on 2018/11/16 10:51
*/ */
@Entity @Entity
@Table(name = "CARD_BODY", schema = "DAHAI", catalog = "") @Table(name = "CARD_BODY", schema = "DAHAI")
public class CardBodyEntity { public class CardBodyEntity {
private long cardBodyId;
private Time saveDate;
private long isActive;
private long totalCount;
private long card_Body_Id;
private Date save_Date;
private long card_Type_Id;
private long is_Active;
private long task_Id;
private long total_Count;
@Id @Id
@Column(name = "CARD_BODY_ID", nullable = false, precision = 0) @Column(name = "CARD_BODY_ID", nullable = false, precision = 0)
public long getCardBodyId() { public long getCard_Body_Id() {
return cardBodyId; return card_Body_Id;
} }
public void setCardBodyId(long cardBodyId) { public void setCard_Body_Id(long card_Body_Id) {
this.cardBodyId = cardBodyId; this.card_Body_Id = card_Body_Id;
} }
@Basic @Basic
@Column(name = "SAVE_DATE", nullable = false) @Column(name = "SAVE_DATE", nullable = false)
public Time getSaveDate() { public Date getSave_Date() {
return saveDate; return save_Date;
} }
public void setSaveDate(Time saveDate) { public void setSave_Date(Date save_Date) {
this.saveDate = saveDate; this.save_Date = save_Date;
}
@Basic
@Column(name = "CARD_TYPE_ID", nullable = false, precision = 0)
public long getCard_Type_Id() {
return card_Type_Id;
}
public void setCard_Type_Id(long card_Type_Id) {
this.card_Type_Id = card_Type_Id;
} }
@Basic @Basic
@Column(name = "IS_ACTIVE", nullable = false, precision = 0) @Column(name = "IS_ACTIVE", nullable = false, precision = 0)
public long getIsActive() { public long getIs_Active() {
return isActive; return is_Active;
}
public void setIs_Active(long is_Active) {
this.is_Active = is_Active;
}
@Basic
@Column(name = "TASK_ID", nullable = false, precision = 0)
public long getTask_Id() {
return task_Id;
} }
public void setIsActive(long isActive) { public void setTask_Id(long task_id) {
this.isActive = isActive; this.task_Id = task_Id;
} }
@Basic @Basic
@Column(name = "TOTAL_COUNT", nullable = false, precision = 0) @Column(name = "TOTAL_COUNT", nullable = false, precision = 0)
public long getTotalCount() { public long getTotal_Count() {
return totalCount; return total_Count;
} }
public void setTotalCount(long totalCount) { public void setTotal_Count(long total_Count) {
this.totalCount = totalCount; this.total_Count = total_Count;
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CardBodyEntity that = (CardBodyEntity) o; CardBodyEntity that = (CardBodyEntity) o;
return cardBodyId == that.cardBodyId && return card_Body_Id == that.card_Body_Id &&
isActive == that.isActive && card_Type_Id == that.card_Type_Id &&
totalCount == that.totalCount && is_Active == that.is_Active &&
Objects.equals(saveDate, that.saveDate); task_Id == that.task_Id &&
total_Count == that.total_Count &&
Objects.equals(save_Date, that.save_Date);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(cardBodyId, saveDate, isActive, totalCount); return Objects.hash(card_Body_Id, card_Type_Id, is_Active, task_Id,total_Count,save_Date);
} }
} }
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* Created liuxinben on 2018/11/7.9:21
*/
@Entity
@Table(name = "CARD_BODY_INFO", schema = "DAHAI", catalog = "")
public class CardBodyInfoEntity {
private String card_Body_Info_Id;
private String card_Body_Info_Save_Date;
private String card_Body_Type;
private String cyclesheetid;
private Long is_Active;
private Long card_Body_Count;
@Id
@Column(name = "CARD_BODY_INFO_ID",nullable = false, length = 20)
public String getCardBodyInfoId() {
return card_Body_Info_Id;
}
public void setCardBodyInfoId(String cardBodyInfoId) {
this.card_Body_Info_Id = cardBodyInfoId;
}
@Basic
@Column(name = "CARD_BODY_INFO_SAVE_DATE",nullable = false, length = 20)
public String getCardBodyInfoSaveDate() {
return card_Body_Info_Save_Date;
}
public void setCardBodyInfoSaveDate(String cardBodyInfoSaveDate) {
this.card_Body_Info_Save_Date = cardBodyInfoSaveDate;
}
@Basic
@Column(name = "CARD_BODY_TYPE",nullable = false, length = 20)
public String getCardBodyType() {
return card_Body_Type;
}
public void setCardBodyType(String cardBodyType) {
this.card_Body_Type = cardBodyType;
}
@Basic
@Column(name = "CYCLESHEETID", nullable = true, length = 20)
public String getCyclesheetid() {
return cyclesheetid;
}
public void setCyclesheetid(String cyclesheetid) {
this.cyclesheetid = cyclesheetid;
}
@Basic
@Column(name = "IS_ACTIVE",nullable = false, length = 20)
public Long getIsActive() {
return is_Active;
}
public void setIsActive(Long isActive) {
this.is_Active = isActive;
}
@Basic
@Column(name = "CARD_BODY_COUNT",nullable = false, length = 20)
public Long getCardBodyCount() {
return card_Body_Count;
}
public void setCardBodyCount(Long cardBodyCount) {
this.card_Body_Count = cardBodyCount;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CardBodyInfoEntity that = (CardBodyInfoEntity) o;
return Objects.equals(card_Body_Info_Id, that.card_Body_Info_Id) &&
Objects.equals(card_Body_Info_Save_Date, that.card_Body_Info_Save_Date) &&
Objects.equals(is_Active, that.is_Active) &&
Objects.equals(cyclesheetid, that.cyclesheetid) &&
Objects.equals(card_Body_Type, that.card_Body_Type) &&
Objects.equals(card_Body_Count, that.card_Body_Count) ;
}
@Override
public int hashCode() {
return Objects.hash(card_Body_Info_Id, card_Body_Info_Save_Date, is_Active, card_Body_Count, cyclesheetid, card_Body_Type);
}
}
...@@ -2,68 +2,87 @@ package com.yxproject.start.entity; ...@@ -2,68 +2,87 @@ package com.yxproject.start.entity;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Time; import java.sql.Time;
import java.util.Date;
import java.util.Objects; import java.util.Objects;
/** /**
* Created by zhangyusheng on 2018/11/16 10:51 * Created by zhangyusheng on 2018/11/16 10:51
*/ */
@Entity @Entity
@Table(name = "COUNTY_LIST", schema = "DAHAI", catalog = "") @Table(name = "COUNTY_LIST", schema = "DAHAI")
public class CountyListEntity { public class CountyListEntity {
private long countyListId; private long county_List_Id;
private Time saveDate; private long task_Id;
private Long finishCount; private Date save_Date;
private Long inStorageCount; private String county_Code;
private Long outStorageCount; private long finish_Count;
private long in_Storage_Count;
private long out_Storage_Count;
@Id @Id
@Column(name = "COUNTY_LIST_ID", nullable = false, precision = 0) @Column(name = "COUNTY_LIST_ID", nullable = false, precision = 0)
public long getCountyListId() { public long getCounty_List_Id() {
return countyListId; return county_List_Id;
}
public void setCounty_List_Id(long county_List_Id) {
this.county_List_Id = county_List_Id;
}
@Basic
@Column(name = "TASK_ID", nullable = false, precision = 0)
public long getTask_Id() {
return task_Id;
} }
public void setCountyListId(long countyListId) { public void setTask_Id(long task_Id) {
this.countyListId = countyListId; this.task_Id = task_Id;
} }
@Basic @Basic
@Column(name = "SAVE_DATE", nullable = false) @Column(name = "SAVE_DATE", nullable = false)
public Time getSaveDate() { public Date getSave_Date() {
return saveDate; return save_Date;
} }
public void setSaveDate(Time saveDate) { public void setSave_Date(Date save_Date) {
this.saveDate = saveDate; this.save_Date = save_Date;
}
@Basic
@Column(name = "COUNTY_CODE", nullable = true, length = 20)
public String getCounty_Code() {
return county_Code;
} }
public void setCounty_Code(String county_Code) {
this.county_Code = county_Code;
}
@Basic @Basic
@Column(name = "FINISH_COUNT", nullable = true, precision = 0) @Column(name = "FINISH_COUNT", nullable = true, precision = 0)
public Long getFinishCount() { public long getFinish_Count() {
return finishCount; return finish_Count;
} }
public void setFinishCount(Long finishCount) { public void setFinish_Count(long finish_Count) {
this.finishCount = finishCount; this.finish_Count = finish_Count;
} }
@Basic @Basic
@Column(name = "IN_STORAGE_COUNT", nullable = true, precision = 0) @Column(name = "IN_STORAGE_COUNT", nullable = true, precision = 0)
public Long getInStorageCount() { public long getIn_Storage_Count() {
return inStorageCount; return in_Storage_Count;
} }
public void setInStorageCount(Long inStorageCount) { public void setIn_Storage_Count(long in_Storage_Count) {
this.inStorageCount = inStorageCount; this.in_Storage_Count = in_Storage_Count;
} }
@Basic @Basic
@Column(name = "OUT_STORAGE_COUNT", nullable = true, precision = 0) @Column(name = "OUT_STORAGE_COUNT", nullable = true, precision = 0)
public Long getOutStorageCount() { public long getOut_Storage_Count() {
return outStorageCount; return out_Storage_Count;
} }
public void setOutStorageCount(Long outStorageCount) { public void setOut_Storage_Count(long out_Storage_Count) {
this.outStorageCount = outStorageCount; this.out_Storage_Count = out_Storage_Count;
} }
@Override @Override
...@@ -71,15 +90,17 @@ public class CountyListEntity { ...@@ -71,15 +90,17 @@ public class CountyListEntity {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CountyListEntity that = (CountyListEntity) o; CountyListEntity that = (CountyListEntity) o;
return countyListId == that.countyListId && return county_List_Id == that.county_List_Id &&
Objects.equals(saveDate, that.saveDate) && task_Id == that.task_Id &&
Objects.equals(finishCount, that.finishCount) && finish_Count == that.finish_Count &&
Objects.equals(inStorageCount, that.inStorageCount) && in_Storage_Count == that.in_Storage_Count &&
Objects.equals(outStorageCount, that.outStorageCount); out_Storage_Count == that.out_Storage_Count &&
Objects.equals(save_Date, that.save_Date) &&
Objects.equals(county_Code, that.county_Code);
} }
@Override @Override
public int hashCode() { public int hashCode() {
return Objects.hash(countyListId, saveDate, finishCount, inStorageCount, outStorageCount); return Objects.hash(county_List_Id, task_Id, finish_Count, in_Storage_Count, out_Storage_Count,save_Date,county_Code);
} }
} }
package com.yxproject.start.entity;
import javax.persistence.*;
import java.util.Objects;
/**
* Created by liuxinben on 2018/11/6.10:14
*/
@Entity
@Table(name = "COUNTY_LIST_INFO", schema = "DAHAI")
public class CountyListInfoEntity {
private String county_List_Id;
private String save_Date;
private String cyclesheetid;
private String county_Code;
private Long finish_Count;
private Long in_Storage_Count;
private Long out_Bound_Count;
@Id
@Column(name = "COUNTY_LIST_ID", nullable = false, length = 20)
public String getCountyListId() {
return county_List_Id;
}
public void setCountyListId(String countyListId) {
this.county_List_Id = countyListId;
}
@Basic
@Column(name = "SAVE_DATE", nullable = true, length = 20)
public String getSaveDate() { return save_Date;}
public void setSaveDate(String saveDate) {
this.save_Date = saveDate;
}
@Basic
@Column(name = "CYCLESHEETID", nullable = true, length = 20)
public String getCyclesheetid() {
return cyclesheetid;
}
public void setCyclesheetid(String cyclesheetid) {
this.cyclesheetid = cyclesheetid;
}
@Basic
@Column(name = "COUNTY_CODE", nullable = true, length = 20)
public String getCountyCode() {
return county_Code;
}
public void setCountyCode(String county_Code) { this.county_Code = county_Code;}
@Basic
@Column(name = "FINISH_COUNT", nullable = true, precision = 0)
public Long getFinishCount() {
return finish_Count;
}
public void setFinishCount(Long finishCount) {
this.finish_Count = finishCount;
}
@Basic
@Column(name = "IN_STORAGE_COUNT", nullable = true, precision = 0)
public int getInStorageCount() {
return in_Storage_Count;
}
public void setInStorageCount(Long InStorageCount) {
this.in_Storage_Count = InStorageCount;
}
@Basic
@Column(name = "OUT_BOUND_COUNT", nullable = true, precision = 0)
public int getOutBoundCount() {
return out_Bound_Count;
}
public void setOutBoundCount(Long outBoundCount) {
this.out_Bound_Count = outBoundCount;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CountyListInfoEntity that = (CountyListInfoEntity) o;
return Objects.equals(county_List_Id, that.county_List_Id) &&
Objects.equals(save_Date, that.save_Date) &&
Objects.equals(cyclesheetid, that.cyclesheetid) &&
Objects.equals(county_Code, that.county_Code) &&
Objects.equals(finish_Count, that.finish_Count) &&
Objects.equals(in_Storage_Count, that.in_Storage_Count) &&
Objects.equals(out_Bound_Count, that.out_Bound_Count) ;
}
@Override
public int hashCode() {
return Objects.hash(county_List_Id, save_Date, cyclesheetid, county_Code, finish_Count, in_Storage_Count, out_Bound_Count);
}
}
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import com.yxproject.start.entity.CountyListInfoEntity; import com.yxproject.start.entity.CardBodyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* Created by liuxinben on 2018/11/6.10:26 * Created by liuxinben on 2018/11/6.10:26
*/ */
@Mapper @Mapper
public interface CountyListInfoMapper { public interface CardBodyMapper {
public List<CountyListInfoEntity> findCountyListByTaskListID(String tasklistID); public int insertCardBodyInfoEntity(CardBodyEntity cardBodyEntity);
public int updateOutBoundCount(CountyListInfoEntity countyListInfoEntity); public int updateCardBodyInfo(CardBodyEntity cardBodyEntity);
} }
\ No newline at end of file
package com.yxproject.start.mapper; package com.yxproject.start.mapper;
import com.yxproject.start.entity.CardBodyInfoEntity; import com.yxproject.start.entity.CountyListEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
...@@ -10,9 +10,9 @@ import java.util.List; ...@@ -10,9 +10,9 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface CardBodyInfoMapper { public interface CountyListMapper {
public int insertCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity); public List<CountyListEntity> findCountyListByTaskListID(String tasklistID);
public int updateCardBodyInfo(CardBodyInfoEntity cardBodyInfoEntity); public int updateOutBoundCount(CountyListEntity countyListInfoEntity);
} }
\ No newline at end of file
...@@ -15,14 +15,14 @@ public interface PoliceStationVailedMapper { ...@@ -15,14 +15,14 @@ public interface PoliceStationVailedMapper {
* @param policeStationVailedEntity * @param policeStationVailedEntity
* @return * @return
*/ */
@Insert("INSERT INTO POLICE_STATION_VAILED_INFO (POLICE_STATION_VAILED_INFO_ID,CYCLESHEETID,POLICE_STATION_CODE,VAILED_COUNT,INVALID_COUNT,SAVA_DATE) " + @Insert("INSERT INTO POLICE_STATION_VAILED (POLICE_STATION_VAILED_ID,TASK_ID,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})") "values (#{police_Station_Vailed_Id},#{task_Id},#{police_Station_Code},#{vailed_Count},#{invalid_Count},#{sava_Date})")
@Options(useGeneratedKeys = true, keyProperty = "police_Station_Vailed_Info_Id",keyColumn = "police_Station_Vailed_Info_Id") @Options(useGeneratedKeys = true, keyProperty = "police_Station_Vailed_Info_Id",keyColumn = "police_Station_Vailed_Info_Id")
public void savePoliceStationVailedInfoEntity(PoliceStationVailedEntity policeStationVailedEntity); public void savePoliceStationVailedInfoEntity(PoliceStationVailedEntity policeStationVailedEntity);
@Select("select * from POLICE_STATION_VAILED_INFO WHERE POLICE_STATION_VAILED_INFO_ID=#{id}") @Select("select * from POLICE_STATION_VAILED WHERE POLICE_STATION_VAILED_ID=#{id}")
@Results({@Result(property = "police_Station_Vailed_Info_Id",column = "police_Station_Vailed_Info_Id"), @Results({@Result(property = "police_Station_Vailed_Id",column = "police_Station_Vailed_Id"),
@Result(property = "cyclesheetid",column = "cyclesheetid"), @Result(property = "task_Id",column = "police_Station_Vailed_Id"),
@Result(property = "police_Station_Code",column = "police_Station_Code"), @Result(property = "police_Station_Code",column = "police_Station_Code"),
@Result(property = "vailed_Count",column = "vailed_Count"), @Result(property = "vailed_Count",column = "vailed_Count"),
@Result(property = "invalid_Count",column = "invalid_Count"), @Result(property = "invalid_Count",column = "invalid_Count"),
......
package com.yxproject.start.service; package com.yxproject.start.service;
import com.yxproject.start.entity.CardBodyInfoEntity; import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import java.util.List; import java.util.List;
...@@ -8,8 +8,8 @@ import java.util.List; ...@@ -8,8 +8,8 @@ import java.util.List;
/** /**
* Created by Administrator on 2018/11/7. * Created by Administrator on 2018/11/7.
*/ */
public interface CardBodyInfoService { public interface CardBodyService {
public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, List<GroupNoEntity> groupNoEntities); public int addCardBodyEntity(CardBodyEntity cardBodyInfoEntity, List<GroupNoEntity> groupNoEntities);
public int updateCardBodyInfo(CardBodyInfoEntity map); public int updateCardBody(CardBodyEntity map);
} }
package com.yxproject.start.service; package com.yxproject.start.service;
import com.yxproject.start.entity.CountyListInfoEntity; import com.yxproject.start.entity.CountyListEntity;
import java.util.List; import java.util.List;
/** /**
* Created by liuxinben on 2018/11/6.10:30 * Created by liuxinben on 2018/11/6.10:30
*/ */
public interface CountyListInfoService { public interface CountyListService {
public List<CountyListInfoEntity> findCountyListByTaskListID(String tasklistID); public List<CountyListEntity> findCountyListByTaskListID(String tasklistID);
public int reviseOutBoundCount(CountyListInfoEntity map); public int reviseOutBoundCount(CountyListEntity map);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CardBodyInfoEntity; import com.yxproject.start.entity.CardBodyEntity;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.mapper.CardBodyInfoMapper; import com.yxproject.start.mapper.CardBodyMapper;
import com.yxproject.start.mapper.GroupNoMapper; import com.yxproject.start.mapper.GroupNoMapper;
import com.yxproject.start.mapper.UtilMapper; import com.yxproject.start.mapper.UtilMapper;
import com.yxproject.start.service.CardBodyInfoService; import com.yxproject.start.service.CardBodyService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; 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.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -19,30 +18,29 @@ import java.util.List; ...@@ -19,30 +18,29 @@ import java.util.List;
*/ */
@Service @Service
public class CardBodyInfoServiceImpl implements CardBodyInfoService { public class CardBodyServiceImpl implements CardBodyService {
@Autowired @Autowired
public CardBodyInfoMapper cardBodyInfoMapper; public CardBodyMapper cardBodyMapper;
@Autowired @Autowired
private UtilMapper utilMapper; private UtilMapper utilMapper;
@Autowired @Autowired
public GroupNoMapper groupinfoMapper; public GroupNoMapper groupinfoMapper;
@Override @Override
public int updateCardBodyInfo(CardBodyInfoEntity cardBodyInfoEntity) { public int updateCardBody(CardBodyEntity cardBodyEntity) {
//todo 状态更新时间 //todo 状态更新时间
return cardBodyInfoMapper.updateCardBodyInfo(cardBodyInfoEntity); return cardBodyMapper.updateCardBodyInfo(cardBodyEntity);
} }
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor=Exception.class)
public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, List<GroupNoEntity> groupinfoEntities) { public int addCardBodyEntity(CardBodyEntity cardBodyEntity, List<GroupNoEntity> 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");
cardBodyInfoEntity.setCardBodyInfoId(simpleDateFormat.format(new Date()) + production_task_list_seq); cardBodyMapper.insertCardBodyInfoEntity(cardBodyEntity);
cardBodyInfoMapper.insertCardBodyInfoEntity(cardBodyInfoEntity);
return 1; return 1;
} }
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CountyListInfoEntity; import com.yxproject.start.entity.CountyListEntity;
import com.yxproject.start.mapper.CountyListInfoMapper; import com.yxproject.start.mapper.CountyListMapper;
import com.yxproject.start.service.CountyListInfoService; import com.yxproject.start.service.CountyListService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,19 +13,19 @@ import java.util.List; ...@@ -13,19 +13,19 @@ import java.util.List;
*/ */
@Service @Service
public class CountyListInfoServiceImpl implements CountyListInfoService { public class CountyListServiceImpl implements CountyListService {
@Autowired @Autowired
public CountyListInfoMapper countyListInfoMapper; public CountyListMapper countyListInfoMapper;
@Override @Override
public List<CountyListInfoEntity> findCountyListByTaskListID(String tasklistid) { public List<CountyListEntity> findCountyListByTaskListID(String tasklistid) {
List<CountyListInfoEntity> byTaskListID = countyListInfoMapper.findCountyListByTaskListID(tasklistid); List<CountyListEntity> byTaskListID = countyListInfoMapper.findCountyListByTaskListID(tasklistid);
return byTaskListID; return byTaskListID;
} }
@Override @Override
public int reviseOutBoundCount(CountyListInfoEntity countyListInfoEntity) { public int reviseOutBoundCount(CountyListEntity countyListInfoEntity) {
// int i = 0; // int i = 0;
// //
// //
......
...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,7 +9,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
......
...@@ -4,9 +4,6 @@ import com.yxproject.start.entity.*; ...@@ -4,9 +4,6 @@ import com.yxproject.start.entity.*;
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;
import com.yxproject.start.mapper.*; import com.yxproject.start.mapper.*;
import com.yxproject.start.entity.CountyListInfoEntity;
import net.sf.json.JSONObject;
import java.util.Scanner;
import com.yxproject.start.service.TaskService; import com.yxproject.start.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -436,7 +433,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -436,7 +433,7 @@ public class TaskServiceImpl implements TaskService {
return i; return i;
} }
private CountyListInfoEntity countyListInfoEntity; private CountyListEntity countyListInfoEntity;
private GroupNoEntity groupNoEntity; private GroupNoEntity groupNoEntity;
/** /**
* 更新出库时间 * 更新出库时间
...@@ -445,13 +442,10 @@ public class TaskServiceImpl implements TaskService { ...@@ -445,13 +442,10 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Override @Override
public int updateOutboundDate(TaskEntity taskEntity) { public int updateOutboundDate(TaskEntity taskEntity) {
int i=0; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
i= taskMapper.totalnum(i); if(groupNoEntity.totalinvalidCount.equals(countyListInfoEntity.getOut_Storage_Count())) {
if (countyListInfoEntity.getOutBoundCount()==i){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
taskEntity.setOut_Storage_Date(new Date()); taskEntity.setOut_Storage_Date(new Date());
return taskMapper.updateTaskEntity(taskEntity); return taskMapper.updateTaskEntity(taskEntity);
} }
else{ else{
return 0; return 0;
...@@ -465,10 +459,8 @@ public class TaskServiceImpl implements TaskService { ...@@ -465,10 +459,8 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Override @Override
public int updatePutinstorageDate(TaskEntity taskEntity) { public int updatePutinstorageDate(TaskEntity taskEntity) {
int i=0; SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
i= taskMapper.totalnum(i); if(groupNoEntity.totalinvalidCount.equals(countyListInfoEntity.getIn_Storage_Count())) {
if (countyListInfoEntity.getInStorageCount()==i){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
taskEntity.setIn_Storage_Date(new Date()); taskEntity.setIn_Storage_Date(new Date());
return taskMapper.updateTaskEntity(taskEntity); return taskMapper.updateTaskEntity(taskEntity);
} }
......
<?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.CardBodyInfoMapper">
<resultMap id="CardBodyInfoMapper" type="com.yxproject.start.entity.CardBodyInfoEntity">
<id column="card_Body_Info_Id" property="card_Body_Info_Id" />
<result column="card_Body_Info_Save_Date" property="card_Body_Info_Save_Date"/>
<result column="is_Active" property="is_Active"/>
<result column="card_Body_Count" property="card_Body_Count"/>
<result column="card_Body_Type" property="card_Body_Type"/>
<result column="cyclesheetid" property="cyclesheetid"/>
</resultMap>
<insert id="insertCardBodyInfoEntity" parameterType="com.yxproject.start.entity.CardBodyInfoEntity">
Insert into CARD_BODY_INFO (CARD_BODY_INFO_ID,CARD_BODY_INFO_SAVE_DATE,CARD_BODY_COUNT,CARD_BODY_TYPE,CYCLESHEETID,IS_ACTIVE)
values (#{card_Body_Info_Id},#{card_Body_Info_Save_Date},#{is_Active},#{card_Body_Count},#{card_Body_Type},#{cyclesheetid})
</insert>
<update id="updateCardBodyInfo" parameterType="com.yxproject.start.entity.CardBodyInfoEntity">
update CARD_BODY_INFO
<set>
<if test="card_Body_Info_Save_Date ">CARD_BODY_INFO_SAVE_DATE =#{card_Body_Info_Save_Date},</if>
<if test="is_Active ">IS_ACTIVE =#{is_Active},</if>
<if test="card_Body_Count ">CARD_BODY_COUNT =#{card_Body_Count},</if>
<if test="card_Body_Type">CARD_BODY_TYPE =#{card_Body_Type},</if>
<if test="cyclesheetid ">CYCLESHEETID =#{cyclesheetid},</if>
<if test="state!=null">STATE =#{state},</if>
<if test="putinstorage_Date!=null">PUTINSTORAGE_DATE =#{putinstorage_Date},</if>
</set>
where CARD_BODY_INFO_ID =#{card_Body_Info_Id}
</update>
</mapper>
\ No newline at end of file
<?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.CardBodyInfoMapper">
<resultMap id="CardBodyInfoMapper" type="com.yxproject.start.entity.CardBodyEntity">
<id column="CARD_BODY_ID" property="card_Body_Id" jdbcType="NUMERIC"/>
<result column="SAVE_DATE" property="save_Date" jdbcType="DATE"/>
<result column="CARD_TYPE_ID" property="card_Type_Id" jdbcType="NUMERIC"/>
<result column="IS_ACTIVE" property="is_Active" jdbcType="NUMERIC"/>
<result column="TASK_ID" property="task_Id" jdbcType="NUMERIC"/>
<result column="TOTAL_COUNT" property="total_Count" jdbcType="NUMERIC"/>
</resultMap>
<insert id="insertCardBodyEntity" parameterType="com.yxproject.start.entity.CardBodyEntity">
Insert into CARD_BODY (CARD_BODY_ID,SAVE_DATE,CARD_TYPE_ID,IS_ACTIVE,TASK_ID,TOTAL_COUNT)
values (#{card_Body_Id},#{save_Date},#{card_Type_Id},#{is_Active},#{task_Id},#{total_Count})
</insert>
<update id="updateCardBody" parameterType="com.yxproject.start.entity.CardBodyEntity">
update CARD_BODY
<set>
<if test="save_Date ">SAVE_DATE =#{save_Date},</if>
<if test="card_Type_Id ">CARD_TYPE_ID =#{card_Type_Id},</if>
<if test="is_Active ">is_Active =#{is_Active},</if>
<if test="card_Body_Type">CARD_BODY_TYPE =#{card_Body_Type},</if>
<if test="task_Id ">TASK_ID =#{task_Id},</if>
<if test="total_Count">TOTAL_COUNT =#{total_Count},</if>
</set>
where CARD_BODY_ID =#{card_Body_Id}
</update>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?> <?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" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.yxproject.start.mapper.CountyListInfoMapper"> <mapper namespace="com.yxproject.start.mapper.CountyListMapper">
<resultMap id="CountyListInfoMapper" type="com.yxproject.start.entity.CountyListInfoEntity"> <resultMap id="CountyListMapper" type="com.yxproject.start.entity.CountyListEntity">
<id column="county_List_Id" property="county_List_Id" /> <id column="COUNTY_LIST_ID" property="county_List_Id" jdbcType="NUMERIC" />
<result column="save_Date" property="save_Date"/> <result column="TASK_ID" property="task_Id" jdbcType="NUMERIC"/>
<result column="cyclesheetid" property="cyclesheetid"/> <result column="SAVE_DATE" property="save_Date" jdbcType="DATE"/>
<result column="county_Code" property="county_Code"/> <result column="COUNTY_CODE" property="county_Code" jdbcType="VARCHAR"/>
<result column="finish_Count" property="finish_Count"/> <result column="FINISH_COUNT" property="finish_Count" jdbcType="NUMERIC"/>
<result column="in_Storage_Count" property="in_Storage_Count"/> <result column="IN_STORAGE_COUNT" property="in_Storage_Count" jdbcType="NUMERIC"/>
<result column="out_Bound_Count" property="out_Bound_Count"/> <result column="OUT_STORAGE_COUNT" property="out_Storage_Count" jdbcType="NUMERIC"/>
</resultMap> </resultMap>
<!--<insert id="addPermissionByMap" parameterType="com.yxproject.start.entity.SysPermission">--> <!--<insert id="addPermissionByMap" parameterType="com.yxproject.start.entity.SysPermission">-->
<!--Insert into DAHAI.SYS_PERMISSION (ID,AVAILABLE,NAME,PARENT_ID,PARENT_IDS,PERMISSION,RESOURCE_TYPE,URL) values (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})--> <!--Insert into DAHAI.SYS_PERMISSION (ID,AVAILABLE,NAME,PARENT_ID,PARENT_IDS,PERMISSION,RESOURCE_TYPE,URL) values (PERMISSION_seq.nextval,0,#{name},#{parentId},#{parentIds},#{permission},#{resourceType},#{url})-->
<!--</insert>--> <!--</insert>-->
<select id="findCountyListByTaskListID" resultType="com.yxproject.start.entity.CountyListInfoEntity" parameterType="String"> <select id="findCountyListByTaskListID" resultType="com.yxproject.start.entity.CountyListEntity" parameterType="String">
SELECT * FROM COUNTY_LIST_INFO where CYCLESHEETID=#{tasklistID} SELECT * FROM COUNTY_LIST where task_Id=#{task_Id}
</select> </select>
<update id="updateOutBoundCount" parameterType="com.yxproject.start.entity.CountyListInfoEntity" > <update id="updateOutBoundCount" parameterType="com.yxproject.start.entity.CountyListEntity" >
update COUNTY_LIST_INFO OUT_BOUND_COUNT =#{out_Bound_Count} where COUNTY_LIST_ID =#{county_List_Id} update COUNTY_LIST OUT_STORAGE_COUNT =#{out_Storage_Count} where COUNTY_LIST_ID =#{county_List_Id}
</update> </update>
......
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