修改单据insert和update的代码,解决大数据量无法写入的bug,另外增加消息提醒的定时刷新

This commit is contained in:
季圣华
2020-03-28 19:04:04 +08:00
parent 89d2e29779
commit e45e3b119e
8 changed files with 186 additions and 53 deletions

View File

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.DepotHeadVo4Body;
import com.jsh.erp.datasource.vo.DepotHeadVo4InDetail;
import com.jsh.erp.datasource.vo.DepotHeadVo4InOutMCount;
import com.jsh.erp.datasource.vo.DepotHeadVo4List;
@@ -382,21 +383,19 @@ public class DepotHeadController {
}
/**
* create by: cjl
* description:
* 新增单据主表及单据子表信息
* create time: 2019/1/25 14:36
* @Param: beanJson
 * @Param: inserted
 * @Param: deleted
 * @Param: updated
* @return java.lang.String
* 新增单据主表及单据子表信息
* @param body
* @param request
* @return
* @throws Exception
*/
@RequestMapping(value = "/addDepotHeadAndDetail")
public Object addDepotHeadAndDetail(@RequestParam("info") String beanJson,@RequestParam("inserted") String inserted,
@RequestParam("deleted") String deleted,
@RequestParam("updated") String updated, HttpServletRequest request) throws Exception{
@PostMapping(value = "/addDepotHeadAndDetail")
public Object addDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
String inserted = body.getInserted();
String deleted = body.getDeleted();
String updated = body.getUpdated();
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null);
@@ -408,58 +407,49 @@ public class DepotHeadController {
}
return result;
}
/**
* create by: cjl
* description:
* 更新单据主表及单据子表信息
* create time: 2019/1/28 14:47
* @Param: id
 * @Param: beanJson
 * @Param: inserted
 * @Param: deleted
 * @Param: updated
 * @Param: preTotalPrice
* @return java.lang.Object
* @param body
* @param request
* @return
* @throws Exception
*/
@RequestMapping(value = "/updateDepotHeadAndDetail")
public Object updateDepotHeadAndDetail(@RequestParam("id") Long id,
@RequestParam("info") String beanJson,
@RequestParam("inserted") String inserted,
@RequestParam("deleted") String deleted,
@RequestParam("updated") String updated,
@RequestParam("preTotalPrice") BigDecimal preTotalPrice,
HttpServletRequest request) throws Exception{
@PostMapping(value = "/updateDepotHeadAndDetail")
public Object updateDepotHeadAndDetail(@RequestBody DepotHeadVo4Body body, HttpServletRequest request) throws Exception{
Long tenantId = Long.parseLong(request.getSession().getAttribute("tenantId").toString());
JSONObject result = ExceptionConstants.standardSuccess();
Long id = body.getId();
String beanJson = body.getInfo();
String inserted = body.getInserted();
String deleted = body.getDeleted();
String updated = body.getUpdated();
BigDecimal preTotalPrice = body.getPreTotalPrice();
depotHeadService.updateDepotHeadAndDetail(id,beanJson,inserted,deleted,updated,preTotalPrice,tenantId,request);
return result;
}
/**
* create by: cjl
* description:
* 删除单据主表及子表信息
* create time: 2019/1/28 17:29
* @Param: id
* @return java.lang.Object
*/
@RequestMapping(value = "/deleteDepotHeadAndDetail")
public Object deleteDepotHeadAndDetail(@RequestParam("id") Long id) throws Exception{
/**
* 删除单据主表及子表信息
* @param id
* @return
* @throws Exception
*/
@PostMapping(value = "/deleteDepotHeadAndDetail")
public Object deleteDepotHeadAndDetail(@RequestParam("id") Long id) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
depotHeadService.deleteDepotHeadAndDetail(id);
return result;
}
/**
* create by: cjl
* description:
* 删除单据主表及子表信息
* create time: 2019/1/28 17:29
* @Param: id
* @return java.lang.Object
*/
@RequestMapping(value = "/batchDeleteDepotHeadAndDetail")
public Object batchDeleteDepotHeadAndDetail(@RequestParam("ids") String ids) throws Exception{
/**
* 批量删除单据主表及子表信息
* @param ids
* @return
* @throws Exception
*/
@PostMapping(value = "/batchDeleteDepotHeadAndDetail")
public Object batchDeleteDepotHeadAndDetail(@RequestParam("ids") String ids) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
depotHeadService.batchDeleteDepotHeadAndDetail(ids);
return result;

View File

@@ -9,7 +9,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author ji sheng hua 华夏ERP
@@ -54,4 +56,22 @@ public class MsgController {
}
return res;
}
@GetMapping("/getMsgCountByStatus")
public BaseResponseInfo getMsgCountByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Long> map = new HashMap<String, Long>();
Long count = msgService.getMsgCountByStatus(status);
map.put("count", count);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}