Commit 319d62db authored by H2T's avatar H2T

风险管控措施

parent c0b2eab2
...@@ -695,8 +695,6 @@ public class InputItemController extends AbstractBaseController { ...@@ -695,8 +695,6 @@ public class InputItemController extends AbstractBaseController {
@RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) { public CommonResponse addNewItemNew(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if(param.getId()>0){ if(param.getId()>0){
}else{ }else{
if ("1".equals(param.getEquipmentType()) && "1".equals(param.getCustomType()) &&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){ if ("1".equals(param.getEquipmentType()) && "1".equals(param.getCustomType()) &&param.getFacilitiesType() == null&&param.getKeyPartsType() == null){
...@@ -704,11 +702,11 @@ public class InputItemController extends AbstractBaseController { ...@@ -704,11 +702,11 @@ public class InputItemController extends AbstractBaseController {
} }
} }
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) { if (inputItemDao.findByItemNo(param.getItemNo(), param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) {
throw new BadRequest("该编号已存在,请重新输入"); throw new BadRequest("该编号已存在,请重新输入");
} }
if (CollectionUtils.isNotEmpty(inputItemDao.findByItemName(param.getName(), param.getId() != 0 ? String.valueOf(param.getId()) : null))) { if (inputItemDao.findByItemName(param.getName(),param.getId() != 0 ? String.valueOf(param.getId()) : null) > 0) {
throw new BadRequest("该名称已存在,请重新输入"); throw new BadRequest("该名称已存在,请重新输入");
} }
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.repository; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.patrol.business.dao.repository;
import com.yeejoin.amos.patrol.dao.entity.InputItem; import com.yeejoin.amos.patrol.dao.entity.InputItem;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
...@@ -34,10 +35,10 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> { ...@@ -34,10 +35,10 @@ public interface IInputItemDao extends BaseDao<InputItem, Long> {
@Query(value = "delete * from p_input_item where is not null and is_delete =0", nativeQuery = true) @Query(value = "delete * from p_input_item where is not null and is_delete =0", nativeQuery = true)
void deleteAllByEquipmentNameIsNotNull(); void deleteAllByEquipmentNameIsNotNull();
@Query(value = "select * from p_input_item where item_no = ?1 and is_delete =0 and if(?2 is null, 1 = 1 , id != ?2)", nativeQuery = true) @Query(value = "select count(1) from p_input_item where item_no = :itemNo and is_delete = 0 and id != :id", nativeQuery = true)
List<InputItem> findByItemNo(String itemNo, String id); int findByItemNo(@Param("itemNo") String itemNo, @Param("id") String id);
@Query(value = "select * from p_input_item where name = ?1 and is_delete =0 and if(?2 is null, 1 = 1 , id != ?2)", nativeQuery = true) @Query(value = "select count(1) from p_input_item where name = :name and is_delete = 0 and id != :id", nativeQuery = true)
List<InputItem> findByItemName(String name, String id); int findByItemName(@Param("name") String name,@Param("id")String id);
} }
...@@ -100,7 +100,7 @@ public class RemoteSecurityService { ...@@ -100,7 +100,7 @@ public class RemoteSecurityService {
if (ObjectUtils.isEmpty(toke)) { if (ObjectUtils.isEmpty(toke)) {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} else { } else {
RequestContext.setProduct(productWeb); RequestContext.setProduct(productWeb);
if (!TokenOperation.refresh(toke.getToke())) { if (!TokenOperation.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel); toke = getLogin(dPasswordAuthModel);
} }
...@@ -239,7 +239,7 @@ public class RemoteSecurityService { ...@@ -239,7 +239,7 @@ public class RemoteSecurityService {
} }
public List<AgencyUserModel> listUserByUserIds(String userIds) { public List<AgencyUserModel> listUserByUserIds(String userIds) {
CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds,true); CommonResponse commonResponse = iAmosSecurityServer.listUserByUserIds(userIds, true);
return handleArray(commonResponse, AgencyUserModel.class); return handleArray(commonResponse, AgencyUserModel.class);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment