权限管理修改,接口优化
This commit is contained in:
@@ -3,11 +3,13 @@ package com.zf.foodpurchase.fdsafe.web.admin;
|
||||
|
||||
import com.zf.foodpurchase.common.core.controller.BaseController;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.IFoodSpecService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodSpecVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,6 +29,8 @@ import java.util.List;
|
||||
public class FoodSpecController extends BaseController {
|
||||
@Autowired
|
||||
private IFoodSpecService foodSpecService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 查询用
|
||||
@@ -34,36 +38,47 @@ public class FoodSpecController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(){
|
||||
// 填充学校id,教育局id等数据
|
||||
SysUser user = sysUserService.getUser();
|
||||
FoodSpecVO foodSpecVO = new FoodSpecVO();
|
||||
foodSpecVO.setStatus(0);
|
||||
if(!user.isAdmin()){
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
foodSpecVO.setDeptIds(deptIds);
|
||||
}
|
||||
foodSpecVO.setDelFlag(0);
|
||||
List list = foodSpecService.queryFoodSpecVO(foodSpecVO);
|
||||
List<FoodSpecVO> list = foodSpecService.queryFoodSpecVO(foodSpecVO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(FoodSpecVO foodSpecVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
foodSpecVO.setDeptIds(deptIds);
|
||||
}
|
||||
foodSpecVO.setDelFlag(0);
|
||||
List<FoodSpecVO> list = foodSpecService.queryFoodSpecVO(foodSpecVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodSpecVO foodSpecVO){
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodSpecVO foodSpecVO) {
|
||||
return foodSpecService.saveVO(foodSpecVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodSpecVO foodSpecVO){
|
||||
return foodSpecService.updateVO(foodSpecVO);
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodSpecVO foodSpecVO) {
|
||||
return foodSpecService.updateVO(foodSpecVO);
|
||||
}
|
||||
|
||||
@GetMapping("/delete")
|
||||
public AjaxResult delete(Integer specId){
|
||||
if(specId == null){
|
||||
return error("未指定要删除的食材规格/单位");
|
||||
public AjaxResult delete(Integer foodId) {
|
||||
if(foodId == null){
|
||||
return error("未指定要删除的食材");
|
||||
}
|
||||
boolean flag = foodSpecService.removeById(specId);
|
||||
boolean flag = foodSpecService.removeById(foodId);
|
||||
return flag ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.IEduService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.EduVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -26,11 +27,18 @@ import java.util.List;
|
||||
public class EduController extends BaseController {
|
||||
@Autowired
|
||||
private IEduService eduService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(EduVO eduVO){
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(eduVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
eduVO.setSchoolId(user.getSchoolId());
|
||||
eduVO.setEduId(user.getEduId());
|
||||
eduVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<EduVO> list = eduService.queryEduList(eduVO);
|
||||
return AjaxResult.success("查询成功",list);
|
||||
}
|
||||
@@ -39,14 +47,19 @@ public class EduController extends BaseController {
|
||||
public TableDataInfo pageList(EduVO eduVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(eduVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
eduVO.setSchoolId(user.getSchoolId());
|
||||
eduVO.setEduId(user.getEduId());
|
||||
eduVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<EduVO> list = eduService.queryEduList(eduVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) EduVO eduVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法添加教育局");
|
||||
}
|
||||
@@ -63,7 +76,7 @@ public class EduController extends BaseController {
|
||||
if(eduId == null){
|
||||
return error("未指定要删除的教育局");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法删除教育局");
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.IFoodService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,22 +31,44 @@ public class FoodController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IFoodService foodService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(FoodVO foodVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(foodVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
foodVO.setSchoolId(user.getSchoolId());
|
||||
foodVO.setEduId(user.getEduId());
|
||||
foodVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
foodVO.setDelFlag(0);
|
||||
List<FoodVO> list = foodService.queryFoodVO(foodVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/listAll")
|
||||
public AjaxResult listAll() {
|
||||
// 填充学校id,教育局id等数据
|
||||
SysUser user = sysUserService.getUser();
|
||||
FoodVO foodVO = new FoodVO();
|
||||
if(!user.isAdmin()){
|
||||
foodVO.setSchoolId(user.getSchoolId());
|
||||
foodVO.setEduId(user.getEduId());
|
||||
foodVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
foodVO.setDelFlag(0);
|
||||
List<FoodVO> list = foodService.queryFoodVO(foodVO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodVO foodVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法添加食材");
|
||||
}
|
||||
@@ -55,9 +78,9 @@ public class FoodController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodVO foodVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法修改食材细信息");
|
||||
}
|
||||
@@ -70,9 +93,9 @@ public class FoodController extends BaseController {
|
||||
if(foodId == null){
|
||||
return error("未指定要删除的食材");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法删除食材");
|
||||
}
|
||||
|
||||
@@ -3,12 +3,14 @@ package com.zf.foodpurchase.fdsafe.web.edu;
|
||||
|
||||
import com.zf.foodpurchase.common.core.controller.BaseController;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.entity.MorningInspectionContent;
|
||||
import com.zf.foodpurchase.fdsafe.service.IMorningInspectionContentService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.MorningInspectionContentVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -29,12 +31,19 @@ public class MorningInspectionContentController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IMorningInspectionContentService morningInspectionContentService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(MorningInspectionContentVO morningInspectionContentVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(morningInspectionContentVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
morningInspectionContentVO.setSchoolId(user.getSchoolId());
|
||||
morningInspectionContentVO.setEduId(user.getEduId());
|
||||
morningInspectionContentVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<MorningInspectionContentVO> list = morningInspectionContentService.queryMorningInspectionContentVO(morningInspectionContentVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.zf.foodpurchase.fdsafe.web.edu;
|
||||
|
||||
import com.zf.foodpurchase.common.core.controller.BaseController;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISelfInspectionContentService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SelfInspectionContentVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,12 +29,19 @@ import java.util.List;
|
||||
public class SelfInspectionContentController extends BaseController {
|
||||
@Autowired
|
||||
private ISelfInspectionContentService selfInspectionContentService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SelfInspectionContentVO selfInspectionContentVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(selfInspectionContentVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
selfInspectionContentVO.setSchoolId(user.getSchoolId());
|
||||
selfInspectionContentVO.setEduId(user.getEduId());
|
||||
selfInspectionContentVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SelfInspectionContentVO> list = selfInspectionContentService.querySelfInspectionContentVO(selfInspectionContentVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.zf.foodpurchase.fdsafe.service.ISupplierService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -31,12 +32,18 @@ public class SupplierController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISupplierService supplierService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SupplierVO supplierVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(supplierVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
supplierVO.setDeptIds(deptIds);
|
||||
}
|
||||
List<SupplierVO> list = supplierService.querySupplierVO(supplierVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -48,7 +55,7 @@ public class SupplierController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SupplierVO supplierVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法添加货商");
|
||||
}
|
||||
@@ -71,9 +78,9 @@ public class SupplierController extends BaseController {
|
||||
// 接口需要划分:上架,信息编辑.
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) SupplierVO supplierVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法修改供货商信息");
|
||||
}
|
||||
@@ -104,9 +111,9 @@ public class SupplierController extends BaseController {
|
||||
if(supplierVO.getSupplierId() == null){
|
||||
return error("未指定要修改的供货商");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法上下架供货商");
|
||||
}
|
||||
@@ -124,7 +131,7 @@ public class SupplierController extends BaseController {
|
||||
if (supplierId == null) {
|
||||
return error("未指定要删除的供货商");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法删除供货商");
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.fdsafe.entity.Browse;
|
||||
import com.zf.foodpurchase.fdsafe.service.IBrowseService;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -30,12 +31,14 @@ import java.util.List;
|
||||
public class MeBrowseController extends BaseController {
|
||||
@Autowired
|
||||
private IBrowseService browseService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
// 需要关联商品信息,关联查询.
|
||||
@ApiOperation("查询用户浏览记录")
|
||||
@GetMapping("list")
|
||||
public AjaxResult list() {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
Browse browse = new Browse();
|
||||
if (!user.isAdmin()) {
|
||||
browse.setMerchantId(user.getDeptId());
|
||||
@@ -48,7 +51,7 @@ public class MeBrowseController extends BaseController {
|
||||
@GetMapping("pageList")
|
||||
public TableDataInfo pageList(Browse browse) {
|
||||
startPage();
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if (!user.isAdmin()) {
|
||||
browse.setMerchantId(user.getDeptId());
|
||||
}else{
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysDept;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.system.service.ISysDeptService;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -25,10 +26,12 @@ public class MerchantController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISysDeptService sysDeptService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/merchantQuery")
|
||||
public AjaxResult merchantQuery(){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法调用此接口");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zf.foodpurchase.fdsafe.service.IFoodProductService;
|
||||
import com.zf.foodpurchase.fdsafe.service.IRepoRecordService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodProductCKVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.RepoRecordVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -26,15 +27,17 @@ public class RepoRecordController extends BaseController {
|
||||
private IRepoRecordService repoRecordService;
|
||||
@Autowired
|
||||
private IFoodProductService foodProductsService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RepoRecord repoRecord)
|
||||
{
|
||||
startPage();
|
||||
SysUser sysUser = getLoginUser().getUser();
|
||||
SysUser sysUser = sysUserService.getUser();
|
||||
if(!sysUser.isAdmin()){
|
||||
repoRecord.setDeptIds(sysUser.getDeptIdList());
|
||||
}
|
||||
startPage();
|
||||
List<RepoRecordVO> list = repoRecordService.selectRepoRecordList(repoRecord);
|
||||
list.forEach(f -> {
|
||||
if(f.getStatus() != null){
|
||||
|
||||
@@ -71,6 +71,7 @@ public class RepositoryController extends BaseController {
|
||||
repository.setMerchantId(null);
|
||||
}
|
||||
}
|
||||
startPage();
|
||||
List<RepositoryVO> list = repositoryService.queryRepoList(repository);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zf.foodpurchase.fdsafe.service.IAccompanyMealService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.AccompanyMealVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -36,20 +37,28 @@ public class AccompanyMealController extends BaseController {
|
||||
@Autowired
|
||||
private IAccompanyMealService accompanyMealService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@RequestMapping("/pageList")
|
||||
public TableDataInfo pageList(AccompanyMealVO accompanyMealVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(accompanyMealVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
accompanyMealVO.setSchoolId(user.getSchoolId());
|
||||
accompanyMealVO.setEduId(user.getEduId());
|
||||
accompanyMealVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<AccompanyMealVO> list = accompanyMealService.queryAccompanyMealVO(accompanyMealVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@RequestMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) AccompanyMealVO accompanyMealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加陪餐记录");
|
||||
}
|
||||
@@ -66,9 +75,9 @@ public class AccompanyMealController extends BaseController {
|
||||
|
||||
@RequestMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) AccompanyMealVO accompanyMealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改陪餐记录");
|
||||
}
|
||||
@@ -88,9 +97,9 @@ public class AccompanyMealController extends BaseController {
|
||||
if(accompanyMealId == null){
|
||||
return error("请选择要删除的陪餐记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除陪餐记录");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zf.foodpurchase.fdsafe.service.ICattenService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.CattenVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -33,11 +34,19 @@ public class CattenController extends BaseController {
|
||||
@Autowired
|
||||
private ICattenService cattenService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@RequestMapping("/pageList")
|
||||
public TableDataInfo pageList(CattenVO cattenVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(cattenVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
cattenVO.setSchoolId(user.getSchoolId());
|
||||
cattenVO.setEduId(user.getEduId());
|
||||
cattenVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<CattenVO> list = cattenService.queryCattenVO(cattenVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -50,9 +59,9 @@ public class CattenController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody CattenVO cattenVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加食堂");
|
||||
}
|
||||
@@ -82,9 +91,9 @@ public class CattenController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody CattenVO cattenVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改食堂信息");
|
||||
}
|
||||
@@ -112,9 +121,9 @@ public class CattenController extends BaseController {
|
||||
if (cattenId == null) {
|
||||
return error("请选择要删除的食堂");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除食堂");
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zf.foodpurchase.fdsafe.service.IDishFoodRelationService;
|
||||
import com.zf.foodpurchase.fdsafe.service.IDishService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.DishFoodRelationVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.DishVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -36,16 +37,19 @@ public class DishController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDishFoodRelationService dishFoodRelationService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@RequestMapping("/pageList")
|
||||
public TableDataInfo pageList(DishVO dishVO) {
|
||||
List<DishVO> list = new ArrayList<>();
|
||||
// if(dishVO == null || dishVO.getSchoolId() == null){
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(dishVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
dishVO.setSchoolId(user.getSchoolId());
|
||||
dishVO.setEduId(user.getEduId());
|
||||
dishVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<DishVO> dishVOList = dishService.queryDishVO(dishVO);
|
||||
TableDataInfo tableDataInfo = getDataTable(dishVOList);
|
||||
return tableDataInfo;
|
||||
@@ -53,9 +57,9 @@ public class DishController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) DishVO dishVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加菜品信息");
|
||||
}
|
||||
@@ -65,9 +69,9 @@ public class DishController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(AddGroup.class) DishVO dishVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改菜品信息");
|
||||
}
|
||||
@@ -80,9 +84,9 @@ public class DishController extends BaseController {
|
||||
if(dishId == null){
|
||||
return error("未指定要删除的菜品");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除菜品信息");
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.IFoodBookService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodBookVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,12 +31,19 @@ public class FoodBookController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IFoodBookService foodBookService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@RequestMapping("/pageList")
|
||||
public TableDataInfo pageList(FoodBookVO foodBookVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(foodBookVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
foodBookVO.setSchoolId(user.getSchoolId());
|
||||
foodBookVO.setEduId(user.getEduId());
|
||||
foodBookVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
foodBookVO.setDelFlag(0);
|
||||
List<FoodBookVO> list = foodBookService.queryFoodBookVO(foodBookVO);
|
||||
return getDataTable(list);
|
||||
@@ -43,9 +51,9 @@ public class FoodBookController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodBookVO foodBookVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加菜谱信息");
|
||||
}
|
||||
@@ -55,9 +63,9 @@ public class FoodBookController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodBookVO foodBookVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改菜谱信息");
|
||||
}
|
||||
@@ -70,9 +78,9 @@ public class FoodBookController extends BaseController {
|
||||
if(bookId == null){
|
||||
return error("未指定要删除的菜谱");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除菜谱信息");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zf.foodpurchase.fdsafe.service.IFoodSampleService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodSampleVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -34,20 +35,28 @@ public class FoodSampleController extends BaseController {
|
||||
@Autowired
|
||||
private IFoodSampleService foodSampleService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(FoodSampleVO foodSampleVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(foodSampleVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
foodSampleVO.setSchoolId(user.getSchoolId());
|
||||
foodSampleVO.setEduId(user.getEduId());
|
||||
foodSampleVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<FoodSampleVO> list = foodSampleService.queryFoodSampleVO(foodSampleVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodSampleVO foodSampleVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加留样记录");
|
||||
}
|
||||
@@ -64,9 +73,9 @@ public class FoodSampleController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodSampleVO foodSampleVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改留样记录");
|
||||
}
|
||||
@@ -86,9 +95,9 @@ public class FoodSampleController extends BaseController {
|
||||
if(sampleId == null){
|
||||
return error("未指定要删除的留样记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除留样记录");
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.IMorningCheckInService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.MorningCheckInVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,20 +31,28 @@ public class MorningCheckInController extends BaseController {
|
||||
@Autowired
|
||||
private IMorningCheckInService morningCheckInService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(MorningCheckInVO morningCheckInVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(morningCheckInVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
morningCheckInVO.setSchoolId(user.getSchoolId());
|
||||
morningCheckInVO.setEduId(user.getEduId());
|
||||
morningCheckInVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<MorningCheckInVO> list = morningCheckInService.queryMorningCheckInVO(morningCheckInVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult save(@RequestBody @Validated(AddGroup.class) MorningCheckInVO morningCheckInVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加晨检记录");
|
||||
}
|
||||
@@ -53,9 +62,9 @@ public class MorningCheckInController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) MorningCheckInVO morningCheckInVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改晨检记录");
|
||||
}
|
||||
@@ -68,9 +77,9 @@ public class MorningCheckInController extends BaseController {
|
||||
if(checkInId == null){
|
||||
return error("未指定要删除的晨检登记记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除晨检记录");
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.MorningInspectionDetailVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.MorningTableHeaderVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.apache.commons.math3.analysis.function.Add;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -45,6 +46,9 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
@Autowired
|
||||
private IMorningInspectionContentService morningInspectionContentService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/getTableHearder")
|
||||
public AjaxResult getTableHearder(Integer eduId){
|
||||
// eduId后面根据token获取账号信息动态获取
|
||||
@@ -53,7 +57,12 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
if(eduId == null){
|
||||
// 填充学校id,教育局id等数据
|
||||
CommonVO commonVO=new CommonVO();
|
||||
dealCommonVO(commonVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
commonVO.setSchoolId(user.getSchoolId());
|
||||
commonVO.setEduId(user.getEduId());
|
||||
commonVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
eduId = commonVO.getEduId();
|
||||
}
|
||||
list =morningInspectionContentService.getTableHearder(eduId);
|
||||
@@ -84,9 +93,9 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated({AddGroup.class}) MorningInspectionDetailVO morningInspectionDetailVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加晨检明细记录");
|
||||
}
|
||||
@@ -103,9 +112,9 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated({UpdateGroup.class}) MorningInspectionDetailVO morningInspectionDetailVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改晨检明细记录");
|
||||
}
|
||||
@@ -125,9 +134,9 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
if(morningDetailId == null){
|
||||
return error("未指定要删除的晨检明细");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除晨检明细记录");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zf.foodpurchase.fdsafe.service.IRubbishDealService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.RubbishDealVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -34,20 +35,28 @@ public class RubbishDealController extends BaseController {
|
||||
@Autowired
|
||||
private IRubbishDealService rubbishDealService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(RubbishDealVO rubbishDealVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(rubbishDealVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
rubbishDealVO.setSchoolId(user.getSchoolId());
|
||||
rubbishDealVO.setEduId(user.getEduId());
|
||||
rubbishDealVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<RubbishDealVO> list = rubbishDealService.queryRubbishDealVO(rubbishDealVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody RubbishDealVO rubbishDealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加餐余垃圾处理记录");
|
||||
}
|
||||
@@ -64,9 +73,9 @@ public class RubbishDealController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody RubbishDealVO rubbishDealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改餐余垃圾处理记录");
|
||||
}
|
||||
@@ -86,9 +95,9 @@ public class RubbishDealController extends BaseController {
|
||||
if(dealId == null){
|
||||
return error("请选择要删除的厨余垃圾处理记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除餐余垃圾处理记录");
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ public class SchoolCartItemController extends BaseController {
|
||||
public TableDataInfo pageList(SchoolCartItemVO schoolCartItemVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolCartItemVO);
|
||||
//
|
||||
SysUser user = userService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =user.getAccountType();
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISchoolService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -28,21 +29,28 @@ public class SchoolController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISchoolService schoolService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SchoolVO schoolVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
schoolVO.setSchoolId(user.getSchoolId());
|
||||
schoolVO.setEduId(user.getEduId());
|
||||
schoolVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolVO> list = schoolService.querySchoolList(schoolVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SchoolVO schoolVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法添加学校");
|
||||
}
|
||||
|
||||
@@ -50,8 +50,6 @@ public class SchoolOrderController extends BaseController {
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
schoolOrderVO.setDeptIds(deptIds);
|
||||
}
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderVO);
|
||||
List<SchoolOrderVO> list = schoolOrderService.querySupplierOrderVO(schoolOrderVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -64,8 +62,18 @@ public class SchoolOrderController extends BaseController {
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
schoolOrderVO.setDeptIds(deptIds);
|
||||
}
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderVO);
|
||||
List<SchoolOrderVO> list = schoolOrderService.querySchoolOrderVO(schoolOrderVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SchoolOrderVO schoolOrderVO) {
|
||||
SysUser user = userService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
schoolOrderVO.setDeptIds(deptIds);
|
||||
}
|
||||
startPage();
|
||||
List<SchoolOrderVO> list = schoolOrderService.querySchoolOrderVO(schoolOrderVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -79,8 +87,6 @@ public class SchoolOrderController extends BaseController {
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
schoolOrderVO.setDeptIds(deptIds);
|
||||
}
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderVO);
|
||||
List<SchoolOrderVO> list = schoolOrderService.querySchoolOrderVO(schoolOrderVO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
import com.zf.foodpurchase.common.core.controller.BaseController;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.fdsafe.entity.SchoolOrderItem;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISchoolOrderItemService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.ProductCountVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolOrderItemVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -29,11 +31,18 @@ import java.util.List;
|
||||
public class SchoolOrderItemController extends BaseController {
|
||||
@Autowired
|
||||
private ISchoolOrderItemService schoolOrderItemService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(SchoolOrderItemVO schoolOrderItemVO) {
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderItemVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
schoolOrderItemVO.setSchoolId(user.getSchoolId());
|
||||
schoolOrderItemVO.setEduId(user.getEduId());
|
||||
schoolOrderItemVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolOrderItemVO> list = schoolOrderItemService.querySchoolOrderItemVO(schoolOrderItemVO);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
@@ -42,7 +51,12 @@ public class SchoolOrderItemController extends BaseController {
|
||||
public TableDataInfo pageList(SchoolOrderItemVO schoolOrderItemVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderItemVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
schoolOrderItemVO.setSchoolId(user.getSchoolId());
|
||||
schoolOrderItemVO.setEduId(user.getEduId());
|
||||
schoolOrderItemVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolOrderItemVO> list = schoolOrderItemService.querySchoolOrderItemVO(schoolOrderItemVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.zf.foodpurchase.fdsafe.vo.RefundCheckVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.RefundItemAddUpdateVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolRefundItemVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolRefundVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -42,12 +43,20 @@ public class SchoolRefundController extends BaseController {
|
||||
@Autowired
|
||||
private ISchoolRefundService schoolRefundService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
// 查询接口,根据退款总单号查询
|
||||
@GetMapping("/querySchoolRefund")
|
||||
public TableDataInfo querySchoolRefund(SchoolRefundVO schoolRefundVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolRefundVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
schoolRefundVO.setSchoolId(user.getSchoolId());
|
||||
schoolRefundVO.setEduId(user.getEduId());
|
||||
schoolRefundVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolRefundVO> schoolRefunds = schoolRefundService.querySchoolRefund(schoolRefundVO);
|
||||
return getDataTable(schoolRefunds);
|
||||
}
|
||||
@@ -73,9 +82,9 @@ public class SchoolRefundController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/addRefundItem")
|
||||
public AjaxResult addRefundItem(@RequestBody @Validated(AddGroup.class) RefundItemAddUpdateVO refundItemAddUpdateVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法创建退货单");
|
||||
}
|
||||
@@ -88,9 +97,9 @@ public class SchoolRefundController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/updateRefundItem")
|
||||
public AjaxResult updateRefundItem(@RequestBody @Validated(UpdateGroup.class) RefundItemAddUpdateVO refundItemAddUpdateVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改退货单");
|
||||
}
|
||||
@@ -103,9 +112,9 @@ public class SchoolRefundController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/checkSchoolRefund")
|
||||
public AjaxResult checkSchoolRefund(@RequestBody @Valid RefundCheckVO checkVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法审核退货单");
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.zf.foodpurchase.fdsafe.vo.SchoolOrderVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolSettleCheckVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolSettleSubmitVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolSettleVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -37,14 +38,20 @@ public class SchoolSettleController extends BaseController {
|
||||
@Autowired
|
||||
private ISchoolSettleService schoolSettleService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 查询可结算订单
|
||||
*/
|
||||
@GetMapping("/queryCanSettleOrder")
|
||||
public TableDataInfo queryCanSettleOrder(SchoolOrderVO schoolOrderVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolOrderVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
List<Long> deptIds = user.getDeptIdList();
|
||||
schoolOrderVO.setDeptIds(deptIds);
|
||||
}
|
||||
schoolOrderVO.setOrderSettleStatus(OrderStatusConstants.CAN_SETTLEMENT);
|
||||
List<SchoolOrderVO> list = schoolOrderService.querySchoolOrderVO(schoolOrderVO);
|
||||
return getDataTable(list);
|
||||
@@ -55,9 +62,9 @@ public class SchoolSettleController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/submitSettle")
|
||||
public AjaxResult submitSettle(@RequestBody @Valid SchoolSettleSubmitVO submitVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法发起订单结算");
|
||||
}
|
||||
@@ -70,9 +77,9 @@ public class SchoolSettleController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/checkSettle")
|
||||
public AjaxResult checkSettle(@RequestBody @Valid SchoolSettleCheckVO checkVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法发起订单结算");
|
||||
}
|
||||
@@ -88,9 +95,9 @@ public class SchoolSettleController extends BaseController {
|
||||
if(StringUtils.isEmpty(settleNo)){
|
||||
return AjaxResult.warn("结算单号不能为空");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法更新结算单状态");
|
||||
}
|
||||
@@ -106,9 +113,9 @@ public class SchoolSettleController extends BaseController {
|
||||
if(StringUtils.isEmpty(settleNo)){
|
||||
return AjaxResult.warn("结算单号不能为空");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法确认收款");
|
||||
}
|
||||
@@ -122,8 +129,12 @@ public class SchoolSettleController extends BaseController {
|
||||
@GetMapping("/querySettleList")
|
||||
public TableDataInfo querySettleList(SchoolSettleVO settleVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(settleVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
settleVO.setSchoolId(user.getSchoolId());
|
||||
settleVO.setEduId(user.getEduId());
|
||||
settleVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolSettleVO> list = schoolSettleService.qeurySettleVO(settleVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.zf.foodpurchase.fdsafe.service.ISchoolStaffService;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolStaffVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -38,21 +39,28 @@ import java.util.List;
|
||||
public class SchoolStaffController extends BaseController {
|
||||
@Autowired
|
||||
private ISchoolStaffService schoolStaffService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SchoolStaffVO schoolStaffVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolStaffVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
schoolStaffVO.setSchoolId(user.getSchoolId());
|
||||
schoolStaffVO.setEduId(user.getEduId());
|
||||
schoolStaffVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SchoolStaffVO> list = schoolStaffService.querySchoolStaffVO(schoolStaffVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody SchoolStaffVO schoolStaffVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加食堂人员");
|
||||
}
|
||||
@@ -69,9 +77,9 @@ public class SchoolStaffController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody SchoolStaffVO schoolStaffVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改食堂人员信息");
|
||||
}
|
||||
@@ -91,9 +99,9 @@ public class SchoolStaffController extends BaseController {
|
||||
if (staffId == null) {
|
||||
return error("请选择要删除的学校人员");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除学校人员");
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SelfInspectionDetailVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SelfInspectionRecordVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -34,21 +35,28 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISelfInspectionRecordService selfInspectionRecordService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SelfInspectionRecordVO selfInspectionRecordVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(selfInspectionRecordVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
selfInspectionRecordVO.setSchoolId(user.getSchoolId());
|
||||
selfInspectionRecordVO.setEduId(user.getEduId());
|
||||
selfInspectionRecordVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SelfInspectionRecordVO> list = selfInspectionRecordService.querySelfInspectionRecordVO(selfInspectionRecordVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SelfInspectionRecordVO selfInspectionRecordVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加监督自查记录");
|
||||
}
|
||||
@@ -70,9 +78,9 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) SelfInspectionRecordVO selfInspectionRecordVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改监督自查记录");
|
||||
}
|
||||
@@ -97,9 +105,9 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
if(selfRecordId == null){
|
||||
return error("未指定要删除的自检记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除监督自查记录");
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.entity.WxAppUser;
|
||||
import com.zf.foodpurchase.fdsafe.service.IWxAppUserService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxAppUserViewVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,11 +28,13 @@ public class WxAppUserController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IWxAppUserService wxAppUserService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(WxAppUserViewVO wxAppUserViewVO) {
|
||||
startPage();
|
||||
SysUser loginUser = getLoginUser().getUser();
|
||||
SysUser loginUser = sysUserService.getUser();
|
||||
if (!loginUser.isAdmin()) {
|
||||
wxAppUserViewVO.setAccountType(loginUser.getAccountType());
|
||||
wxAppUserViewVO.setDeptId(loginUser.getDeptId().intValue());
|
||||
@@ -42,7 +45,7 @@ public class WxAppUserController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) WxAppUserViewVO wxAppUserViewVO) {
|
||||
SysUser loginUser = getLoginUser().getUser();
|
||||
SysUser loginUser = sysUserService.getUser();
|
||||
if (!loginUser.isAdmin()) {
|
||||
wxAppUserViewVO.setAccountType(loginUser.getAccountType());
|
||||
wxAppUserViewVO.setDeptId(loginUser.getDeptId().intValue());
|
||||
@@ -71,7 +74,7 @@ public class WxAppUserController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) WxAppUserViewVO wxAppUserViewVO) {
|
||||
SysUser loginUser = getLoginUser().getUser();
|
||||
SysUser loginUser = sysUserService.getUser();
|
||||
if (!loginUser.isAdmin()) {
|
||||
wxAppUserViewVO.setAccountType(loginUser.getAccountType());
|
||||
wxAppUserViewVO.setDeptId(loginUser.getDeptId().intValue());
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.zf.foodpurchase.fdsafe.vo.SchoolDeliveryVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierDeliveryAddUpdateVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierDeliveryVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -35,11 +36,19 @@ public class SupplierDeliveryController extends BaseController {
|
||||
@Autowired
|
||||
private ISupplierDeliveryService supplierDeliveryService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SupplierDeliveryVO supplierDeliveryVO){
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(supplierDeliveryVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
supplierDeliveryVO.setSchoolId(user.getSchoolId());
|
||||
supplierDeliveryVO.setEduId(user.getEduId());
|
||||
supplierDeliveryVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SupplierDeliveryVO> list = supplierDeliveryService.querySupplierDeliveryVO(supplierDeliveryVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@@ -51,9 +60,9 @@ public class SupplierDeliveryController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/addOrderDelivery")
|
||||
public AjaxResult addOrderDelivery(@RequestBody @Validated(AddGroup.class) SupplierDeliveryAddUpdateVO deliveryAddVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法添加送货单");
|
||||
}
|
||||
@@ -63,9 +72,9 @@ public class SupplierDeliveryController extends BaseController {
|
||||
|
||||
@PostMapping("/supplierUpdateDelivery")
|
||||
public AjaxResult supplierUpdateDelivery(@RequestBody @Validated(UpdateGroup.class) SupplierDeliveryAddUpdateVO supplierDeliveryVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法修改送货单");
|
||||
}
|
||||
@@ -75,9 +84,9 @@ public class SupplierDeliveryController extends BaseController {
|
||||
|
||||
@PostMapping("/schoolSignDelivery")
|
||||
public AjaxResult schoolUpdateDelivery(@RequestBody @Validated(UpdateGroup.class) SchoolDeliveryVO schoolDeliveryVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法签收送货单");
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierDeliveryItemUpdateVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierDeliveryItemVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.WxImg;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -33,12 +34,19 @@ public class SupplierDeliveryItemController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ISupplierDeliveryItemService supplierDeliveryItemService;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SupplierDeliveryItemVO supplierDeliveryItemVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(supplierDeliveryItemVO);
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
supplierDeliveryItemVO.setSchoolId(user.getSchoolId());
|
||||
supplierDeliveryItemVO.setEduId(user.getEduId());
|
||||
supplierDeliveryItemVO.setSupplierId(user.getSupplierId());
|
||||
}
|
||||
List<SupplierDeliveryItemVO> list = supplierDeliveryItemService.querySupplierDeliveryItemVO(supplierDeliveryItemVO);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item -> {
|
||||
@@ -56,9 +64,9 @@ public class SupplierDeliveryItemController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) SupplierDeliveryItemUpdateVO supplierDeliveryItemUpdateVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
Integer accountType =user.getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法修改子送货单信息");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FoodProductMaterial {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long foodProductId;
|
||||
private Integer foodId;
|
||||
}
|
||||
@@ -54,9 +54,7 @@ public class FoodSpec implements Serializable {
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否有效: 0 有效 1 无效
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ public class Repository implements Serializable {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@NotNull(message = "仓库名称不能为空")
|
||||
@TableField("repo_name")
|
||||
private String repoName;
|
||||
/**
|
||||
@@ -57,7 +56,6 @@ public class Repository implements Serializable {
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@NotNull(message = "详细地址不能为空")
|
||||
@TableField("detail_address")
|
||||
private String detailAddress;
|
||||
|
||||
@@ -86,14 +84,12 @@ public class Repository implements Serializable {
|
||||
private Long operId;
|
||||
|
||||
@TableField
|
||||
@NotNull(message = "仓库管理员不能为空")
|
||||
private Long manager;
|
||||
|
||||
@TableField
|
||||
private String repoNum;
|
||||
|
||||
@TableField
|
||||
@NotNull(message = "排序号不能为空")
|
||||
private Integer orderNum;
|
||||
@TableField(exist = false)
|
||||
private List<Long> deptIds;
|
||||
|
||||
@@ -17,4 +17,6 @@ import java.util.List;
|
||||
public interface SupplierMapper extends BaseMapper<Supplier> {
|
||||
|
||||
List<SupplierVO> querySupplierVO(SupplierVO supplierVO);
|
||||
|
||||
Integer selectMaxId();
|
||||
}
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package com.zf.foodpurchase.fdsafe.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.zf.foodpurchase.common.constant.FoodStatusConstants;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.utils.bean.BeanUtils;
|
||||
import com.zf.foodpurchase.fdsafe.entity.Food;
|
||||
import com.zf.foodpurchase.fdsafe.entity.FoodProduct;
|
||||
import com.zf.foodpurchase.fdsafe.mapper.FoodMapper;
|
||||
import com.zf.foodpurchase.fdsafe.entity.FoodProductMaterial;
|
||||
import com.zf.foodpurchase.fdsafe.mapper.FoodProductMapper;
|
||||
import com.zf.foodpurchase.fdsafe.service.IFoodProductService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodProductCKVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodProductVO;
|
||||
import com.zf.foodpurchase.system.mapper.FoodProductMaterialMapper;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -37,9 +40,21 @@ public class FoodProductServiceImpl extends ServiceImpl<FoodProductMapper, FoodP
|
||||
@Autowired
|
||||
private FoodProductMapper foodProductMapper;
|
||||
|
||||
@Autowired
|
||||
private FoodProductMaterialMapper foodProductMaterialMapper;
|
||||
|
||||
@Override
|
||||
public List<FoodProductVO> queryFoodProductVO(FoodProductVO foodProductVO) {
|
||||
List<FoodProductVO> list = baseMapper.queryFoodProductVO(foodProductVO);
|
||||
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
for (FoodProductVO foodProductVO1 : list) {
|
||||
List<FoodProductMaterial> foodProductMaterials = foodProductMaterialMapper.selectByFoodProductId(foodProductVO1.getFoodProductId());
|
||||
if(CollectionUtil.isNotEmpty(foodProductMaterials)){
|
||||
foodProductVO1.setFoodProductMaterials(foodProductMaterials);
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -50,9 +65,17 @@ public class FoodProductServiceImpl extends ServiceImpl<FoodProductMapper, FoodP
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult supplierAdd(FoodProductVO foodProductVO) {
|
||||
FoodProduct foodProduct = dealSupplierProductAdd(foodProductVO);
|
||||
boolean save = save(foodProduct);
|
||||
List<FoodProductMaterial> list = foodProductVO.getFoodProductMaterials();
|
||||
if(CollectionUtil.isNotEmpty(list)){
|
||||
for(FoodProductMaterial foodProductMaterial : list){
|
||||
foodProductMaterial.setFoodProductId(foodProduct.getFoodProductId());
|
||||
}
|
||||
foodProductMaterialMapper.batchInsert(foodProductVO.getFoodProductMaterials());
|
||||
}
|
||||
return save ? AjaxResult.success("商品发布成功") : AjaxResult.error("商品发布失败");
|
||||
}
|
||||
|
||||
@@ -126,7 +149,7 @@ public class FoodProductServiceImpl extends ServiceImpl<FoodProductMapper, FoodP
|
||||
}
|
||||
//foodProduct.setEduId(food.getEduId());
|
||||
// 审核项置空.
|
||||
foodProduct.setCheckStatus(FoodStatusConstants.PRODUCT_WAIT_CHECK);
|
||||
foodProduct.setCheckStatus(FoodStatusConstants.PRODUCT_CHECK_PASS);
|
||||
foodProduct.setCheckRemark(null);
|
||||
foodProduct.setCheckTime(null);
|
||||
return foodProduct;
|
||||
|
||||
@@ -3,13 +3,17 @@ package com.zf.foodpurchase.fdsafe.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.utils.bean.BeanUtils;
|
||||
import com.zf.foodpurchase.fdsafe.entity.FoodSpec;
|
||||
import com.zf.foodpurchase.fdsafe.mapper.FoodSpecMapper;
|
||||
import com.zf.foodpurchase.fdsafe.service.IFoodSpecService;
|
||||
import com.zf.foodpurchase.fdsafe.vo.FoodSpecVO;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -23,6 +27,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class FoodSpecServiceImpl extends ServiceImpl<FoodSpecMapper, FoodSpec> implements IFoodSpecService {
|
||||
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Override
|
||||
public List<FoodSpecVO> queryFoodSpecVO(FoodSpecVO foodSpecVO) {
|
||||
List<FoodSpecVO> list = baseMapper.queryFoodSpecVO(foodSpecVO);
|
||||
@@ -31,11 +38,16 @@ public class FoodSpecServiceImpl extends ServiceImpl<FoodSpecMapper, FoodSpec> i
|
||||
|
||||
@Override
|
||||
public AjaxResult saveVO(FoodSpecVO foodSpecVO) {
|
||||
SysUser user = sysUserService.getUser();
|
||||
if(!user.isAdmin()){
|
||||
foodSpecVO.setDeptId(user.getDeptId());
|
||||
}
|
||||
FoodSpec foodSpec=new FoodSpec();
|
||||
BeanUtils.copyProperties(foodSpecVO, foodSpec);
|
||||
if(!uniqueSpecCheck(foodSpec)){
|
||||
return AjaxResult.error("规格/单位已存在,不可重复添加");
|
||||
}
|
||||
foodSpec.setCreateTime(new Date());
|
||||
boolean result = save(foodSpec);
|
||||
return result ? AjaxResult.success("添加成功") : AjaxResult.error("添加失败");
|
||||
}
|
||||
@@ -47,6 +59,7 @@ public class FoodSpecServiceImpl extends ServiceImpl<FoodSpecMapper, FoodSpec> i
|
||||
if(!uniqueSpecCheck(foodSpec)){
|
||||
return AjaxResult.error("规格/单位已存在,不可修改为该规格/单位");
|
||||
}
|
||||
foodSpec.setUpdateTime(new Date());
|
||||
boolean result = updateById(foodSpec);
|
||||
return result ? AjaxResult.success("修改成功") : AjaxResult.error("修改失败");
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.zf.foodpurchase.fdsafe.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -53,34 +54,45 @@ public class RepositoryServiceImpl extends ServiceImpl<RepositoryMapper, Reposit
|
||||
throw new RuntimeException("登录人员部门为空,不能生成订单编号");
|
||||
}
|
||||
Date date = DateUtils.getNowDate();
|
||||
String repoNo = "";
|
||||
String dateStr = DateUtils.getShortYearMonthDay( date);
|
||||
Long deptId = user.getDeptId();
|
||||
XhCreate xhCreate = new XhCreate();
|
||||
xhCreate.setDeptId(deptId);
|
||||
xhCreate.setTimeStr(dateStr);
|
||||
XhCreateVO xhCreateVO = new XhCreateVO();
|
||||
BeanUtils.copyProperties(xhCreate,xhCreateVO);
|
||||
XhCreate xhCreateNew = xhMapper.queryXhCreate(xhCreateVO);
|
||||
if(ObjectUtil.isNull(xhCreateNew)){
|
||||
Integer deptNum = xhMapper.selectMaxDeptNum();
|
||||
Integer num = 1;
|
||||
if(ObjectUtil.isNotNull(deptNum)){
|
||||
num = deptNum+1;
|
||||
if(StringUtils.isBlank(repository.getRepoNum())){
|
||||
String repoNo = "";
|
||||
String dateStr = DateUtils.getShortYearMonthDay( date);
|
||||
Long deptId = user.getDeptId();
|
||||
XhCreate xhCreate = new XhCreate();
|
||||
xhCreate.setDeptId(deptId);
|
||||
xhCreate.setTimeStr(dateStr);
|
||||
XhCreateVO xhCreateVO = new XhCreateVO();
|
||||
BeanUtils.copyProperties(xhCreate,xhCreateVO);
|
||||
XhCreate xhCreateNew = xhMapper.queryXhCreate(xhCreateVO);
|
||||
if(ObjectUtil.isNull(xhCreateNew)){
|
||||
Integer deptNum = xhMapper.selectMaxDeptNum();
|
||||
Integer num = 1;
|
||||
if(ObjectUtil.isNotNull(deptNum)){
|
||||
num = deptNum+1;
|
||||
}
|
||||
xhCreate.setDeptNum(num);
|
||||
xhCreate.setXh(1);
|
||||
xhMapper.insertXhCreate(xhCreate);
|
||||
repoNo = StringUtils.formatNumThree(deptNum)+dateStr+"001";
|
||||
}else{
|
||||
Integer deptNum = xhCreateNew.getDeptNum();
|
||||
Integer xhNum = xhCreateNew.getXh()+1;
|
||||
String xhNumStr = StringUtils.formatNumThree(xhNum);
|
||||
repoNo = StringUtils.formatNumThree(deptNum)+dateStr+xhNumStr;
|
||||
xhCreateNew.setXh(xhNum);
|
||||
xhMapper.updateXhCreate(xhCreateNew);
|
||||
}
|
||||
xhCreate.setDeptNum(num);
|
||||
xhCreate.setXh(1);
|
||||
xhMapper.insertXhCreate(xhCreate);
|
||||
repoNo = StringUtils.formatNumThree(deptNum)+dateStr+"001";
|
||||
repository.setRepoNum(repoNo);
|
||||
}else{
|
||||
Integer deptNum = xhCreateNew.getDeptNum();
|
||||
Integer xhNum = xhCreateNew.getXh()+1;
|
||||
String xhNumStr = StringUtils.formatNumThree(xhNum);
|
||||
repoNo = StringUtils.formatNumThree(deptNum)+dateStr+xhNumStr;
|
||||
xhCreateNew.setXh(xhNum);
|
||||
xhMapper.updateXhCreate(xhCreateNew);
|
||||
String repoNum = repository.getRepoNum();
|
||||
Repository queryRepository = new Repository();
|
||||
queryRepository.setRepoNum(repoNum);
|
||||
List<RepositoryVO> list = repositoryMapper.queryRepoList(queryRepository);
|
||||
if(CollectionUtil.isNotEmpty( list)){
|
||||
return AjaxResult.error("仓库编号已存在请更换仓库编号");
|
||||
}
|
||||
}
|
||||
repository.setRepoNum(repoNo);
|
||||
|
||||
if (checkRepoNameUnique(repository)) {
|
||||
return AjaxResult.error("仓库名称已存在请更换仓库名称");
|
||||
}
|
||||
|
||||
@@ -116,9 +116,9 @@ public class SchoolOrderServiceImpl extends ServiceImpl<SchoolOrderMapper, Schoo
|
||||
if (foodProduct == null) {
|
||||
throw new RuntimeException("部分商品不存在,请刷新页面后,确认提交的商品状态正常后重新提交订单");
|
||||
}
|
||||
if (!FoodStatusConstants.PRODUCT_CHECK_PASS.equals(foodProduct.getCheckStatus())) {
|
||||
/*if (!FoodStatusConstants.PRODUCT_CHECK_PASS.equals(foodProduct.getCheckStatus())) {
|
||||
throw new RuntimeException("部分商品审核未通过,请刷新页面后,确认提交的商品状态正常后重新提交订单");
|
||||
}
|
||||
}*/
|
||||
totalMoney = totalMoney.add(foodProduct.getPrice().multiply(new BigDecimal(schoolCartItem.getProductNum())));
|
||||
// 设置子单项目信息
|
||||
// 食材信息
|
||||
@@ -130,6 +130,9 @@ public class SchoolOrderServiceImpl extends ServiceImpl<SchoolOrderMapper, Schoo
|
||||
BeanUtils.copyProperties(schoolCartItem, schoolOrderItem);
|
||||
BeanUtils.copyProperties(foodProduct, schoolOrderItem);
|
||||
//BeanUtils.copyProperties(food, schoolOrderItem);
|
||||
schoolOrderItem.setFoodId(foodProduct.getFoodId());
|
||||
schoolOrderItem.setFoodName(foodProduct.getName());
|
||||
schoolOrderItem.setFoodProductId(foodProduct.getFoodProductId().intValue());
|
||||
schoolOrderItem.setOrderItemStatus(OrderStatusConstants.WAIT_ACCEPT);
|
||||
// 将备注信息保存到子订单中.
|
||||
schoolOrderItem.setOrderItemRemark(schoolCartItem.getItemRemark());
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.service.impl;
|
||||
|
||||
import com.zf.foodpurchase.common.core.domain.AjaxResult;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysDept;
|
||||
import com.zf.foodpurchase.common.core.domain.entity.SysUser;
|
||||
import com.zf.foodpurchase.common.utils.StringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.entity.Supplier;
|
||||
import com.zf.foodpurchase.fdsafe.mapper.SupplierMapper;
|
||||
@@ -9,9 +11,12 @@ import com.zf.foodpurchase.fdsafe.service.ISupplierService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zf.foodpurchase.fdsafe.utils.ArrayStringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SupplierVO;
|
||||
import com.zf.foodpurchase.system.mapper.SysDeptMapper;
|
||||
import com.zf.foodpurchase.system.service.ISysUserService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
@@ -28,7 +33,12 @@ import java.util.List;
|
||||
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService {
|
||||
@Autowired
|
||||
private CommonService commonService;
|
||||
|
||||
@Autowired
|
||||
private SupplierMapper supplierMapper;
|
||||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Autowired
|
||||
private ISysUserService sysUserService;
|
||||
// 菜品 :dishes
|
||||
// 食品: foodstuff
|
||||
// dish
|
||||
@@ -59,7 +69,13 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public AjaxResult saveVO(SupplierVO supplierVO) {
|
||||
SysUser user = sysUserService.getUser();
|
||||
Long deptId = user.getDeptId();
|
||||
SysDept parentDept = sysDeptMapper.selectDeptById(deptId);
|
||||
String tenantId = parentDept.getTenantId();
|
||||
String ancestors = parentDept.getAncestors()+","+deptId;
|
||||
Supplier supplier = new Supplier();
|
||||
BeanUtils.copyProperties(supplierVO, supplier);
|
||||
supplier.setFoodLicenseImg(ArrayStringUtils.arrayToString(supplierVO.getFoodLicenseImg()));
|
||||
@@ -67,6 +83,20 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
|
||||
supplier.setAreaCode(ArrayStringUtils.arrayToString(supplierVO.getAreaCode()));
|
||||
// 供货商上下架有专门的接口
|
||||
supplier.setStatus(null);
|
||||
Integer orgMaxId = supplierMapper.selectMaxId()+1;
|
||||
Long deptMaxIdL = sysDeptMapper.selectMaxId()+1;
|
||||
Integer deptMaxId = deptMaxIdL.intValue();
|
||||
int max = deptMaxId > orgMaxId ? deptMaxId : orgMaxId;
|
||||
supplier.setSupplierId( max);
|
||||
SysDept dept = new SysDept();
|
||||
dept.setDeptId((long) max);
|
||||
dept.setParentId(deptId);
|
||||
dept.setTenantId(tenantId);
|
||||
dept.setDeptName(supplier.getSupplierName());
|
||||
dept.setAncestors(ancestors);
|
||||
dept.setMerchantFlag("1");
|
||||
sysDeptMapper.insertDept(dept);
|
||||
|
||||
boolean result = save(supplier);
|
||||
return result ? AjaxResult.success("新增成功") : AjaxResult.error("新增失败");
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.CheckGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.common.vo.CommonVO;
|
||||
import com.zf.foodpurchase.fdsafe.entity.FoodProductMaterial;
|
||||
import lombok.Data;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
@@ -125,4 +126,6 @@ public class FoodProductVO extends CommonVO implements Serializable {
|
||||
private List<Long> deptIds;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private List<FoodProductMaterial> foodProductMaterials;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:lilj
|
||||
@@ -43,9 +44,8 @@ public class FoodSpecVO implements Serializable {
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 是否有效: 0 有效 1 无效
|
||||
*/
|
||||
@NotNull(message = "是否有效不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
private Integer status;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Long deptId;
|
||||
}
|
||||
|
||||
@@ -113,4 +113,6 @@ public class SchoolOrderItemVO extends CommonVO implements Serializable {
|
||||
|
||||
private String modelName;
|
||||
|
||||
private String num;
|
||||
|
||||
}
|
||||
|
||||
@@ -117,4 +117,8 @@ public class SchoolOrderVO extends CommonVO implements Serializable {
|
||||
private String signImage;
|
||||
|
||||
private List<Long> deptIds;
|
||||
|
||||
private Date beginTime;
|
||||
|
||||
private Date endTime;
|
||||
}
|
||||
|
||||
@@ -129,4 +129,6 @@ public class SupplierVO extends CommonVO implements Serializable {
|
||||
* 1 已上架
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private List<Long> deptIds;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.zf.foodpurchase.system.mapper;
|
||||
|
||||
import com.zf.foodpurchase.fdsafe.entity.FoodProductMaterial;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface FoodProductMaterialMapper {
|
||||
|
||||
int insert(FoodProductMaterial record);
|
||||
|
||||
void batchInsert(List<FoodProductMaterial> records);
|
||||
|
||||
List<FoodProductMaterial> selectByFoodProductId(Long foodProductId);
|
||||
}
|
||||
@@ -125,4 +125,7 @@ public interface SysDeptMapper
|
||||
public List<Long> selectAllZSByDeptId(Long deptId);
|
||||
|
||||
List<SysDept> selectIdByDeptIds(@Param("deptIds") List<Integer> deptIds);
|
||||
|
||||
Long selectMaxId();
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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.zf.foodpurchase.system.mapper.FoodProductMaterialMapper">
|
||||
|
||||
<select id="selectByFoodProductId" resultType="com.zf.foodpurchase.fdsafe.entity.FoodProductMaterial"
|
||||
parameterType="java.lang.Long">
|
||||
select id,food_product_id foodProductId,food_id foodId from food_product_material where food_product_id = #{foodProductId}
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="com.zf.foodpurchase.fdsafe.entity.FoodProductMaterial" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into food_product_material(
|
||||
<if test="foodProductId != null">food_product_id,</if>
|
||||
<if test="foodId != null">food_id</if>
|
||||
)values(
|
||||
<if test="foodProductId != null">#{foodProductId},</if>
|
||||
<if test="foodId != null">#{foodId}</if>
|
||||
</insert>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true">
|
||||
INSERT INTO food_product_material (food_product_id, food_id)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{item.foodProductId}, #{item.foodId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
spec_id, spec_label, del_flag, create_time, update_time,status
|
||||
spec_id, spec_label, del_flag, create_time, update_time, dept_id
|
||||
</sql>
|
||||
<select id="queryFoodSpecVO" resultType="com.zf.foodpurchase.fdsafe.vo.FoodSpecVO"
|
||||
parameterType="com.zf.foodpurchase.fdsafe.vo.FoodSpecVO">
|
||||
@@ -21,8 +21,11 @@
|
||||
<if test="delFlag != null">
|
||||
and del_flag = #{delFlag}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and status = #{status}
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
and dept_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
group by r.id,r.merchant_id,r.repo_num,r.repo_name,r.area_code,r.detail_address,r.default_repo,r.create_time,r.update_time,r.oper_id,r.manager,r.order_num,d.dept_name;
|
||||
group by r.id,r.merchant_id,r.repo_num,r.repo_name,r.area_code,r.detail_address,r.default_repo,r.create_time,r.update_time,r.oper_id,r.manager,r.order_num,d.dept_name order by r.order_num
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<select id="querySchoolOrderItemVO" resultType="com.zf.foodpurchase.fdsafe.vo.SchoolOrderItemVO"
|
||||
parameterType="com.zf.foodpurchase.fdsafe.vo.SchoolOrderItemVO">
|
||||
select soi.order_item_no, soi.order_no,soi.food_id, soi.school_id, soi.edu_id, soi.supplier_id, soi.food_product_id, soi.food_name, soi.price, soi.product_num, soi.type_id, soi.unit_id, soi.order_item_status, soi.create_time, soi.update_time, soi.order_item_remark,soi.refund_num,
|
||||
ft.type_label,fu.unit_label,fp.remark as food_product_remark,sup.supplier_name supplierName,fu.unit_label modelName
|
||||
ft.type_label,fu.unit_label,fp.remark as food_product_remark,sup.supplier_name supplierName,fu.unit_label modelName,fp.num
|
||||
from school_order_item soi
|
||||
left join supplier sup on soi.supplier_id=sup.supplier_id
|
||||
left join school_order so on soi.order_no = so.order_no
|
||||
|
||||
@@ -32,11 +32,17 @@
|
||||
<if test="orderStatus != null">
|
||||
and so.order_status = #{orderStatus}
|
||||
</if>
|
||||
<if test="operatorPerson != null and operatorPerson != ''">
|
||||
and so.operator_person = #{operatorPerson}
|
||||
</if>
|
||||
<if test="operatorPhone != null and operatorPhone != ''">
|
||||
and so.operator_phone = #{operatorPhone}
|
||||
</if>
|
||||
<if test="beginTime != null">
|
||||
AND date_format(so.create_time,'%Y%m%d') >= date_format(#{beginTime},'%Y%m%d')
|
||||
AND so.create_time >= #{beginTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and date_format(so.create_time,'%Y%m%d') <=date_format(#{endTime},'%Y%m%d')
|
||||
AND so.create_time <= #{endTime}
|
||||
</if>
|
||||
<if test = 'orderSettleStatus !=null'>
|
||||
and so.order_settle_status = #{orderSettleStatus}
|
||||
|
||||
@@ -38,7 +38,16 @@
|
||||
<if test="status!=null">
|
||||
and sp.status = #{status}
|
||||
</if>
|
||||
<if test="deptIds != null and deptIds.size() > 0">
|
||||
and sp.supplier_id in
|
||||
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMaxId" resultType="java.lang.Integer">
|
||||
select max(supplier_id) id
|
||||
from supplier
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -101,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
insert into sys_dept(
|
||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id,</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
@@ -117,6 +118,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
)values(
|
||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
||||
<if test="tenantId != null and tenantId != ''">#{tenantId},</if>
|
||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
@@ -137,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
||||
<if test="tenantId != null and tenantId != ''">tenant_id = #{tenantId},</if>
|
||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
@@ -183,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
update sys_dept
|
||||
<set>
|
||||
<if test="dept.parentId != null and dept.parentId != 0">parent_id = #{dept.parentId},</if>
|
||||
<if test="dept.tenantId != null and dept.tenantId != ''">tenant_id = #{dept.tenantId},</if>
|
||||
<if test="dept.deptName != null and dept.deptName != ''">dept_name = #{dept.deptName},</if>
|
||||
<if test="dept.ancestors != null and dept.ancestors != ''">ancestors = #{dept.ancestors},</if>
|
||||
<if test="dept.orderNum != null">order_num = #{dept.orderNum},</if>
|
||||
@@ -231,4 +235,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectMaxId" resultType="java.lang.Long">
|
||||
select max(dept_id) id
|
||||
from sys_dept
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user