From 0dd5bc89929392f1f66d4c4fbcab5be311d036e8 Mon Sep 17 00:00:00 2001 From: yeqifu <1784525940@qq.com> Date: Sat, 7 Mar 2020 16:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E5=AE=A2=E6=88=B7=EF=BC=8C=E5=95=86=E5=93=81=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=92=8C=E5=95=86=E5=93=81=E9=94=80=E5=94=AE=E9=80=80?= =?UTF-8?q?=E8=B4=A7=E5=87=BA=E7=8E=B0=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bus/controller/CustomerController.java | 3 +- .../bus/controller/GoodsController.java | 9 +++-- .../bus/controller/ProviderController.java | 29 ++------------ .../bus/controller/SalesbackController.java | 2 +- .../com/yeqifu/bus/mapper/GoodsMapper.java | 39 +++++++++++++++++- .../com/yeqifu/bus/mapper/ProviderMapper.java | 20 ++++++++++ .../yeqifu/bus/service/ICustomerService.java | 5 +++ .../com/yeqifu/bus/service/IGoodsService.java | 5 +++ .../yeqifu/bus/service/IProviderService.java | 5 +++ .../bus/service/impl/CustomerServiceImpl.java | 17 ++++++++ .../bus/service/impl/GoodsServiceImpl.java | 14 +++++++ .../bus/service/impl/ProviderServiceImpl.java | 40 +++++++++++++++++-- .../java/com/yeqifu/sys/cache/CachePool.java | 1 - .../com/yeqifu/sys/common/AppFileUtils.java | 10 ++--- .../java/com/yeqifu/sys/common/Constast.java | 2 +- .../java/com/yeqifu/sys/common/ResultObj.java | 1 + .../sys/controller/PermissionController.java | 4 +- .../yeqifu/sys/controller/UserController.java | 26 ++++++------ .../sys/service/impl/RoleServiceImpl.java | 10 +++-- .../sys/service/impl/UserServiceImpl.java | 2 +- src/main/resources/mapper/bus/GoodsMapper.xml | 31 ++++++++++++++ .../mapper/bus}/OutportMapper.xml | 0 .../resources/mapper/bus/ProviderMapper.xml | 16 ++++++++ .../mapper/bus}/SalesMapper.xml | 0 .../mapper/bus}/SalesbackMapper.xml | 0 .../business/goods/goodsManager.html | 2 +- .../business/provider/providerManager.html | 38 +----------------- .../business/sales/salesManager.html | 4 +- .../system/permission/permissionRight.html | 2 +- .../templates/system/role/roleManager.html | 4 +- .../templates/system/user/userManager.html | 2 +- 31 files changed, 239 insertions(+), 104 deletions(-) rename src/main/{java/com/yeqifu/bus/mapper/xml => resources/mapper/bus}/OutportMapper.xml (100%) rename src/main/{java/com/yeqifu/bus/mapper/xml => resources/mapper/bus}/SalesMapper.xml (100%) rename src/main/{java/com/yeqifu/bus/mapper/xml => resources/mapper/bus}/SalesbackMapper.xml (100%) diff --git a/src/main/java/com/yeqifu/bus/controller/CustomerController.java b/src/main/java/com/yeqifu/bus/controller/CustomerController.java index 286f614..d70d9e9 100644 --- a/src/main/java/com/yeqifu/bus/controller/CustomerController.java +++ b/src/main/java/com/yeqifu/bus/controller/CustomerController.java @@ -93,7 +93,8 @@ public class CustomerController { @RequestMapping("deleteCustomer") public ResultObj deleteCustomer(Integer id){ try { - customerService.removeById(id); +// customerService.removeById(id); + customerService.deleteCustomerById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/yeqifu/bus/controller/GoodsController.java b/src/main/java/com/yeqifu/bus/controller/GoodsController.java index 74874af..4934a88 100644 --- a/src/main/java/com/yeqifu/bus/controller/GoodsController.java +++ b/src/main/java/com/yeqifu/bus/controller/GoodsController.java @@ -45,8 +45,8 @@ public class GoodsController { */ @RequestMapping("loadAllGoods") public DataGridView loadAllGoods(GoodsVo goodsVo){ - IPage page = new Page<>(goodsVo.getPage(),goodsVo.getLimit()); - QueryWrapper queryWrapper = new QueryWrapper(); + IPage page = new Page(goodsVo.getPage(),goodsVo.getLimit()); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq(goodsVo.getProviderid()!=null&&goodsVo.getProviderid()!=0,"providerid",goodsVo.getProviderid()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getGoodsname()),"goodsname",goodsVo.getGoodsname()); queryWrapper.like(StringUtils.isNotBlank(goodsVo.getProductcode()),"productcode",goodsVo.getProductcode()); @@ -113,7 +113,7 @@ public class GoodsController { /** * 删除商品 - * @param id + * @param id 商品id * @return */ @RequestMapping("deleteGoods") @@ -121,7 +121,8 @@ public class GoodsController { try { //删除商品的图片 AppFileUtils.removeFileByPath(goodsimg); - goodsService.removeById(id); +// goodsService.removeById(id); + goodsService.deleteGoodsById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/com/yeqifu/bus/controller/ProviderController.java b/src/main/java/com/yeqifu/bus/controller/ProviderController.java index 60d4de4..22c03cb 100644 --- a/src/main/java/com/yeqifu/bus/controller/ProviderController.java +++ b/src/main/java/com/yeqifu/bus/controller/ProviderController.java @@ -15,9 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; import java.util.List; /** @@ -85,15 +82,16 @@ public class ProviderController { } } + /** * 删除一个供应商 - * @param id 供应商的ID + * @param id * @return */ @RequestMapping("deleteProvider") public ResultObj deleteProvider(Integer id){ try { - providerService.removeById(id); + providerService.deleteProviderById(id); return ResultObj.DELETE_SUCCESS; } catch (Exception e) { e.printStackTrace(); @@ -101,25 +99,6 @@ public class ProviderController { } } - /** - * 批量删除供应商 - * @param providerVo 选中的供应商 - * @return - */ - @RequestMapping("batchDeleteProvider") - public ResultObj batchDeleteProvider(ProviderVo providerVo){ - try { - Collection idList = new ArrayList(); - for (Integer id : providerVo.getIds()) { - idList.add(id); - } - providerService.removeByIds(idList); - return ResultObj.DELETE_SUCCESS; - } catch (Exception e) { - e.printStackTrace(); - return ResultObj.DELETE_ERROR; - } - } /** * 加载所有可用的供应商 @@ -127,7 +106,7 @@ public class ProviderController { */ @RequestMapping("loadAllProviderForSelect") public DataGridView loadAllProviderForSelect(){ - QueryWrapper queryWrapper = new QueryWrapper(); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("available", Constast.AVAILABLE_TRUE); List list = providerService.list(queryWrapper); return new DataGridView(list); diff --git a/src/main/java/com/yeqifu/bus/controller/SalesbackController.java b/src/main/java/com/yeqifu/bus/controller/SalesbackController.java index 3af7648..05a1e77 100644 --- a/src/main/java/com/yeqifu/bus/controller/SalesbackController.java +++ b/src/main/java/com/yeqifu/bus/controller/SalesbackController.java @@ -58,7 +58,7 @@ public class SalesbackController { } } - /**t + /** * 查询商品销售退货 * @param salesbackVo * @return diff --git a/src/main/java/com/yeqifu/bus/mapper/GoodsMapper.java b/src/main/java/com/yeqifu/bus/mapper/GoodsMapper.java index a532af0..f6dbaab 100644 --- a/src/main/java/com/yeqifu/bus/mapper/GoodsMapper.java +++ b/src/main/java/com/yeqifu/bus/mapper/GoodsMapper.java @@ -1,7 +1,8 @@ package com.yeqifu.bus.mapper; -import com.yeqifu.bus.entity.Goods; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yeqifu.bus.entity.Goods; +import org.apache.ibatis.annotations.Param; /** *

@@ -13,4 +14,40 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface GoodsMapper extends BaseMapper { + /** + * 根据商品id删除商品销售信息 + * @param id1 + */ + void deleteSaleByGoodsId(@Param("goodsid") Integer id1); + + /** + * 根据商品id删除商品销售退货信息 + * @param id1 + */ + void deleteSaleBackByGoodsId(@Param("goodsid") Integer id1); + + /** + * 根据商品id删除商品进货信息 + * @param id + */ + void deleteInportByGoodsId(@Param("goodsid") Integer id); + + + /** + * 根据商品id删除商品退货信息 + * @param id + */ + void deleteOutportByGoodsId(@Param("goodsid") Integer id); + + /** + * 根据客户id删除商品销售 + * @param id 客户id + */ + void deleteSaleByCustomerId(Integer id); + + /** + * 根据客户id删除商品销售退货信息 + * @param id 客户id + */ + void deleteSaleBackByCustomerId(Integer id); } diff --git a/src/main/java/com/yeqifu/bus/mapper/ProviderMapper.java b/src/main/java/com/yeqifu/bus/mapper/ProviderMapper.java index 4c22ba9..b0f52b9 100644 --- a/src/main/java/com/yeqifu/bus/mapper/ProviderMapper.java +++ b/src/main/java/com/yeqifu/bus/mapper/ProviderMapper.java @@ -2,6 +2,7 @@ package com.yeqifu.bus.mapper; import com.yeqifu.bus.entity.Provider; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; /** *

@@ -13,4 +14,23 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface ProviderMapper extends BaseMapper { + /** + * 根据供应商id删除商品信息 + * @param id + */ + void deleteGoodsByProviderId(@Param("pid") Integer id); + + /** + * 根据供应商id删除商品进货信息 + * @param id + */ + void deleteInportByProviderId(@Param("pid") Integer id); + + /** + * 根据供应商id删除商品退货信息 + * @param id + */ + void deleteOutPortByProviderId(@Param("pid") Integer id); + + } diff --git a/src/main/java/com/yeqifu/bus/service/ICustomerService.java b/src/main/java/com/yeqifu/bus/service/ICustomerService.java index b5b9963..ea5614d 100644 --- a/src/main/java/com/yeqifu/bus/service/ICustomerService.java +++ b/src/main/java/com/yeqifu/bus/service/ICustomerService.java @@ -13,4 +13,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface ICustomerService extends IService { + /** + * 根据客户id删除客户 + * @param id 客户id + */ + void deleteCustomerById(Integer id); } diff --git a/src/main/java/com/yeqifu/bus/service/IGoodsService.java b/src/main/java/com/yeqifu/bus/service/IGoodsService.java index 8f0eb8e..497a08b 100644 --- a/src/main/java/com/yeqifu/bus/service/IGoodsService.java +++ b/src/main/java/com/yeqifu/bus/service/IGoodsService.java @@ -13,4 +13,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IGoodsService extends IService { + /** + * 根据商品id删除商品 + * @param id + */ + void deleteGoodsById(Integer id); } diff --git a/src/main/java/com/yeqifu/bus/service/IProviderService.java b/src/main/java/com/yeqifu/bus/service/IProviderService.java index 38c4390..9433a09 100644 --- a/src/main/java/com/yeqifu/bus/service/IProviderService.java +++ b/src/main/java/com/yeqifu/bus/service/IProviderService.java @@ -13,4 +13,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IProviderService extends IService { + /** + * 根据供应商ID删除供应商 + * @param id + */ + void deleteProviderById(Integer id); } diff --git a/src/main/java/com/yeqifu/bus/service/impl/CustomerServiceImpl.java b/src/main/java/com/yeqifu/bus/service/impl/CustomerServiceImpl.java index 391d797..70f290f 100644 --- a/src/main/java/com/yeqifu/bus/service/impl/CustomerServiceImpl.java +++ b/src/main/java/com/yeqifu/bus/service/impl/CustomerServiceImpl.java @@ -2,8 +2,10 @@ package com.yeqifu.bus.service.impl; import com.yeqifu.bus.entity.Customer; import com.yeqifu.bus.mapper.CustomerMapper; +import com.yeqifu.bus.mapper.GoodsMapper; import com.yeqifu.bus.service.ICustomerService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -22,6 +24,9 @@ import java.util.Collection; @Transactional public class CustomerServiceImpl extends ServiceImpl implements ICustomerService { + @Autowired + private GoodsMapper goodsMapper; + @Override public boolean save(Customer entity) { return super.save(entity); @@ -46,4 +51,16 @@ public class CustomerServiceImpl extends ServiceImpl i return super.removeByIds(idList); } + /** + * 根据客户id删除客户 + * @param id 客户id + */ + @Override + public void deleteCustomerById(Integer id) { + //根据客户id删除商品销售 + goodsMapper.deleteSaleByCustomerId(id); + //根据客户id删除商品销售退货 + goodsMapper.deleteSaleBackByCustomerId(id); + this.removeById(id); + } } diff --git a/src/main/java/com/yeqifu/bus/service/impl/GoodsServiceImpl.java b/src/main/java/com/yeqifu/bus/service/impl/GoodsServiceImpl.java index 24d9a57..56c702d 100644 --- a/src/main/java/com/yeqifu/bus/service/impl/GoodsServiceImpl.java +++ b/src/main/java/com/yeqifu/bus/service/impl/GoodsServiceImpl.java @@ -40,4 +40,18 @@ public class GoodsServiceImpl extends ServiceImpl implements public Goods getById(Serializable id) { return super.getById(id); } + + @Override + public void deleteGoodsById(Integer id) { + //根据商品id删除商品销售信息 + this.getBaseMapper().deleteSaleByGoodsId(id); + //根据商品id删除商品销售退货信息 + this.getBaseMapper().deleteSaleBackByGoodsId(id); + //根据商品id删除商品进货信息 + this.getBaseMapper().deleteInportByGoodsId(id); + //根据商品id删除商品退货信息 + this.getBaseMapper().deleteOutportByGoodsId(id); + //删除商品信息 + this.removeById(id); + } } diff --git a/src/main/java/com/yeqifu/bus/service/impl/ProviderServiceImpl.java b/src/main/java/com/yeqifu/bus/service/impl/ProviderServiceImpl.java index 0491bcc..5eedfaa 100644 --- a/src/main/java/com/yeqifu/bus/service/impl/ProviderServiceImpl.java +++ b/src/main/java/com/yeqifu/bus/service/impl/ProviderServiceImpl.java @@ -1,15 +1,19 @@ package com.yeqifu.bus.service.impl; -import com.yeqifu.bus.entity.Customer; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.yeqifu.bus.entity.Goods; import com.yeqifu.bus.entity.Provider; +import com.yeqifu.bus.mapper.GoodsMapper; import com.yeqifu.bus.mapper.ProviderMapper; import com.yeqifu.bus.service.IProviderService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.io.Serializable; import java.util.Collection; +import java.util.List; /** *

@@ -23,6 +27,9 @@ import java.util.Collection; @Transactional public class ProviderServiceImpl extends ServiceImpl implements IProviderService { + @Autowired + private GoodsMapper goodsMapper; + @Override public boolean save(Provider entity) { return super.save(entity); @@ -46,5 +53,32 @@ public class ProviderServiceImpl extends ServiceImpl i public boolean removeByIds(Collection idList) { return super.removeByIds(idList); } - + + /** + * 根据供应商id删除供应商 + * @param id 供应商id + */ + @Override + public void deleteProviderById(Integer id) { + //根据供应商id查询出商品id + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("providerid",id); + List goods = goodsMapper.selectList(queryWrapper); + for (Goods good : goods) { + //获取一个商品id + Integer id1 = good.getId(); + //根据商品id删除商品销售信息 + goodsMapper.deleteSaleByGoodsId(id1); + //根据商品id删除商品销售退货信息 + goodsMapper.deleteSaleBackByGoodsId(id1); + } + //根据供应商id删除商品退货信息 + this.getBaseMapper().deleteOutPortByProviderId(id); + //根据供应商id删除商品进货信息 + this.getBaseMapper().deleteInportByProviderId(id); + //根据供应商id删除商品 + this.getBaseMapper().deleteGoodsByProviderId(id); + //删除供应商 + this.removeById(id); + } } diff --git a/src/main/java/com/yeqifu/sys/cache/CachePool.java b/src/main/java/com/yeqifu/sys/cache/CachePool.java index 133b098..4cdd348 100644 --- a/src/main/java/com/yeqifu/sys/cache/CachePool.java +++ b/src/main/java/com/yeqifu/sys/cache/CachePool.java @@ -82,7 +82,6 @@ public class CachePool { CACHE_CONTAINER.put("goods:"+goods.getId(),goods); } - } diff --git a/src/main/java/com/yeqifu/sys/common/AppFileUtils.java b/src/main/java/com/yeqifu/sys/common/AppFileUtils.java index de5c0c1..a96c51e 100644 --- a/src/main/java/com/yeqifu/sys/common/AppFileUtils.java +++ b/src/main/java/com/yeqifu/sys/common/AppFileUtils.java @@ -24,7 +24,7 @@ public class AppFileUtils { public static String UPLOAD_PATH="G:/upload/"; static { - //读取配置文件的存储地址 + //通过反射的方式,读取配置文件的存储地址 InputStream stream = AppFileUtils.class.getClassLoader().getResourceAsStream("file.properties"); Properties properties=new Properties(); try { @@ -79,12 +79,12 @@ public class AppFileUtils { /** * 更该图片的名字 去掉_temp - * @param goodsimg + * @param goodsImg * @return */ - public static String renameFile(String goodsimg) { - File file = new File(UPLOAD_PATH,goodsimg); - String replace = goodsimg.replace("_temp",""); + public static String renameFile(String goodsImg) { + File file = new File(UPLOAD_PATH,goodsImg); + String replace = goodsImg.replace("_temp",""); if (file.exists()){ file.renameTo(new File(UPLOAD_PATH,replace)); } diff --git a/src/main/java/com/yeqifu/sys/common/Constast.java b/src/main/java/com/yeqifu/sys/common/Constast.java index 1aa1163..f1b6766 100644 --- a/src/main/java/com/yeqifu/sys/common/Constast.java +++ b/src/main/java/com/yeqifu/sys/common/Constast.java @@ -54,5 +54,5 @@ public class Constast { /** * 用户默认图片 */ - public static final String DEFAULT_IMG_USER="/images/defaultusertitle.jpg"; + public static final String DEFAULT_IMG_USER="/images/defaultUserTitle.jpg"; } diff --git a/src/main/java/com/yeqifu/sys/common/ResultObj.java b/src/main/java/com/yeqifu/sys/common/ResultObj.java index 1961bf0..44bbc4a 100644 --- a/src/main/java/com/yeqifu/sys/common/ResultObj.java +++ b/src/main/java/com/yeqifu/sys/common/ResultObj.java @@ -41,5 +41,6 @@ public class ResultObj { public static final ResultObj DELETE_ERROR_NEWS = new ResultObj(Constast.ERROR,"删除用户失败,该用户是其他用户的直属领导,请先修改该用户的下属的直属领导,再进行删除操作"); public static final ResultObj DELETE_QUERY = new ResultObj(); + } diff --git a/src/main/java/com/yeqifu/sys/controller/PermissionController.java b/src/main/java/com/yeqifu/sys/controller/PermissionController.java index eabba3b..c09f76b 100644 --- a/src/main/java/com/yeqifu/sys/controller/PermissionController.java +++ b/src/main/java/com/yeqifu/sys/controller/PermissionController.java @@ -44,11 +44,11 @@ public class PermissionController { */ @RequestMapping("loadPermissionManagerLeftTreeJson") public DataGridView loadPermissionManagerLeftTreeJson(PermissionVo permissionVo){ - QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("type", Constast.TYPE_MENU); //查询出所有的权限,存放进list中 List list = permissionService.list(queryWrapper); - List treeNodes = new ArrayList<>(); + List treeNodes = new ArrayList(); //将权限放入treeNodes中,组装成json for (Permission permission : list) { Boolean open = permission.getOpen()==1?true:false; diff --git a/src/main/java/com/yeqifu/sys/controller/UserController.java b/src/main/java/com/yeqifu/sys/controller/UserController.java index efaf688..c6918ea 100644 --- a/src/main/java/com/yeqifu/sys/controller/UserController.java +++ b/src/main/java/com/yeqifu/sys/controller/UserController.java @@ -54,25 +54,27 @@ public class UserController { public DataGridView loadAllUser(UserVo userVo){ IPage page = new Page(userVo.getPage(),userVo.getLimit()); QueryWrapper queryWrapper = new QueryWrapper(); - queryWrapper.eq(StringUtils.isNotBlank(userVo.getName()),"loginname",userVo.getName()).or().eq(StringUtils.isNotBlank(userVo.getName()),"name",userVo.getName()); - queryWrapper.eq(StringUtils.isNotBlank(userVo.getAddress()),"address",userVo.getAddress()); + //根据用户登录名称以及用户名称模糊查询用户 + queryWrapper.like(StringUtils.isNotBlank(userVo.getName()),"loginname",userVo.getName()).or().eq(StringUtils.isNotBlank(userVo.getName()),"name",userVo.getName()); + queryWrapper.like(StringUtils.isNotBlank(userVo.getAddress()),"address",userVo.getAddress()); //查询系统用户 queryWrapper.eq("type", Constast.USER_TYPE_NORMAL); queryWrapper.eq(userVo.getDeptid()!=null,"deptid",userVo.getDeptid()); + queryWrapper.orderByDesc("id"); userService.page(page,queryWrapper); //将所有用户数据放入list中 List list = page.getRecords(); for (User user : list) { - Integer deptid = user.getDeptid(); - if (deptid!=null){ + Integer deptId = user.getDeptid(); + if (deptId!=null){ //先从缓存中去取,如果缓存中没有就去数据库中取 - Dept one = deptService.getById(deptid); + Dept one = deptService.getById(deptId); //设置user的部门名称 user.setDeptname(one.getName()); } Integer mgr = user.getMgr(); - if (mgr!=null){ + if (mgr!=null&&mgr!=0){ User one = userService.getById(mgr); //设置user的领导名称 user.setLeadername(one.getName()); @@ -88,7 +90,7 @@ public class UserController { @RequestMapping("loadUserMaxOrderNum") public Map loadUserMaxOrderNum(){ Map map = new HashMap(); - QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.orderByDesc("ordernum"); IPage page = new Page<>(1,1); List list = userService.page(page,queryWrapper).getRecords(); @@ -102,13 +104,13 @@ public class UserController { /** * 根据部门ID查询用户 - * @param deptid + * @param deptId * @return */ @RequestMapping("loadUsersByDeptId") - public DataGridView loadUsersByDeptIp(Integer deptid){ - QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(deptid!=null,"deptid",deptid); + public DataGridView loadUsersByDeptIp(Integer deptId){ + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq(deptId!=null,"deptid",deptId); queryWrapper.eq("available",Constast.AVAILABLE_TRUE); queryWrapper.eq("type",Constast.USER_TYPE_NORMAL); List list = userService.list(queryWrapper); @@ -122,7 +124,7 @@ public class UserController { */ @RequestMapping("changeChineseToPinyin") public Map changeChineseToPinyin(String username){ - Map map = new HashMap<>(); + Map map = new HashMap(16); if (null!=username){ map.put("value", PinyinUtils.getPingYin(username)); }else { diff --git a/src/main/java/com/yeqifu/sys/service/impl/RoleServiceImpl.java b/src/main/java/com/yeqifu/sys/service/impl/RoleServiceImpl.java index c420665..aeca8c5 100644 --- a/src/main/java/com/yeqifu/sys/service/impl/RoleServiceImpl.java +++ b/src/main/java/com/yeqifu/sys/service/impl/RoleServiceImpl.java @@ -22,6 +22,11 @@ import java.util.List; @Transactional public class RoleServiceImpl extends ServiceImpl implements IRoleService { + /** + * 删除角色时同时删除sys_user_role表和sys_role_permission表中的数据 + * @param id 角色id + * @return + */ @Override public boolean removeById(Serializable id) { //根据角色ID删除sys_role_permission表中的数据 @@ -33,7 +38,7 @@ public class RoleServiceImpl extends ServiceImpl implements IR /** * 根据角色ID查询当前角色拥有的菜单ID和权限ID - * @param roleId + * @param roleId 角色id * @return */ @Override @@ -60,12 +65,11 @@ public class RoleServiceImpl extends ServiceImpl implements IR /** * 查询当前用户拥有的角色ID集合 - * @param id + * @param id 角色id * @return */ @Override public List queryUserRoleIdsByUid(Integer id) { return getBaseMapper().queryUserRoleIdsByUid(id); - } } diff --git a/src/main/java/com/yeqifu/sys/service/impl/UserServiceImpl.java b/src/main/java/com/yeqifu/sys/service/impl/UserServiceImpl.java index a53a936..1784a58 100644 --- a/src/main/java/com/yeqifu/sys/service/impl/UserServiceImpl.java +++ b/src/main/java/com/yeqifu/sys/service/impl/UserServiceImpl.java @@ -78,7 +78,7 @@ public class UserServiceImpl extends ServiceImpl implements IU */ @Override public Boolean queryMgrByUserId(Integer userId) { - QueryWrapper queryWrapper = new QueryWrapper<>(); + QueryWrapper queryWrapper = new QueryWrapper(); queryWrapper.eq("mgr",userId); List users = userMapper.selectList(queryWrapper); if (null!=users&&users.size()>0){ diff --git a/src/main/resources/mapper/bus/GoodsMapper.xml b/src/main/resources/mapper/bus/GoodsMapper.xml index 5e61ced..78ec66b 100644 --- a/src/main/resources/mapper/bus/GoodsMapper.xml +++ b/src/main/resources/mapper/bus/GoodsMapper.xml @@ -2,4 +2,35 @@ + + + delete from bus_sales where goodsid = #{goodsid} + + + + + delete from bus_salesback where goodsid = #{goodsid} + + + + + delete from bus_inport where goodsid = #{goodsid} + + + + + delete from bus_outport where goodsid = #{goodsid} + + + + + delete from bus_sales where customerid = #{customerid} + + + + + delete from bus_salesback where customerid = #{customerid} + + + diff --git a/src/main/java/com/yeqifu/bus/mapper/xml/OutportMapper.xml b/src/main/resources/mapper/bus/OutportMapper.xml similarity index 100% rename from src/main/java/com/yeqifu/bus/mapper/xml/OutportMapper.xml rename to src/main/resources/mapper/bus/OutportMapper.xml diff --git a/src/main/resources/mapper/bus/ProviderMapper.xml b/src/main/resources/mapper/bus/ProviderMapper.xml index 5783ae6..afeeed6 100644 --- a/src/main/resources/mapper/bus/ProviderMapper.xml +++ b/src/main/resources/mapper/bus/ProviderMapper.xml @@ -2,4 +2,20 @@ + + + delete from bus_goods where providerid = #{pid} + + + + + delete from bus_inport where providerid = #{pid} + + + + + delete from bus_outport where providerid = #{pid} + + + diff --git a/src/main/java/com/yeqifu/bus/mapper/xml/SalesMapper.xml b/src/main/resources/mapper/bus/SalesMapper.xml similarity index 100% rename from src/main/java/com/yeqifu/bus/mapper/xml/SalesMapper.xml rename to src/main/resources/mapper/bus/SalesMapper.xml diff --git a/src/main/java/com/yeqifu/bus/mapper/xml/SalesbackMapper.xml b/src/main/resources/mapper/bus/SalesbackMapper.xml similarity index 100% rename from src/main/java/com/yeqifu/bus/mapper/xml/SalesbackMapper.xml rename to src/main/resources/mapper/bus/SalesbackMapper.xml diff --git a/src/main/resources/templates/business/goods/goodsManager.html b/src/main/resources/templates/business/goods/goodsManager.html index 3df8bb9..2451cf8 100644 --- a/src/main/resources/templates/business/goods/goodsManager.html +++ b/src/main/resources/templates/business/goods/goodsManager.html @@ -423,7 +423,7 @@ //删除 function deleteGoods(data) { - layer.confirm('你确定要删除【' + data.goodsname + '】这个商品吗?', {icon: 3, title: '提示'}, function (index) { + layer.confirm('你确定要删除【' + data.goodsname + '】这个商品吗?删除该商品,其商品进货、商品退货、商品销售、商品销售退货将会同步删除!', {icon: 3, title: '提示'}, function (index) { $.post("/goods/deleteGoods", {id: data.id,goodsimg:data.goodsimg},function (res) { if (res.code == 200) { tableIns.reload({ diff --git a/src/main/resources/templates/business/provider/providerManager.html b/src/main/resources/templates/business/provider/providerManager.html index 27442a9..20526c8 100644 --- a/src/main/resources/templates/business/provider/providerManager.html +++ b/src/main/resources/templates/business/provider/providerManager.html @@ -63,9 +63,6 @@ -

- +
diff --git a/src/main/resources/templates/system/permission/permissionRight.html b/src/main/resources/templates/system/permission/permissionRight.html index ddc5d59..656b607 100644 --- a/src/main/resources/templates/system/permission/permissionRight.html +++ b/src/main/resources/templates/system/permission/permissionRight.html @@ -273,7 +273,7 @@ //删除 function deletePermission(data) { - layer.confirm('你确定要删除【' + data.title + '】这个权限吗?', {icon: 3, title: '提示'}, function (index) { + layer.confirm('你确定要删除【' + data.title + '】这个权限吗?如果该权限被删除,那个拥有该权限的角色也将失去该权限!', {icon: 3, title: '提示'}, function (index) { $.post("/permission/deletePermission", {id: data.id},function (res) { if (res.code == 200) { tableIns.reload({ diff --git a/src/main/resources/templates/system/role/roleManager.html b/src/main/resources/templates/system/role/roleManager.html index 6036e18..f5f4ce8 100644 --- a/src/main/resources/templates/system/role/roleManager.html +++ b/src/main/resources/templates/system/role/roleManager.html @@ -300,7 +300,7 @@ type:1, content:$("#selectRolePermissionDiv"), area:['400px','580px'], - title:'给'+data.name+'分配权限', + title:'给【'+data.name+'】分配权限', btn: ['确认分配','ဆ取消分配'], btnAlign:'c', yes: function(index, layero){ @@ -323,7 +323,7 @@ dtree.render({ elem:"#permissionTree", url:"/role/initPermissionByRoleId?roleId="+data.id, - //使用layui风格的数据格式 + //使用layUI风格的数据格式 dataStyle:"layuiStyle", //配置data的风格为list dataFormat:"list", diff --git a/src/main/resources/templates/system/user/userManager.html b/src/main/resources/templates/system/user/userManager.html index 1f8814f..9b95165 100644 --- a/src/main/resources/templates/system/user/userManager.html +++ b/src/main/resources/templates/system/user/userManager.html @@ -120,7 +120,7 @@
- +