代码更新
This commit is contained in:
@@ -85,10 +85,11 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(SectattrDto dto) {
|
public void create(SectattrDto dto) {
|
||||||
String sect_code = dto.getSect_code();
|
String sect_code = dto.getSect_code();
|
||||||
SectattrDto sectattrDto = this.findByCode(sect_code);
|
|
||||||
if (sectattrDto != null && sectattrDto.getIs_delete().equals("0")) {
|
WQLObject tab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
throw new BadRequestException("存在相同的库区编号");
|
JSONObject json2 = tab.query("sect_code = '" + sect_code + "' and stor_id = '" + dto.getStor_id() + "'").uniqueResult(0);
|
||||||
}
|
if (ObjectUtil.isNotEmpty(json2)) throw new BadRequestException("存在相同仓库的库区编号");
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -116,11 +117,14 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
String sect_code = dto.getSect_code();
|
/* String sect_code = dto.getSect_code();
|
||||||
SectattrDto sectattrDto = this.findByCode(sect_code);
|
SectattrDto sectattrDto = this.findByCode(sect_code);
|
||||||
if (sectattrDto != null && !dto.getSect_id().equals(sectattrDto.getSect_id()) && sectattrDto.getIs_delete().equals("0")) {
|
if (sectattrDto != null && !dto.getSect_id().equals(sectattrDto.getSect_id()) && sectattrDto.getIs_delete().equals("0")) {
|
||||||
throw new BadRequestException("存在相同的库区编号");
|
throw new BadRequestException("存在相同的库区编号");
|
||||||
}
|
}*/
|
||||||
|
String sect_code = dto.getSect_code();
|
||||||
|
|
||||||
|
WQLObject tab = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
|
|
||||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -135,6 +139,9 @@ public class SectattrServiceImpl implements SectattrService {
|
|||||||
WQLObject wo = WQLObject.getWQLObject("st_ivt_sectattr");
|
WQLObject wo = WQLObject.getWQLObject("st_ivt_sectattr");
|
||||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||||
wo.update(json);
|
wo.update(json);
|
||||||
|
|
||||||
|
JSONArray resultJSONArray = tab.query("sect_code = '" + sect_code + "' and stor_id = '" + dto.getStor_id() + "'").getResultJSONArray(0);
|
||||||
|
if (resultJSONArray.size() > 1) throw new BadRequestException("存在相同仓库的库区编号");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user