作者 lixiang

6.16bug修正

@@ -88,6 +88,12 @@ public class TblTradeInquiryInfoController extends JeecgController<TblTradeInqui @@ -88,6 +88,12 @@ public class TblTradeInquiryInfoController extends JeecgController<TblTradeInqui
88 @ApiOperation(value="询价明细表-添加", notes="询价明细表-添加") 88 @ApiOperation(value="询价明细表-添加", notes="询价明细表-添加")
89 @PostMapping(value = "/add") 89 @PostMapping(value = "/add")
90 public Result<String> add(@RequestBody TblTradeInquiryInfo tblTradeInquiryInfo) { 90 public Result<String> add(@RequestBody TblTradeInquiryInfo tblTradeInquiryInfo) {
  91 + // 重复检验
  92 + if (tblTradeInquiryInfoService.isExist(tblTradeInquiryInfo)) {
  93 + return Result.error("数据已存在,请勿重复添加!");
  94 + }
  95 +
  96 +
91 tblTradeInquiryInfoService.save(tblTradeInquiryInfo); 97 tblTradeInquiryInfoService.save(tblTradeInquiryInfo);
92 return Result.OK("添加成功!"); 98 return Result.OK("添加成功!");
93 } 99 }
@@ -236,6 +236,20 @@ public class TblTradePriceInquiryController { @@ -236,6 +236,20 @@ public class TblTradePriceInquiryController {
236 if (CollectionUtil.isEmpty(tblTradeTenderInfoList)) { 236 if (CollectionUtil.isEmpty(tblTradeTenderInfoList)) {
237 return Result.ok(); 237 return Result.ok();
238 } 238 }
  239 +
  240 +// LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
  241 +// if (sysUser != null) {
  242 +// //当前用户id
  243 +// String userId = sysUser.getId();
  244 +// String roleId = tblTradeTenderInfoService.selectRoleInfo("ProcurementSupervisor");
  245 +//
  246 +// Integer count = tblTradeTenderInfoService.selectIsRole(userId,roleId);
  247 +// if (count != null && count > 0) {
  248 +//
  249 +// }
  250 +// }
  251 +
  252 +
239 //查询库存信息 253 //查询库存信息
240 Map<String, TblTradeTenderInfo> collect = tblTradeTenderInfoList.stream().collect(Collectors.toMap(TblTradeTenderInfo::getCode, e -> e)); 254 Map<String, TblTradeTenderInfo> collect = tblTradeTenderInfoList.stream().collect(Collectors.toMap(TblTradeTenderInfo::getCode, e -> e));
241 Set<String> strings = collect.keySet(); 255 Set<String> strings = collect.keySet();
@@ -28,4 +28,8 @@ public interface TblTradeTenderInfoMapper extends BaseMapper<TblTradeTenderInfo> @@ -28,4 +28,8 @@ public interface TblTradeTenderInfoMapper extends BaseMapper<TblTradeTenderInfo>
28 * @return List<TblTradeTenderInfo> 28 * @return List<TblTradeTenderInfo>
29 */ 29 */
30 public List<TblTradeTenderInfo> selectByMainId(@Param("mainId") String mainId); 30 public List<TblTradeTenderInfo> selectByMainId(@Param("mainId") String mainId);
  31 +
  32 + String selectRoleInfo(@Param("procurementSupervisor") String procurementSupervisor);
  33 +
  34 + Integer selectIsRole(@Param("userId") String userId,@Param("roleId") String roleId);
31 } 35 }
@@ -13,4 +13,10 @@ @@ -13,4 +13,10 @@
13 FROM tbl_trade_tender_info 13 FROM tbl_trade_tender_info
14 WHERE 14 WHERE
15 xjbswjh = #{mainId} </select> 15 xjbswjh = #{mainId} </select>
  16 + <select id="selectRoleInfo" resultType="java.lang.String">
  17 + select id from sys_role where role_code = #{procurementSupervisor}
  18 + </select>
  19 + <select id="selectIsRole" resultType="java.lang.Integer">
  20 + select count(1) from sys_user_role where role_id = #{roleId} and user_id = #{userId}
  21 + </select>
16 </mapper> 22 </mapper>
@@ -19,4 +19,6 @@ public interface ITblTradeInquiryInfoService extends IService<TblTradeInquiryInf @@ -19,4 +19,6 @@ public interface ITblTradeInquiryInfoService extends IService<TblTradeInquiryInf
19 * @return List<TblTradeInquiryInfo> 19 * @return List<TblTradeInquiryInfo>
20 */ 20 */
21 public List<TblTradeInquiryInfo> selectByMainId(String mainId); 21 public List<TblTradeInquiryInfo> selectByMainId(String mainId);
  22 +
  23 + boolean isExist(TblTradeInquiryInfo tblTradeInquiryInfo);
