Commit 52c3ee46 authored by Administrator's avatar Administrator

下载装箱单并连接盈信库

更新异常状态并更新异常信息
更新出库时间和入库时间
parent 6bef8517
package com.yxproject.start.api;
import com.yxproject.start.service.*;
import com.yxproject.start.entity.CardBodyInfoEntity;
import com.yxproject.start.entity.CountyListInfoEntity;
import com.yxproject.start.entity.GroupinfoEntity;
import com.yxproject.start.entity.ProductionTaskListEntity;
import com.yxproject.start.service.CardBodyInfoService;
import com.yxproject.start.service.CountyListInfoService;
import com.yxproject.start.utils.YXJSONResponse;
import net.sf.json.JSONObject;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Administrator on 2018/11/7.
*/
@Path("admin")
public class TestApi {
@Autowired
private CardBodyInfoService cardBodyInfoService;
@Autowired
private CountyListInfoService countyListInfoService;
@Autowired
private GroupinfoService groupinfoService;
@Autowired
private ProductionTaskListService productionTaskListService;
/**
* 通过任务单查询区县列表;
*
* @return
*/
@GET
@Path("getCountyList")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String getCountyListInfoByTaskListID(@QueryParam("taskListID") String tasklistid, @Context HttpServletResponse resp) {
List<CountyListInfoEntity> countyListInfoEntity = countyListInfoService.findCountyListByTaskListID(tasklistid);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countyListInfoEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
}
/**
* 保存卡机表;
*
* @return
*/
@GET
@Path("addCardBody")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String addCardBodyInfo(@QueryParam("CardBody") String cardBodyInfoId, @Context HttpServletResponse resp) {
String map = "{\"CardBodyId\":\"1}";
JSONObject jsonObject = JSONObject.fromObject(map);
Object cardBodyInfo = jsonObject.get("CardBody");
Object groupInfoList = jsonObject.get("groupInfoList");
List<GroupinfoEntity> groupinfoEntities = (List<GroupinfoEntity>) groupInfoList;
CardBodyInfoEntity cardBodyInfoEntity = (CardBodyInfoEntity) cardBodyInfo;
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = cardBodyInfoService.addCardBodyInfoEntity(cardBodyInfoEntity, groupinfoEntities);
yxjsonResponse.outPutSuccess(i + "添加成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新循环单
* 添加异常状态;
* @return
*/
@GET
@Path("addExceptionState")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String addExceptionState(@RequestParam("exception_information") String exception_information, @Context HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,exception_State:0} ";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity) jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.addExceptionState(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新入库时间
*
* @return
*/
@GET
@Path("updatePutinstorageDate")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String updatePutinstorageDate(@RequestParam("id") String id, @Context HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity) jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新出库时间
*
* @return
*/
@GET
@Path("updateOutboundDate")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String updateOutboundDate(@RequestParam("id") String id, @Context HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity) jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 对出库数进行更改
* 更新出库数
* @return
*/
@GET
@Path("reviseOutBoundCount")
@Produces(MediaType.APPLICATION_JSON)
@RequiresPermissions("userInfo.add")//权限管理;
public String reviseOutBoundCount(@RequestParam("id") String id, @Context HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
ProductionTaskListEntity productionTaskListEntity = (ProductionTaskListEntity) jsonObject.toBean(jsonObject, ProductionTaskListEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = productionTaskListService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
}
...@@ -40,6 +40,10 @@ public class UserApi { ...@@ -40,6 +40,10 @@ public class UserApi {
@Autowired @Autowired
private FailedCardService failedCardService; private FailedCardService failedCardService;
@Autowired
private CountyListInfoService countyListInfoService;
@Autowired
private CardBodyInfoService cardBodyInfoService;
@PostMapping("login") @PostMapping("login")
public Map<String, Object> submitLogin(@RequestBody String jsonStr) { public Map<String, Object> submitLogin(@RequestBody String jsonStr) {
...@@ -337,6 +341,119 @@ public class UserApi { ...@@ -337,6 +341,119 @@ public class UserApi {
return null; return null;
} }
/**
* 通过任务单查询区县列表;
*
* @return
*/
@RequestMapping("getCountyList")
// @RequiresPermissions("userInfo.add")//权限管理;
public String getCountyListInfoByTaskListID(@RequestParam("taskListID") String tasklistid, HttpServletResponse resp) {
List<CountyListInfoEntity> countyListInfoEntity = countyListInfoService.findCountyListByTaskListID(tasklistid);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
yxjsonResponse.outPutSuccess(countyListInfoEntity);
Map map = new HashMap();
// map.put("MakeType",productionTaskListEntity);
return yxjsonResponse.toJSONString();
}
/**
* 保存卡机表;
*
* @return
*/
@RequestMapping("addCardBody")
// @RequiresPermissions("userInfo.add")//权限管理;
public String addCardBodyInfo(@RequestParam("CardBody") String cardBodyInfoId, HttpServletResponse resp) {
String map = "{\"CardBodyId\":\"1}";
JSONObject jsonObject = JSONObject.fromObject(map);
Object cardBodyInfo = jsonObject.get("CardBody");
Object groupInfoList = jsonObject.get("groupInfoList");
List<GroupNoEntity> groupNoEntities = (List<GroupNoEntity>) groupInfoList;
CardBodyInfoEntity cardBodyInfoEntity = (CardBodyInfoEntity) cardBodyInfo;
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = cardBodyInfoService.addCardBodyInfoEntity(cardBodyInfoEntity, groupNoEntities);
yxjsonResponse.outPutSuccess(i + "添加成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新循环单
* 添加异常状态;
* @return
*/
@RequestMapping("addExceptionState")
// @RequiresPermissions("userInfo.add")//权限管理;
public String addExceptionState(@RequestParam("exception_information") String exception_information, HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,exception_State:0} ";
JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = taskService.addExceptionState(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新入库时间
*
* @return
*/
@RequestMapping("updatePutinstorageDate")
@RequiresPermissions("userInfo.add")//权限管理;
public String updatePutinstorageDate(@RequestParam("id") String id, HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = taskService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 更新出库时间
*
* @return
*/
@RequestMapping("updateOutboundDate")
// @RequiresPermissions("userInfo.add")//权限管理;
public String updateOutboundDate(@RequestParam("id") String id, HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = taskService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/**
* 对出库数进行更改
* 更新出库数
* @return
*/
@RequestMapping("reviseOutBoundCount")
@RequiresPermissions("userInfo.add")//权限管理;
public String reviseOutBoundCount(@RequestParam("id") String id, HttpServletResponse resp) {
String map = "{\"production_Task_List_Id\":\"20181016001\",\"make_Type\":8,\"old_Make_Type\":8,} ";
JSONObject jsonObject = JSONObject.fromObject(map);
TaskEntity productionTaskListEntity = (TaskEntity) jsonObject.toBean(jsonObject, TaskEntity.class);
YXJSONResponse yxjsonResponse = new YXJSONResponse();
resp.setCharacterEncoding("UTF-8");
int i = taskService.updateProductionTask(productionTaskListEntity);
yxjsonResponse.outPutSuccess(i + "更新成功");
return yxjsonResponse.toJSONString();
}
/** /**
* 下载装箱单 * 下载装箱单
* *
......
...@@ -7,7 +7,7 @@ import java.util.Objects; ...@@ -7,7 +7,7 @@ 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 = "GROUP_NO", schema = "DAHAI", catalog = "") @Table(name = "GROUP_NO", schema = "DAHAI")
public class GroupNoEntity { public class GroupNoEntity {
private long group_Id; private long group_Id;
private long task_Id; private long task_Id;
...@@ -15,6 +15,7 @@ public class GroupNoEntity { ...@@ -15,6 +15,7 @@ public class GroupNoEntity {
private long vaild_Count; private long vaild_Count;
private long invalid_Count; private long invalid_Count;
private long special_Card_Count; private long special_Card_Count;
public Long totalinvalidCount;
@Basic @Basic
@Column(name = "GROUP_ID", nullable = false, precision = 0) @Column(name = "GROUP_ID", nullable = false, precision = 0)
......
...@@ -17,5 +17,7 @@ public interface TaskMapper { ...@@ -17,5 +17,7 @@ public interface TaskMapper {
public int updateTaskEntity(TaskEntity taskEntity); public int updateTaskEntity(TaskEntity taskEntity);
public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo); public List<TaskEntity> findTaskEntityByAcceptNo(String acceptNo);
public List<TaskEntity> findTaskEntityByState(int state); public List<TaskEntity> findTaskEntityByState(int state);
public int addExceptionState(TaskEntity taskEntity);
public int replaceExceptionInformation(TaskEntity taskEntity);
} }
package com.yxproject.start.service; package com.yxproject.start.service;
import com.yxproject.start.entity.CardBodyInfoEntity; import com.yxproject.start.entity.CardBodyInfoEntity;
import com.yxproject.start.entity.GroupinfoEntity; import com.yxproject.start.entity.GroupNoEntity;
import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -10,7 +9,7 @@ import java.util.List; ...@@ -10,7 +9,7 @@ import java.util.List;
* Created by Administrator on 2018/11/7. * Created by Administrator on 2018/11/7.
*/ */
public interface CardBodyInfoService { public interface CardBodyInfoService {
public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, List<GroupinfoEntity> groupinfoEntities); public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, List<GroupNoEntity> groupNoEntities);
public int updateCardBodyInfo(CardBodyInfoEntity map); public int updateCardBodyInfo(CardBodyInfoEntity map);
} }
...@@ -26,5 +26,11 @@ public interface TaskService { ...@@ -26,5 +26,11 @@ public interface TaskService {
public List<Map<String,Object>> findProductionTaskListEntityByState(int state); public List<Map<String,Object>> findProductionTaskListEntityByState(int state);
public int addExceptionState(TaskEntity state);
public int updateOutboundDate(TaskEntity map);
public int updatePutinstorageDate(TaskEntity map);
} }
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.yxproject.start.entity.CardBodyInfoEntity; import com.yxproject.start.entity.CardBodyInfoEntity;
import com.yxproject.start.entity.GroupinfoEntity; import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.mapper.CardBodyInfoMapper; import com.yxproject.start.mapper.CardBodyInfoMapper;
import com.yxproject.start.mapper.GroupinfoMapper; 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.CardBodyInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -13,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -13,7 +13,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Created by Administrator on 2018/11/7. * Created by Administrator on 2018/11/7.
...@@ -26,7 +25,7 @@ public class CardBodyInfoServiceImpl implements CardBodyInfoService { ...@@ -26,7 +25,7 @@ public class CardBodyInfoServiceImpl implements CardBodyInfoService {
@Autowired @Autowired
private UtilMapper utilMapper; private UtilMapper utilMapper;
@Autowired @Autowired
public GroupinfoMapper groupinfoMapper; public GroupNoMapper groupinfoMapper;
@Override @Override
public int updateCardBodyInfo(CardBodyInfoEntity cardBodyInfoEntity) { public int updateCardBodyInfo(CardBodyInfoEntity cardBodyInfoEntity) {
...@@ -38,18 +37,12 @@ public class CardBodyInfoServiceImpl implements CardBodyInfoService { ...@@ -38,18 +37,12 @@ public class CardBodyInfoServiceImpl implements CardBodyInfoService {
@Override @Override
@Transactional(rollbackFor=Exception.class) @Transactional(rollbackFor=Exception.class)
public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, List<GroupinfoEntity> groupinfoEntities) { public int addCardBodyInfoEntity(CardBodyInfoEntity cardBodyInfoEntity, 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); cardBodyInfoEntity.setCardBodyInfoId(simpleDateFormat.format(new Date()) + production_task_list_seq);
cardBodyInfoMapper.insertCardBodyInfoEntity(cardBodyInfoEntity); cardBodyInfoMapper.insertCardBodyInfoEntity(cardBodyInfoEntity);
for (GroupinfoEntity groupinfoEntity : groupinfoEntities) {
int groupInfoSequenceValue = utilMapper.findGroupInfoSequenceNextValue();
groupinfoEntity.setGroupid(simpleDateFormat.format(new Date()) + groupInfoSequenceValue);
groupinfoEntity.setCyclesheetid(simpleDateFormat.format(new Date()) + production_task_list_seq);
groupinfoMapper.insertGroupinfoEntity(groupinfoEntity);
}
return 1; return 1;
} }
......
...@@ -437,18 +437,18 @@ public class TaskServiceImpl implements TaskService { ...@@ -437,18 +437,18 @@ public class TaskServiceImpl implements TaskService {
} }
private CountyListInfoEntity countyListInfoEntity; private CountyListInfoEntity countyListInfoEntity;
private GroupNoEntity groupinfoEntity; private GroupNoEntity groupNoEntity;
/** /**
* 更新出库时间 * 更新出库时间
* @param * @param
* @return * @return
*/ */
@Override @Override
public int updateOutboundDate(TaskEntity productionTaskListEntity) { public int updateOutboundDate(TaskEntity taskEntity) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
if(groupinfoEntity.totalinvalidCount.equals(countyListInfoEntity.getOutBoundCount())) { if(groupNoEntity.totalinvalidCount.equals(countyListInfoEntity.getOutBoundCount())) {
productionTaskListEntity.setOutbound_Date(simpleDateFormat.format(new Date())); taskEntity.setOut_Storage_Date(new Date());
return taskMapper.updateProductionTask(productionTaskListEntity); return taskMapper.updateTaskEntity(taskEntity);
} }
else{ else{
return 0; return 0;
...@@ -461,11 +461,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -461,11 +461,11 @@ public class TaskServiceImpl implements TaskService {
* @return * @return
*/ */
@Override @Override
public int updatePutinstorageDate(TaskEntity productionTaskListEntity) { public int updatePutinstorageDate(TaskEntity taskEntity) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss"); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddhhmmss");
if(groupinfoEntity.totalinvalidCount.equals(countyListInfoEntity.getInStorageCount())) { if(groupNoEntity.totalinvalidCount.equals(countyListInfoEntity.getInStorageCount())) {
productionTaskListEntity.setPutinstorage_Date(simpleDateFormat.format(new Date())); taskEntity.setIn_Storage_Date(new Date());
return productionTaskListMapper.updateProductionTask(productionTaskListEntity); return taskMapper.updateTaskEntity(taskEntity);
} }
else{ else{
return 0; return 0;
......
...@@ -68,4 +68,8 @@ ...@@ -68,4 +68,8 @@
select * from TASK where TASK_STATE_ID =#{state } select * from TASK where TASK_STATE_ID =#{state }
</select> </select>
<update id="replaceExceptionInformation" parameterType="com.yxproject.start.entity.TaskEntity" >
update TASK SET exception_Information = NULL,EXCEPTION_STATE =#{exception_State} where TASK_ID =#{task_Id}
</update>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment