Compare commits
10 Commits
630c43b1e5
...
7c319a80a4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c319a80a4 | ||
|
|
2cc4a5aeb6 | ||
|
|
bffa56a4b4 | ||
|
|
34cb3dd6ed | ||
|
|
024ac4603c | ||
|
|
3fe43484c8 | ||
|
|
5456559859 | ||
|
|
ec7b80fa8b | ||
|
|
86b6782cd7 | ||
|
|
b89ec31332 |
@@ -2,6 +2,7 @@ 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.domain.model.LoginUser;
|
||||
import com.zf.foodpurchase.common.core.page.TableDataInfo;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
@@ -45,6 +46,10 @@ public class EduController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) EduVO eduVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法添加教育局");
|
||||
}
|
||||
return eduService.saveVO(eduVO);
|
||||
}
|
||||
|
||||
@@ -58,6 +63,10 @@ public class EduController extends BaseController {
|
||||
if(eduId == null){
|
||||
return error("未指定要删除的教育局");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法删除教育局");
|
||||
}
|
||||
return eduService.removeById(eduId) ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.edu;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -41,11 +43,25 @@ public class FoodController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodVO foodVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法添加食材");
|
||||
}
|
||||
}
|
||||
return foodService.saveVO(foodVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodVO foodVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法修改食材细信息");
|
||||
}
|
||||
}
|
||||
return foodService.updateVO(foodVO);
|
||||
}
|
||||
|
||||
@@ -54,6 +70,13 @@ public class FoodController extends BaseController {
|
||||
if(foodId == null){
|
||||
return error("未指定要删除的食材");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法删除食材");
|
||||
}
|
||||
}
|
||||
boolean flag = foodService.removeById(foodId);
|
||||
return flag ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.edu;
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -39,16 +41,29 @@ public class SupplierController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教育局可增
|
||||
* @param supplierVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SupplierVO supplierVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法添加货商");
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> images = supplierVO.getWxLicenseImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
supplierVO.setLicenseImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
supplierVO.setLicenseImg(null);
|
||||
}
|
||||
images = supplierVO.getWxFoodLicenseImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
supplierVO.setFoodLicenseImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
supplierVO.setFoodLicenseImg(null);
|
||||
}
|
||||
return supplierService.saveVO(supplierVO);
|
||||
}
|
||||
@@ -56,14 +71,25 @@ public class SupplierController extends BaseController {
|
||||
// 接口需要划分:上架,信息编辑.
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) SupplierVO supplierVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法修改供货商信息");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> images = supplierVO.getWxLicenseImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
supplierVO.setLicenseImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
supplierVO.setLicenseImg(null);
|
||||
}
|
||||
images = supplierVO.getWxFoodLicenseImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
supplierVO.setFoodLicenseImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
supplierVO.setFoodLicenseImg(null);
|
||||
}
|
||||
return supplierService.updateVO(supplierVO);
|
||||
}
|
||||
@@ -78,6 +104,13 @@ public class SupplierController extends BaseController {
|
||||
if(supplierVO.getSupplierId() == null){
|
||||
return error("未指定要修改的供货商");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法上下架供货商");
|
||||
}
|
||||
}
|
||||
SupplierVO updateStatus = new SupplierVO();
|
||||
updateStatus.setSupplierId(supplierVO.getSupplierId());
|
||||
updateStatus.setStatus(supplierVO.getStatus());
|
||||
@@ -91,6 +124,10 @@ public class SupplierController extends BaseController {
|
||||
if (supplierId == null) {
|
||||
return error("未指定要删除的供货商");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
return error("非管理员账号无法删除供货商");
|
||||
}
|
||||
boolean flag = supplierService.removeById(supplierId);
|
||||
return flag ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -45,20 +47,38 @@ public class AccompanyMealController extends BaseController {
|
||||
|
||||
@RequestMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) AccompanyMealVO accompanyMealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加陪餐记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = accompanyMealVO.getWxAccompanyImage();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
accompanyMealVO.setAccompanyImage(ArrayStringUtils.wxImgToArray(accompanyMealVO.getWxAccompanyImage()));
|
||||
}else{
|
||||
accompanyMealVO.setAccompanyImage(null);
|
||||
}
|
||||
return accompanyMealService.saveVO(accompanyMealVO);
|
||||
}
|
||||
|
||||
@RequestMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) AccompanyMealVO accompanyMealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改陪餐记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = accompanyMealVO.getWxAccompanyImage();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
accompanyMealVO.setAccompanyImage(ArrayStringUtils.wxImgToArray(accompanyMealVO.getWxAccompanyImage()));
|
||||
}else{
|
||||
accompanyMealVO.setAccompanyImage(null);
|
||||
}
|
||||
return accompanyMealService.updateVO(accompanyMealVO);
|
||||
}
|
||||
@@ -68,6 +88,13 @@ public class AccompanyMealController extends BaseController {
|
||||
if(accompanyMealId == null){
|
||||
return error("请选择要删除的陪餐记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除陪餐记录");
|
||||
}
|
||||
}
|
||||
return accompanyMealService.removeWithId(accompanyMealId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -40,29 +42,66 @@ public class CattenController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 营业执照,食品许可证图片不能为空
|
||||
* @param cattenVO
|
||||
* @return
|
||||
*/
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody CattenVO cattenVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加食堂");
|
||||
}
|
||||
}
|
||||
// 图片校验不能为空
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = cattenVO.getWxLicenseImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
if(CollectionUtils.isEmpty(imageList)){
|
||||
return error("营业执照图片不能为空");
|
||||
}else{
|
||||
cattenVO.setLicenseImg(ArrayStringUtils.wxImgToArray(cattenVO.getWxLicenseImg()));
|
||||
}
|
||||
|
||||
imageList = cattenVO.getWxFoodLicenseImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
if(CollectionUtils.isEmpty(imageList)){
|
||||
return error("食品许可证图片不能为空");
|
||||
}else{
|
||||
cattenVO.setFoodLicenseImg(ArrayStringUtils.wxImgToArray(cattenVO.getWxFoodLicenseImg()));
|
||||
}
|
||||
return cattenService.saveVO(cattenVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 营业执照,食品许可证图片不能为空
|
||||
* @param cattenVO
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody CattenVO cattenVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改食堂信息");
|
||||
}
|
||||
}
|
||||
// 图片校验不能为空
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = cattenVO.getWxLicenseImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
if(CollectionUtils.isEmpty(imageList)){
|
||||
return error("营业执照图片不能为空");
|
||||
}else{
|
||||
cattenVO.setLicenseImg(ArrayStringUtils.wxImgToArray(cattenVO.getWxLicenseImg()));
|
||||
}
|
||||
|
||||
imageList = cattenVO.getWxFoodLicenseImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
if(CollectionUtils.isEmpty(imageList)){
|
||||
return error("食品许可证图片不能为空");
|
||||
}else{
|
||||
cattenVO.setFoodLicenseImg(ArrayStringUtils.wxImgToArray(cattenVO.getWxFoodLicenseImg()));
|
||||
}
|
||||
return cattenService.updateVO(cattenVO);
|
||||
@@ -73,6 +112,13 @@ public class CattenController extends BaseController {
|
||||
if (cattenId == null) {
|
||||
return error("请选择要删除的食堂");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除食堂");
|
||||
}
|
||||
}
|
||||
return cattenService.removeById(cattenId) ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.mysql.cj.xdevapi.Table;
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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.utils.PageUtils;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
@@ -51,11 +53,25 @@ public class DishController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) DishVO dishVO) {
|
||||
return dishService.saveVO(dishVO);
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加菜品信息");
|
||||
}
|
||||
}
|
||||
return dishService.saveVO(dishVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(AddGroup.class) DishVO dishVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改菜品信息");
|
||||
}
|
||||
}
|
||||
return dishService.updateVO(dishVO);
|
||||
}
|
||||
|
||||
@@ -64,6 +80,13 @@ public class DishController extends BaseController {
|
||||
if(dishId == null){
|
||||
return error("未指定要删除的菜品");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除菜品信息");
|
||||
}
|
||||
}
|
||||
boolean flag = dishService.removeById(dishId);
|
||||
return flag ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -41,11 +43,25 @@ public class FoodBookController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodBookVO foodBookVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加菜谱信息");
|
||||
}
|
||||
}
|
||||
return foodBookService.saveVO(foodBookVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodBookVO foodBookVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改菜谱信息");
|
||||
}
|
||||
}
|
||||
return foodBookService.updateVO(foodBookVO);
|
||||
}
|
||||
|
||||
@@ -54,6 +70,13 @@ public class FoodBookController extends BaseController {
|
||||
if(bookId == null){
|
||||
return error("未指定要删除的菜谱");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除菜谱信息");
|
||||
}
|
||||
}
|
||||
return foodBookService.removeWithId(bookId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -43,20 +45,38 @@ public class FoodSampleController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) FoodSampleVO foodSampleVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加留样记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = foodSampleVO.getWxSaveImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
foodSampleVO.setSaveImg(ArrayStringUtils.wxImgToArray(imageList));
|
||||
}else{
|
||||
return error("留样图片不能为空");
|
||||
}
|
||||
return foodSampleService.saveVO(foodSampleVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) FoodSampleVO foodSampleVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改留样记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = foodSampleVO.getWxSaveImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
foodSampleVO.setSaveImg(ArrayStringUtils.wxImgToArray(imageList));
|
||||
}else{
|
||||
return error("留样图片不能为空");
|
||||
}
|
||||
return foodSampleService.updateVO(foodSampleVO);
|
||||
}
|
||||
@@ -66,6 +86,13 @@ public class FoodSampleController extends BaseController {
|
||||
if(sampleId == null){
|
||||
return error("未指定要删除的留样记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除留样记录");
|
||||
}
|
||||
}
|
||||
return foodSampleService.deleteWithId(sampleId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -40,11 +42,25 @@ public class MorningCheckInController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult save(@RequestBody @Validated(AddGroup.class) MorningCheckInVO morningCheckInVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加晨检记录");
|
||||
}
|
||||
}
|
||||
return morningCheckInService.saveVO(morningCheckInVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) MorningCheckInVO morningCheckInVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改晨检记录");
|
||||
}
|
||||
}
|
||||
return morningCheckInService.updateVO(morningCheckInVO);
|
||||
}
|
||||
|
||||
@@ -53,6 +69,13 @@ public class MorningCheckInController extends BaseController {
|
||||
if(checkInId == null){
|
||||
return error("未指定要删除的晨检登记记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除晨检记录");
|
||||
}
|
||||
}
|
||||
return morningCheckInService.removewithId(checkInId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -82,20 +84,38 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated({AddGroup.class}) MorningInspectionDetailVO morningInspectionDetailVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加晨检明细记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> images = morningInspectionDetailVO.getWxAbnormalImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
morningInspectionDetailVO.setAbnormalImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
morningInspectionDetailVO.setAbnormalImg(null);
|
||||
}
|
||||
return morningInspectionDetailService.saveVO(morningInspectionDetailVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated({UpdateGroup.class}) MorningInspectionDetailVO morningInspectionDetailVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改晨检明细记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> images = morningInspectionDetailVO.getWxAbnormalImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
morningInspectionDetailVO.setAbnormalImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
morningInspectionDetailVO.setAbnormalImg(null);
|
||||
}
|
||||
return morningInspectionDetailService.updateVO(morningInspectionDetailVO);
|
||||
}
|
||||
@@ -105,6 +125,13 @@ public class MorningInspectionDetailController extends BaseController {
|
||||
if(morningDetailId == null){
|
||||
return error("未指定要删除的晨检明细");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除晨检明细记录");
|
||||
}
|
||||
}
|
||||
return morningInspectionDetailService.deleteWithId(morningDetailId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -43,20 +45,38 @@ public class RubbishDealController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody RubbishDealVO rubbishDealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加餐余垃圾处理记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = rubbishDealVO.getWxDealImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
rubbishDealVO.setDealImg(ArrayStringUtils.wxImgToArray(rubbishDealVO.getWxDealImg()));
|
||||
}else{
|
||||
rubbishDealVO.setDealImg(null);
|
||||
}
|
||||
return rubbishDealService.saveVO(rubbishDealVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody RubbishDealVO rubbishDealVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改餐余垃圾处理记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = rubbishDealVO.getWxDealImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
rubbishDealVO.setDealImg(ArrayStringUtils.wxImgToArray(rubbishDealVO.getWxDealImg()));
|
||||
}else{
|
||||
rubbishDealVO.setDealImg(null);
|
||||
}
|
||||
return rubbishDealService.updateVO(rubbishDealVO);
|
||||
}
|
||||
@@ -66,6 +86,13 @@ public class RubbishDealController extends BaseController {
|
||||
if(dealId == null){
|
||||
return error("请选择要删除的厨余垃圾处理记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除餐余垃圾处理记录");
|
||||
}
|
||||
}
|
||||
return rubbishDealService.deleteWithId(dealId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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.exception.ServiceException;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
import com.zf.foodpurchase.common.valigroud.UpdateGroup;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISchoolCartItemService;
|
||||
@@ -12,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -33,6 +37,17 @@ public class SchoolCartItemController extends BaseController {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(schoolCartItemVO);
|
||||
//
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
// throw new ServiceException("非学校账号无法查询购物车信息");
|
||||
// 返回空的数据
|
||||
List<SchoolCartItemVO> list = new ArrayList<>();
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
List<SchoolCartItemVO> list = schoolCartItemService.querySchoolCartItemVO(schoolCartItemVO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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.utils.DateUtils;
|
||||
import com.zf.foodpurchase.common.valigroud.AddGroup;
|
||||
@@ -38,6 +40,13 @@ public class SchoolController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SchoolVO schoolVO){
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法添加学校");
|
||||
}
|
||||
}
|
||||
return schoolService.saveVO(schoolVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.OrderStatusConstants;
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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.utils.StringUtils;
|
||||
import com.zf.foodpurchase.fdsafe.service.ISchoolOrderService;
|
||||
@@ -53,6 +55,13 @@ public class SchoolSettleController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/submitSettle")
|
||||
public AjaxResult submitSettle(@RequestBody @Valid SchoolSettleSubmitVO submitVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法发起订单结算");
|
||||
}
|
||||
}
|
||||
return schoolSettleService.submitSettle(submitVO);
|
||||
}
|
||||
|
||||
@@ -61,6 +70,13 @@ public class SchoolSettleController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/checkSettle")
|
||||
public AjaxResult checkSettle(@RequestBody @Valid SchoolSettleCheckVO checkVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法发起订单结算");
|
||||
}
|
||||
}
|
||||
return schoolSettleService.checkSettle(checkVO);
|
||||
}
|
||||
|
||||
@@ -72,6 +88,13 @@ public class SchoolSettleController extends BaseController {
|
||||
if(StringUtils.isEmpty(settleNo)){
|
||||
return AjaxResult.warn("结算单号不能为空");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法更新结算单状态");
|
||||
}
|
||||
}
|
||||
return schoolSettleService.updateSettlePayStatus(settleNo);
|
||||
}
|
||||
|
||||
@@ -83,6 +106,13 @@ public class SchoolSettleController extends BaseController {
|
||||
if(StringUtils.isEmpty(settleNo)){
|
||||
return AjaxResult.warn("结算单号不能为空");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法确认收款");
|
||||
}
|
||||
}
|
||||
return schoolSettleService.updateSettleConfirmStatus(settleNo);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -48,20 +50,38 @@ public class SchoolStaffController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(AddGroup.class) @RequestBody SchoolStaffVO schoolStaffVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加食堂人员");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = schoolStaffVO.getWxHealthCertImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
schoolStaffVO.setHealthCertImg(ArrayStringUtils.wxImgToArray(schoolStaffVO.getWxHealthCertImg()));
|
||||
}else{
|
||||
return error("健康证图片不能为空");
|
||||
}
|
||||
return schoolStaffService.saveVO(schoolStaffVO);
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@Validated(UpdateGroup.class) @RequestBody SchoolStaffVO schoolStaffVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改食堂人员信息");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<WxImg> imageList = schoolStaffVO.getWxHealthCertImg();
|
||||
if(!CollectionUtils.isEmpty(imageList)){
|
||||
schoolStaffVO.setHealthCertImg(ArrayStringUtils.wxImgToArray(schoolStaffVO.getWxHealthCertImg()));
|
||||
}else{
|
||||
return error("健康证图片不能为空");
|
||||
}
|
||||
return schoolStaffService.updateVO(schoolStaffVO);
|
||||
}
|
||||
@@ -71,6 +91,13 @@ public class SchoolStaffController extends BaseController {
|
||||
if (staffId == null) {
|
||||
return error("请选择要删除的学校人员");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除学校人员");
|
||||
}
|
||||
}
|
||||
boolean flag = schoolStaffService.removeById(staffId);
|
||||
return flag ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.school;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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;
|
||||
@@ -44,6 +46,13 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody @Validated(AddGroup.class) SelfInspectionRecordVO selfInspectionRecordVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法添加监督自查记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<SelfInspectionDetailVO> selfInspectionDetailVOList = selfInspectionRecordVO.getSelfInspectionDetailVOList();
|
||||
if(!CollectionUtils.isEmpty(selfInspectionDetailVOList)){
|
||||
@@ -51,6 +60,8 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
List<WxImg> images = selfInspectionDetailVO.getWxAbnormalImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
selfInspectionDetailVO.setAbnormalImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
selfInspectionDetailVO.setAbnormalImg(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,6 +70,13 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
|
||||
@PostMapping("/update")
|
||||
public AjaxResult update(@RequestBody @Validated(UpdateGroup.class) SelfInspectionRecordVO selfInspectionRecordVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法修改监督自查记录");
|
||||
}
|
||||
}
|
||||
// wxImage形式
|
||||
List<SelfInspectionDetailVO> selfInspectionDetailVOList = selfInspectionRecordVO.getSelfInspectionDetailVOList();
|
||||
if(!CollectionUtils.isEmpty(selfInspectionDetailVOList)){
|
||||
@@ -66,6 +84,8 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
List<WxImg> images = selfInspectionDetailVO.getWxAbnormalImg();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
selfInspectionDetailVO.setAbnormalImg(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
selfInspectionDetailVO.setAbnormalImg(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,6 +97,13 @@ public class SelfInspectionRecordController extends BaseController {
|
||||
if(selfRecordId == null){
|
||||
return error("未指定要删除的自检记录");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SCHOOL.equals(accountType)){
|
||||
return error("非学校账号无法删除监督自查记录");
|
||||
}
|
||||
}
|
||||
return selfInspectionRecordService.deleteWithId(selfRecordId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zf.foodpurchase.fdsafe.web.supplier;
|
||||
|
||||
|
||||
import com.zf.foodpurchase.common.constant.WxAPPAccountConstants;
|
||||
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.CheckGroup;
|
||||
@@ -47,6 +49,13 @@ public class FoodProductController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/supplierAdd")
|
||||
public AjaxResult supplierAdd(@RequestBody @Validated(AddGroup.class) FoodProductVO foodProductVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法添加商品");
|
||||
}
|
||||
}
|
||||
return foodProductService.supplierAdd(foodProductVO);
|
||||
}
|
||||
|
||||
@@ -55,6 +64,13 @@ public class FoodProductController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/supplierUpdate")
|
||||
public AjaxResult supplierUpdate(@RequestBody @Validated(UpdateGroup.class) FoodProductVO foodProductVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法修改商品");
|
||||
}
|
||||
}
|
||||
return foodProductService.supplierUpdate(foodProductVO);
|
||||
}
|
||||
|
||||
@@ -63,6 +79,13 @@ public class FoodProductController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/eduCheck")
|
||||
public AjaxResult eduCheck(@RequestBody @Validated(CheckGroup.class) FoodProductVO foodProductVO) {
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.EDU.equals(accountType)){
|
||||
return error("非教育局账号无法审核商品");
|
||||
}
|
||||
}
|
||||
return foodProductService.eduCheck(foodProductVO);
|
||||
}
|
||||
|
||||
@@ -74,6 +97,13 @@ public class FoodProductController extends BaseController {
|
||||
if(foodProductId == null){
|
||||
return error("商品id不能为空");
|
||||
}
|
||||
SysUser user = getLoginUser().getUser();
|
||||
if(!user.isAdmin()){
|
||||
Integer accountType =getLoginUser().getUser().getAccountType();
|
||||
if(!WxAPPAccountConstants.SUPPLIER.equals(accountType)){
|
||||
return error("非供货商账号无法删除商品");
|
||||
}
|
||||
}
|
||||
return foodProductService.removeById(foodProductId) ? success("删除成功") : error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public class SupplierDeliveryItemController extends BaseController {
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo pageList(SupplierDeliveryItemVO supplierDeliveryItemVO) {
|
||||
startPage();
|
||||
// 填充学校id,教育局id等数据
|
||||
dealCommonVO(supplierDeliveryItemVO);
|
||||
List<SupplierDeliveryItemVO> list = supplierDeliveryItemService.querySupplierDeliveryItemVO(supplierDeliveryItemVO);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
list.forEach(item -> {
|
||||
@@ -65,6 +67,8 @@ public class SupplierDeliveryItemController extends BaseController {
|
||||
List<WxImg> images = supplierDeliveryItemUpdateVO.getWxCheckReportImage();
|
||||
if(!CollectionUtils.isEmpty( images)){
|
||||
supplierDeliveryItemUpdateVO.setCheckReportImage(ArrayStringUtils.wxImgToArray(images));
|
||||
}else{
|
||||
supplierDeliveryItemUpdateVO.setCheckReportImage(null);
|
||||
}
|
||||
return supplierDeliveryItemService.updateVO(supplierDeliveryItemUpdateVO);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.zf.foodpurchase.common.utils.ServletUtils;
|
||||
|
||||
/**
|
||||
* 表格数据处理
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TableSupport
|
||||
@@ -40,9 +40,10 @@ public class TableSupport
|
||||
*/
|
||||
public static PageDomain getPageDomain()
|
||||
{
|
||||
// 如果没有传分页参数,增大默认分页大小
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1));
|
||||
pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10));
|
||||
pageDomain.setPageSize(Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 100000));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
|
||||
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.exc.InvalidFormatException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.HttpMessage;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
@@ -24,6 +25,8 @@ import com.zf.foodpurchase.common.exception.ServiceException;
|
||||
import com.zf.foodpurchase.common.utils.StringUtils;
|
||||
import com.zf.foodpurchase.common.utils.html.EscapeUtil;
|
||||
|
||||
import java.sql.DataTruncation;
|
||||
|
||||
/**
|
||||
* 全局异常处理器
|
||||
*
|
||||
@@ -34,6 +37,31 @@ public class GlobalExceptionHandler
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(GlobalExceptionHandler.class);
|
||||
|
||||
/**
|
||||
* JSON入参序列化异常HttpMessageNotReadableException
|
||||
*/
|
||||
/**
|
||||
* 权限校验异常
|
||||
*/
|
||||
@ExceptionHandler(HttpMessageNotReadableException.class)
|
||||
public AjaxResult handleHttpMessageNotReadableException(HttpMessageNotReadableException e, HttpServletRequest request)
|
||||
{
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',JSON入参序列化异常'{}'", requestURI, e.getMessage());
|
||||
return AjaxResult.error(HttpStatus.ERROR, "系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库异常处理:DataTruncation
|
||||
*/
|
||||
@ExceptionHandler(DataIntegrityViolationException.class)
|
||||
public AjaxResult handleDataIntegrityViolationException(DataIntegrityViolationException e, HttpServletRequest request)
|
||||
{
|
||||
String requestURI = request.getRequestURI();
|
||||
log.error("请求地址'{}',数据库异常'{}'", requestURI, e.getMessage());
|
||||
return AjaxResult.error(HttpStatus.ERROR, "系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限校验异常
|
||||
*/
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -85,8 +83,9 @@ public class AccompanyMeal implements Serializable {
|
||||
private String feedBack;
|
||||
|
||||
/**
|
||||
* 陪餐照片
|
||||
* 陪餐照片: 为空时也会进行更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String accompanyImage;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -56,8 +54,9 @@ public class MorningInspectionDetail implements Serializable {
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 问题照片
|
||||
* 问题照片:为null也修改
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String abnormalImg;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -64,8 +62,9 @@ public class RubbishDeal implements Serializable {
|
||||
private String recycleCompany;
|
||||
|
||||
/**
|
||||
* 回收图片
|
||||
* 回收图片,为空时也会更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String dealImg;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -53,8 +51,9 @@ public class SelfInspectionDetail implements Serializable {
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 问题图片
|
||||
* 问题图片:为null也更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String abnormalImg;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -64,13 +62,15 @@ public class Supplier implements Serializable {
|
||||
private String concatPhone;
|
||||
|
||||
/**
|
||||
* 营业执照照片
|
||||
* 营业执照照片:为null也进行更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String licenseImg;
|
||||
|
||||
/**
|
||||
* 食品经营许可证照片
|
||||
* 食品经营许可证照片:为null也进行更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String foodLicenseImg;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.zf.foodpurchase.fdsafe.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -64,8 +62,9 @@ public class SupplierDeliveryItem implements Serializable {
|
||||
private String inImage;
|
||||
|
||||
/**
|
||||
* 检测报告图片
|
||||
* 检测报告图片:为null时也进行更新
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private String checkReportImage;
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,7 +136,7 @@ public class FoodBookServiceImpl extends ServiceImpl<FoodBookMapper, FoodBook> i
|
||||
foodBookVO.setDishIdList(dishIdList);
|
||||
LambdaQueryWrapper<Dish> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(Dish::getDishId, split);
|
||||
queryWrapper.last("or del_flag = 1");
|
||||
queryWrapper.last("or (del_flag = 1 and dish_id in ("+ids+"))" );
|
||||
List<Dish> dishList = dishService.list(queryWrapper);
|
||||
String names = dishList.stream().map(Dish::getDishName).reduce((a, b) -> a + "," + b).get();
|
||||
foodBookVO.setDishNames(names);
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.zf.foodpurchase.fdsafe.utils.NoUtils;
|
||||
import com.zf.foodpurchase.fdsafe.vo.RefundItemAddUpdateVO;
|
||||
import com.zf.foodpurchase.fdsafe.vo.SchoolRefundItemVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -100,6 +101,10 @@ public class SchoolRefundItemServiceImpl extends ServiceImpl<SchoolRefundItemMap
|
||||
} else {
|
||||
schoolRefund = schoolRefunds.get(0);
|
||||
}
|
||||
String refundReason = refundItemAddUpdateVO.getRefundItemRemark();
|
||||
if(StringUtils.isNotBlank(refundReason)){
|
||||
schoolRefund.setRefundReason(refundReason);
|
||||
}
|
||||
// 构建子退货单
|
||||
SchoolRefundItem refundItem = new SchoolRefundItem();
|
||||
// 子订单号,退款原因,退款数量
|
||||
@@ -272,7 +277,10 @@ public class SchoolRefundItemServiceImpl extends ServiceImpl<SchoolRefundItemMap
|
||||
SchoolRefund updateSchoolRefund = new SchoolRefund();
|
||||
updateSchoolRefund.setRefundNo(schoolRefund.getRefundNo());
|
||||
updateSchoolRefund.setTotalRefundMoney(schoolRefund.getTotalRefundMoney().add(diffMoney));
|
||||
|
||||
String refundReason = refundItemAddUpdateVO.getRefundItemRemark();
|
||||
if(StringUtils.isNotBlank(refundReason)){
|
||||
updateSchoolRefund.setRefundReason(refundReason);
|
||||
}
|
||||
|
||||
// 数据更新
|
||||
String msg = "更新失败,请稍后重试";
|
||||
|
||||
@@ -21,7 +21,7 @@ public class RefundItemAddUpdateVO extends CommonVO implements Serializable {
|
||||
@NotBlank(message = "子退款号不能为空", groups = {UpdateGroup.class})
|
||||
private String refundItemNo;
|
||||
|
||||
@NotBlank(message = "子订单号", groups = {AddGroup.class})
|
||||
@NotBlank(message = "子订单号不能为空", groups = {AddGroup.class})
|
||||
private String orderItemNo;
|
||||
|
||||
@NotBlank(message = "退款项原因不能为空", groups = {AddGroup.class, UpdateGroup.class})
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SupplierVO extends CommonVO implements Serializable {
|
||||
* 联系电话
|
||||
*/
|
||||
@NotBlank(message = "联系电话不能为空", groups = {UpdateGroup.class, AddGroup.class})
|
||||
@Phone(message = "联系电话格式不正确")
|
||||
@Phone(message = "联系电话格式不正确", groups = {UpdateGroup.class, AddGroup.class})
|
||||
private String concatPhone;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<select id="queryDishVO" resultType="com.zf.foodpurchase.fdsafe.vo.DishVO"
|
||||
parameterType="com.zf.foodpurchase.fdsafe.vo.DishVO">
|
||||
select <include refid="Base_Column_List"/>,
|
||||
s.school_name
|
||||
s.school_name,ed.edu_id
|
||||
from dish dh left join school s on dh.school_id = s.school_id
|
||||
left join edu ed on ed.edu_id = s.edu_id
|
||||
<where>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<if test="eduId != null">
|
||||
and sl.edu_id = #{eduId}
|
||||
</if>
|
||||
<if test="checkResult != null and checkResult != ''">
|
||||
<if test="checkResult != null ">
|
||||
and sl.check_result = #{checkResult}
|
||||
</if>
|
||||
<if test="checkPerson != null and checkPerson != ''">
|
||||
|
||||
Reference in New Issue
Block a user