22 } 24 }
@@ -41,4 +41,8 @@ public interface ITblTradeTenderInfoService extends IService<TblTradeTenderInfo> @@ -41,4 +41,8 @@ public interface ITblTradeTenderInfoService extends IService<TblTradeTenderInfo>
41 41
42 42
43 void saveUploadData(List<TblTradeTenderInfo> list); 43 void saveUploadData(List<TblTradeTenderInfo> list);
  44 +
  45 + String selectRoleInfo(String procurementSupervisor);
  46 +
  47 + Integer selectIsRole(String userId, String roleId);
44 } 48 }
1 package org.jeecg.modules.erp.trade.service.impl; 1 package org.jeecg.modules.erp.trade.service.impl;
2 2
  3 +import cn.hutool.core.collection.CollectionUtil;
  4 +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  5 +import org.apache.commons.lang3.StringUtils;
3 import org.jeecg.modules.erp.trade.entity.TblTradeInquiryInfo; 6 import org.jeecg.modules.erp.trade.entity.TblTradeInquiryInfo;
4 import org.jeecg.modules.erp.trade.mapper.TblTradeInquiryInfoMapper; 7 import org.jeecg.modules.erp.trade.mapper.TblTradeInquiryInfoMapper;
5 import org.jeecg.modules.erp.trade.service.ITblTradeInquiryInfoService; 8 import org.jeecg.modules.erp.trade.service.ITblTradeInquiryInfoService;
@@ -24,4 +27,33 @@ public class TblTradeInquiryInfoServiceImpl extends ServiceImpl<TblTradeInquiryI @@ -24,4 +27,33 @@ public class TblTradeInquiryInfoServiceImpl extends ServiceImpl<TblTradeInquiryI
24 public List<TblTradeInquiryInfo> selectByMainId(String mainId) { 27 public List<TblTradeInquiryInfo> selectByMainId(String mainId) {
25 return tblTradeInquiryInfoMapper.selectByMainId(mainId); 28 return tblTradeInquiryInfoMapper.selectByMainId(mainId);
26 } 29 }
  30 +
  31 + @Override
  32 + public boolean isExist(TblTradeInquiryInfo tblTradeInquiryInfo) {
  33 + if (tblTradeInquiryInfo != null && StringUtils.isNotBlank(tblTradeInquiryInfo.getTradeId())) {
  34 + QueryWrapper<TblTradeInquiryInfo> queryWrapper = new QueryWrapper<>();
  35 + queryWrapper.eq("trade_id", tblTradeInquiryInfo.getTradeId());
  36 + queryWrapper.eq("ghsmc", tblTradeInquiryInfo.getGhsmc());
  37 + queryWrapper.eq("lxr", tblTradeInquiryInfo.getLxr());
  38 + queryWrapper.eq("tel", tblTradeInquiryInfo.getTel());
  39 + queryWrapper.eq("khhmc", tblTradeInquiryInfo.getKhhmc());
  40 + queryWrapper.eq("yhzh", tblTradeInquiryInfo.getYhzh());
  41 + queryWrapper.eq("hh", tblTradeInquiryInfo.getHh());
  42 +
  43 + queryWrapper.eq("zpdj", tblTradeInquiryInfo.getZpdj());
  44 + queryWrapper.eq("zpsl", tblTradeInquiryInfo.getZpsl());
  45 + queryWrapper.eq("ppdj", tblTradeInquiryInfo.getPpdj());
  46 + queryWrapper.eq("ppsl", tblTradeInquiryInfo.getPpsl());
  47 + queryWrapper.eq("wpdj", tblTradeInquiryInfo.getWpdj());
  48 + queryWrapper.eq("sfhyf", tblTradeInquiryInfo.getSfhyf());
  49 + queryWrapper.eq("fhdz", tblTradeInquiryInfo.getFhdz());
  50 + queryWrapper.eq("zxchl", tblTradeInquiryInfo.getZxchl());
  51 + queryWrapper.eq("jhzqt", tblTradeInquiryInfo.getJhzqt());
  52 +
  53 + List<TblTradeInquiryInfo> tblTradeInquiryInfos = tblTradeInquiryInfoMapper.selectList(queryWrapper);
  54 + //不为空,存在重复数据
  55 + return !CollectionUtil.isEmpty(tblTradeInquiryInfos);
  56 + }
  57 + return true;
  58 + }
27 } 59 }
@@ -130,5 +130,15 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf @@ -130,5 +130,15 @@ public class TblTradeTenderInfoServiceImpl extends ServiceImpl<TblTradeTenderInf
130 130
131 } 131 }
132 132
  133 + @Override
  134 + public String selectRoleInfo(String procurementSupervisor) {
  135 + return tblTradeTenderInfoMapper.selectRoleInfo(procurementSupervisor);
  136 + }
  137 +
  138 + @Override
  139 + public Integer selectIsRole(String userId, String roleId) {
  140 + return tblTradeTenderInfoMapper.selectIsRole(userId, roleId);
  141 + }
  142 +
133 143
134 } 144 }