完善租户功能,默认开启

This commit is contained in:
季圣华
2019-08-15 22:53:27 +08:00
parent 630394c7ed
commit 10e392a00b
7 changed files with 51 additions and 129 deletions

View File

@@ -39,9 +39,6 @@ import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
public class DepotHeadController {
private Logger logger = LoggerFactory.getLogger(DepotHeadController.class);
@Value("${mybatis-plus.status}")
private String mybatisPlusStatus;
@Resource
private DepotHeadService depotHeadService;
@@ -398,15 +395,11 @@ public class DepotHeadController {
@RequestParam("deleted") String deleted,
@RequestParam("updated") String updated, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
if(("open").equals(mybatisPlusStatus)) {
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null);
if(count>= billsNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
} else {
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
}
Long billsNumLimit = Long.parseLong(request.getSession().getAttribute("billsNumLimit").toString());
Long count = depotHeadService.countDepotHead(null,null,null,null,null,null,null);
if(count>= billsNumLimit) {
throw new BusinessParamCheckingException(ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_CODE,
ExceptionConstants.DEPOT_HEAD_OVER_LIMIT_FAILED_MSG);
} else {
depotHeadService.addDepotHeadAndDetail(beanJson,inserted,deleted,updated);
}