Browse Source

问题修改

master
God 3 years ago
parent
commit
b66d677ed6
  1. 16
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinbound/ScmApplyInboundService.java
  2. 2
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.java
  3. 3
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.xml
  4. 4
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleService.java

16
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinbound/ScmApplyInboundService.java

@ -180,9 +180,9 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
ResultBean rb = ResultBean.fireFail();
List<ScmFileDto> scmFiles = dto.getScmFiles();
// 验证车架号:不能为空、不能重复
List<ScmApplyInboundVehicleDto> vehicleList1 = dto.getVehicleList();
/*List<ScmApplyInboundVehicleDto> vehicleList1 = dto.getVehicleList();
List<String> vinNoList1 = vehicleList1.stream().filter(vehicle -> StringUtils.isNotBlank(vehicle.getVinNo())).map(vehicle -> vehicle.getVinNo()).collect(Collectors.toList());
/*if (vehicleList.size() != vinNoList.size()) {
if (vehicleList.size() != vinNoList.size()) {
return new ResultBean().fail().setMsg("车架号不能为空");
}*/
// 去重
@ -190,16 +190,6 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
if (vinNoList1.size() != disCount) {
return new ResultBean().fail().setMsg("车架号不能重复");
}*/
for (String s : vinNoList1) {
ScmApplyInboundVehicleQuery scmApplyInboundVehicleQuery = new ScmApplyInboundVehicleQuery();
scmApplyInboundVehicleQuery.setVinNo(s);
List<ScmApplyInboundVehicle> scmApplyInboundVehicles = scmApplyInboundVehicleService.listAll(scmApplyInboundVehicleQuery);
if (scmApplyInboundVehicles.size() > 0){
return rb.setMsg("车架号" + s + "已存在入库申请中,请重新填写");
}
}
if (StringUtils.isBlank(dto.getSid())) { // 新增
// 验证数据库是否重复
/* for (int i = 0; i < vinNoList.size(); i++) {
@ -263,7 +253,7 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa
}
// 验证数据库是否重复
for (int i = 0; i < vinNoList.size(); i++) {
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i), dto.getSid());
int count = scmApplyInboundVehicleService.checkVinNo(vinNoList.get(i));
BaseVehicle data = baseVehicleFeign.selectByVinNoAndOrgSid(vinNoList.get(i), dto.getUseOrgSid()).getData();
if (count != 0) {
return new ResultBean().setMsg("车架号已经存在");

2
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.java

@ -34,7 +34,7 @@ public interface ScmApplyInboundVehicleMapper extends BaseMapper<ScmApplyInbound
IPage<ScmApplyInboundVehicleVo> selectPageVo(IPage<ScmApplyInboundVehicle> page, @Param(Constants.WRAPPER) Wrapper<ScmApplyInboundVehicle> qw);
int checkVinNo(@Param("vinNo") String vinNo, @Param("applySid") String applySid);
int checkVinNo(@Param("vinNo") String vinNo);
List<ScmApplyInboundVehicleVo> selectListByAppSid(@Param("applySid") String applySid);

3
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleMapper.xml

@ -9,9 +9,6 @@
<select id="checkVinNo" resultType="int">
SELECT count(1) FROM scm_apply_inbound_vehicle WHERE vinNo=#{vinNo}
<if test="applySid != null and applySid !='' ">
AND applySid != #{applySid}
</if>
</select>
<select id="selectListByAppSid" resultType="com.yxt.anrui.scm.api.scmapplyinboundvehicle.ScmApplyInboundVehicleVo">

4
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmapplyinboundvehicle/ScmApplyInboundVehicleService.java

@ -75,8 +75,8 @@ public class ScmApplyInboundVehicleService extends MybatisBaseService<ScmApplyIn
* 验证车架号是否重复
* @return
*/
public int checkVinNo(String vinNo, String applySid) {
return baseMapper.checkVinNo(vinNo, applySid);
public int checkVinNo(String vinNo) {
return baseMapper.checkVinNo(vinNo);
}
/**

Loading…
Cancel
Save