diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java index 4d5d095..7c99354 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClient.java @@ -76,7 +76,6 @@ public interface IEmInfoClient { String GET_EM_INFO_BY_DEPT = API_PREFIX + "/getEmInfoByDept"; String GET_EM_INFO_BY_NAME = API_PREFIX + "/getEmInfoByName"; String GET_EM_INFO_BY_EM_CODE = API_PREFIX + "/getEmInfoByEmCode"; - String GET_EM_INFO_TREE_BY_EM_CODE = API_PREFIX + "/getEmInfoTreeByEmCode"; String UPDATE_BY_EM_CODE = API_PREFIX + "/updateByEmCode"; String UPDATE_BATCH_EM_STATE = API_PREFIX + "/updateBachEmState"; String GET_CHILDREN_BY_EM_CODE = API_PREFIX + "/getChildrenByEmCode"; @@ -115,9 +114,6 @@ public interface IEmInfoClient { @GetMapping(GET_EM_INFO_BY_EM_CODES) R> getEmInfoByEmCodes(@RequestParam("emCodes") List emCodes); - @GetMapping(GET_EM_INFO_TREE_BY_EM_CODE) - R> getEmInfoTreeByEmCode(@RequestParam("emCode") String emCode); - @PostMapping(GET_EM_INFO_UNIT_COUNT_BY_DEPT) R getEmInfoUnitCountByDept(@RequestParam("list") List list); diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java index e8b0b95..b9aa407 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/equipment/feign/IEmInfoClientBack.java @@ -54,10 +54,6 @@ public class IEmInfoClientBack implements IEmInfoClient { return R.data(new ArrayList<>()); } - @Override - public R> getEmInfoTreeByEmCode(String emCode) { - return R.data(new ArrayList<>()); - } @Override public R getEmInfoUnitCountByDept(List depts) { diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java index 15f27d0..ba5950d 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/controller/WtSpBasicController.java @@ -191,7 +191,7 @@ public class WtSpBasicController extends BladeController { @ApiOperation(value = "导入台账填写Excel") @RequestMapping(value = "/importExcel", method = {RequestMethod.POST}) public R importExcel( @RequestParam MultipartFile file) throws Exception { - System.out.println(11); +// System.out.println(11); return SP_BASICService.importExcel(file); } diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpAllocationMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpAllocationMapper.xml index 51f8465..af3d899 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpAllocationMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpAllocationMapper.xml @@ -46,7 +46,7 @@ wt_sp_allocation wa JOIN wt_sp_warehouse sw ON wa.OUT_WAREHOUSE_ID = sw.id - and wa.code = #{params.code} + and wa.code like concat('%',#{params.code},'%') and wa.status = #{params.status} diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml index 3a10eb7..b9f54bb 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpReceiveMapper.xml @@ -47,7 +47,7 @@ wt_sp_receive wr JOIN wt_sp_warehouse sw ON wr.STORAGE_ROOM = sw.id - and wr.code = #{params.code} + and wr.code like concat('%',#{params.code},'%') and wr.CREATE_USER = #{params.createUser} diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseInMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseInMapper.xml index 7d7f1bc..80ee565 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseInMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseInMapper.xml @@ -47,7 +47,7 @@ wt_sp_warehouse_in wi JOIN wt_sp_warehouse sw ON wi.STORAGE_ROOM = sw.id - and wi.code = #{params.code} + and wi.code like concat('%',#{params.code},'%') and wi.type = #{params.type} diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.xml index 54863cd..d3349a8 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/SpWarehouseOutMapper.xml @@ -47,7 +47,7 @@ wt_sp_warehouse_out wo JOIN wt_sp_warehouse sw ON wo.STORAGE_ROOM = sw.id - and wo.code = #{params.code} + and wo.code like concat('%',#{params.code},'%') and wo.type = #{params.type} diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpTotalMapper.xml b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpTotalMapper.xml index cb5a6c9..ae05c22 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpTotalMapper.xml +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/mapper/WtSpTotalMapper.xml @@ -71,7 +71,7 @@ join wt_sp_management sm on sb.MANAGEMENT_ID = sm.id where st.IS_DELETED = 0 - and sb.code = #{params.code} + and sb.code like concat('%',#{params.code},'%') and sb.NAME like concat('%',#{params.name},'%') diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java index 2dde368..947c4a8 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/SpReceiveServiceImpl.java @@ -15,7 +15,6 @@ import com.hnac.hzims.spare.vo.WtSpBasicVO; import lombok.AllArgsConstructor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springblade.core.launch.constant.FlowConstant; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; @@ -23,9 +22,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; -import org.springblade.core.tool.support.Kv; import org.springblade.core.tool.utils.Func; -import org.springblade.core.tool.utils.StringUtil; import org.springblade.system.entity.Dept; import org.springblade.system.feign.IDictBizClient; import org.springblade.system.feign.ISysClient; @@ -34,14 +31,12 @@ import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 服务实现类 @@ -236,7 +231,7 @@ public class SpReceiveServiceImpl extends BaseServiceImpl user = userClient.userByAccount(bladeUser.getTenantId(),receiveVO.getUserName()); if(null!=user){ - if(null!=user.getData().getId()){ + if(null!=user.getData()){ params.put("createUser",user.getData().getId()); }else{ return page.setRecords(result); diff --git a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java index 348723e..b9c6e9f 100644 --- a/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java +++ b/hzims-service/assets/src/main/java/com/hnac/hzims/spare/service/impl/WtSpBasicServiceImpl.java @@ -15,7 +15,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.hnac.hzims.equipment.entity.EmInfoEntity; import com.hnac.hzims.equipment.feign.IEmInfoClient; import com.hnac.hzims.spare.entity.*; import com.hnac.hzims.spare.enume.WarehouseInType; @@ -551,9 +550,12 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl data = new ArrayList<>(); + List error = new ArrayList<>(); + error = JSONArray.parseArray(JSON.toJSONString(entityList), WtSpBasicEntity.class).stream() + .filter(entity -> Func.isEmpty(entity.getName())).collect(Collectors.toList()); data = JSONArray.parseArray(JSON.toJSONString(entityList), WtSpBasicEntity.class).stream() .filter(entity -> Func.isNotEmpty(entity.getName())).collect(Collectors.toList()); - Assert.isTrue(CollectionUtil.isNotEmpty(data), () -> { + Assert.isTrue(CollectionUtil.isEmpty(error), () -> { throw new ServiceException("填入工器具编码不能为空"); }); // List data = ExcelImportUtil.importExcel(file.getInputStream(), WtSpBasicEntity.class, params); @@ -565,15 +567,15 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl r = this.validExcel(libraryExcel, codeList, counter); - if (r == null && r.getCode() == 500) { + if (r.getMsg()!=null|| !r.isSuccess()) { return r; } } boolean flag = this.saveBatch(data); return R.status(flag); } catch (Exception ex) { - throw new RuntimeException( ex); -// String.format("导入数据异常!"), + log.error("导入数据异常:", ex); + throw new ServiceException(ex.getMessage()); } } @@ -610,14 +612,14 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl() {{ @@ -651,7 +653,7 @@ public class WtSpBasicServiceImpl extends BaseServiceImpl> getEmInfoTreeByEmCode(String emCode) { - return R.data(service.getEmInfoTreeByEmCode(emCode)); - } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml index db7e24d..d7be978 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/mapper/EmInfoMapper.xml @@ -117,7 +117,7 @@