Commit 08880846 authored by 张森's avatar 张森

Merge remote-tracking branch 'origin/develop_dl' into develop_dl_bugfix

# Conflicts: # amos-boot-system-equip/src/main/resources/application-dev.properties
parents 837c6efc 76c5d1ae
...@@ -35,7 +35,7 @@ public interface EquipFeignClient { ...@@ -35,7 +35,7 @@ public interface EquipFeignClient {
* @return * @return
*/ */
@RequestMapping(value = "/stock-detail/airport/person/bind", method = RequestMethod.POST) @RequestMapping(value = "/stock-detail/airport/person/bind", method = RequestMethod.POST)
ResponseModel<List<Object>> stockBindEquip(@RequestBody List<Long> ids) throws InnerInvokException; ResponseModel<List<Object>> stockBindEquip(@RequestBody List<Map<String, Number>> stocks) throws InnerInvokException;
/** /**
* 人员装备退装 * 人员装备退装
...@@ -43,7 +43,7 @@ public interface EquipFeignClient { ...@@ -43,7 +43,7 @@ public interface EquipFeignClient {
* @return * @return
*/ */
@RequestMapping(value = "/scrap/airport/person", method = RequestMethod.POST) @RequestMapping(value = "/scrap/airport/person", method = RequestMethod.POST)
ResponseModel<Object> scrapEquip(@RequestBody String id) throws InnerInvokException; ResponseModel<Object> scrapEquip(@RequestBody Map<String, Object> map) throws InnerInvokException;
/** /**
* 人员装备回库 * 人员装备回库
...@@ -173,8 +173,8 @@ public interface EquipFeignClient { ...@@ -173,8 +173,8 @@ public interface EquipFeignClient {
**/ **/
@RequestMapping(value = "/car/getTeamCarList", method = RequestMethod.GET) @RequestMapping(value = "/car/getTeamCarList", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getTeamCarList(@RequestParam("sequenceNbr") String sequenceNbr,@RequestParam("longitude") Double longitude, @RequestParam("latitude") Double latitude); ResponseModel<List<Map<String, Object>>> getTeamCarList(@RequestParam("sequenceNbr") String sequenceNbr,@RequestParam("longitude") Double longitude, @RequestParam("latitude") Double latitude);
/** /**
* 车辆信息详情 * 车辆信息详情
**/ **/
...@@ -365,7 +365,7 @@ public interface EquipFeignClient { ...@@ -365,7 +365,7 @@ public interface EquipFeignClient {
@RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST) @RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST)
ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO); ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO);
@RequestMapping(value = "/car/{id}", method = RequestMethod.GET) @RequestMapping(value = "/car/{id}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> selectOneById( @PathVariable("id") Long id); ResponseModel<Map<String, Object>> selectOneById( @PathVariable("id") Long id);
...@@ -384,17 +384,17 @@ public interface EquipFeignClient { ...@@ -384,17 +384,17 @@ public interface EquipFeignClient {
@RequestMapping(value = "/equipment/list/{typeCode}", method = RequestMethod.GET) @RequestMapping(value = "/equipment/list/{typeCode}", method = RequestMethod.GET)
ResponseModel<List<Object>> getEquipmentList(@PathVariable("typeCode") String typeCode); ResponseModel<List<Object>> getEquipmentList(@PathVariable("typeCode") String typeCode);
@RequestMapping(value = "equipment-category/list-tree", method = RequestMethod.GET) @RequestMapping(value = "equipment-category/list-tree", method = RequestMethod.GET)
ResponseModel<Object> list() ; ResponseModel<Object> list() ;
//获取消防装备权限 //获取消防装备权限
@RequestMapping(value = "/equipment-detail/permissions/export", method = RequestMethod.GET) @RequestMapping(value = "/equipment-detail/permissions/export", method = RequestMethod.GET)
ResponseModel<ReginParams> getPermissions() ; ResponseModel<ReginParams> getPermissions() ;
@RequestMapping(value = "/building/getBuildingList", method = RequestMethod.GET) @RequestMapping(value = "/building/getBuildingList", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getBuildingTreeList(); ResponseModel<List<Map<String, Object>>> getBuildingTreeList();
@RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET) @RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET)
public ResponseModel<Object> getCompanyBuildingTree(); public ResponseModel<Object> getCompanyBuildingTree();
......
...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.mapper; ...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket; import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
import java.util.List;
import java.util.Map;
/** /**
* 消防人员配装记录 Mapper 接口 * 消防人员配装记录 Mapper 接口
* *
...@@ -11,4 +14,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket; ...@@ -11,4 +14,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
*/ */
public interface FirefightersJacketMapper extends BaseMapper<FirefightersJacket> { public interface FirefightersJacketMapper extends BaseMapper<FirefightersJacket> {
List<Map<String, Object>> getPersonEquipCount();
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersJacketMapper"> <mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.FirefightersJacketMapper">
<select id="getPersonEquipCount" resultType="java.util.Map">
SELECT
equipment_type_name AS name,
SUM(amount) AS value,
'个' AS unnit
FROM
jc_firefighters_jacket
WHERE
is_delete = 0
GROUP BY
equipment_type_name
</select>
</mapper> </mapper>
...@@ -1520,7 +1520,7 @@ ...@@ -1520,7 +1520,7 @@
) g ON u.sequence_nbr = g.instance_id ) g ON u.sequence_nbr = g.instance_id
WHERE WHERE
u.biz_org_type = 'person' u.biz_org_type = 'person'
AND g.peopleType IN ('1601', '1602', '1603') AND g.peopleType IN ('1601', '1602', '1603', '1604')
AND u.is_delete = 0 AND u.is_delete = 0
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%') AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
...@@ -1535,6 +1535,8 @@ ...@@ -1535,6 +1535,8 @@
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'XFGLGW' ) b ON LOCATE( b.CODE, a.fireManagementPost ) != 0 LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'XFGLGW' ) b ON LOCATE( b.CODE, a.fireManagementPost ) != 0
WHERE WHERE
a.sequenceNbr IS NOT NULL AND b.`name` IS NOT NULL a.sequenceNbr IS NOT NULL AND b.`name` IS NOT NULL
GROUP BY
sequenceNbr
) a ) a
GROUP BY GROUP BY
postName postName
...@@ -1642,6 +1644,7 @@ ...@@ -1642,6 +1644,7 @@
u.biz_org_type = 'person' u.biz_org_type = 'person'
AND g.peopleType IN ('1601', '1602', '1603') AND g.peopleType IN ('1601', '1602', '1603')
AND u.is_delete = 0 AND u.is_delete = 0
AND cf.biz_org_name is not null
<if test="map.bizOrgCode != null and map.bizOrgCode != ''"> <if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{map.bizOrgCode}, '%') AND u.biz_org_code LIKE CONCAT(#{map.bizOrgCode}, '%')
</if> </if>
......
...@@ -249,4 +249,8 @@ public class Car extends BaseEntity { ...@@ -249,4 +249,8 @@ public class Car extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String equipStatusFilter; private String equipStatusFilter;
@ApiModelProperty(value = "使用方式")
private String useType;
} }
...@@ -13,7 +13,7 @@ public enum EquipTypeEnum { ...@@ -13,7 +13,7 @@ public enum EquipTypeEnum {
/** /**
* 退库,回库 * 退库,回库
*/ */
退装("scrap", "退装"), 报废("scrap", "报废"),
回库("stock", "回库"); 回库("stock", "回库");
private String key; private String key;
......
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.EquipmentOnCarDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.EquipmentOnCarDto;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 消防人员配装记录 服务类 * 消防人员配装记录 服务类
...@@ -16,6 +17,8 @@ import java.util.List; ...@@ -16,6 +17,8 @@ import java.util.List;
*/ */
public interface IFirefightersJacketService { public interface IFirefightersJacketService {
List<Map<String, Object>> getPersonEquipCount();
ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size); ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size);
boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos); boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos);
......
...@@ -267,6 +267,9 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -267,6 +267,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "列表分页查询", notes = "列表分页查询") @ApiOperation(httpMethod = "POST", value = "列表分页查询", notes = "列表分页查询")
public IPage<EquipmentOnCarVo> onCarVoIPage(@RequestBody EquipmentSpecificDto equipmentSpecificDto) { public IPage<EquipmentOnCarVo> onCarVoIPage(@RequestBody EquipmentSpecificDto equipmentSpecificDto) {
ReginParams ReginParams = getSelectedOrgInfo();
String bizOrgCode= ReginParams.getPersonIdentity().getBizOrgCode();
equipmentSpecificDto.setBizOrgCode(bizOrgCode);
return equipmentSpecificSerivce.onCarVoIPage(equipmentSpecificDto); return equipmentSpecificSerivce.onCarVoIPage(equipmentSpecificDto);
} }
......
...@@ -27,9 +27,10 @@ import javax.servlet.http.HttpServletRequest; ...@@ -27,9 +27,10 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
* *
* @author wujiang * @author wujiang
* @date 2020-07-07 * @date 2020-07-07
...@@ -44,7 +45,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -44,7 +45,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 新增 * 新增
* *
* @return * @return
*/ */
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
...@@ -56,7 +57,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -56,7 +57,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 根据id删除 * 根据id删除
* *
* @param id * @param id
* @return * @return
*/ */
...@@ -69,7 +70,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -69,7 +70,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 修改 * 修改
* *
* @return * @return
*/ */
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
...@@ -81,7 +82,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -81,7 +82,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 根据id查询 * 根据id查询
* *
* @param id * @param id
* @return * @return
*/ */
...@@ -94,7 +95,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -94,7 +95,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 列表分页查询 * 列表分页查询
* *
* @return * @return
*/ */
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
...@@ -143,7 +144,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -143,7 +144,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 新建报废 * 新建报废
* *
* @param list * @param list
* @return * @return
*/ */
...@@ -156,7 +157,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -156,7 +157,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 执行报废 * 执行报废
* *
* @param param * @param param
* @return * @return
*/ */
...@@ -172,7 +173,7 @@ public class ScrapController extends AbstractBaseController { ...@@ -172,7 +173,7 @@ public class ScrapController extends AbstractBaseController {
/** /**
* 执行报废 * 执行报废
* *
* @param * @param
* @return * @return
*/ */
...@@ -222,9 +223,9 @@ public class ScrapController extends AbstractBaseController { ...@@ -222,9 +223,9 @@ public class ScrapController extends AbstractBaseController {
@RequestMapping(value = "/airport/person", method = RequestMethod.POST) @RequestMapping(value = "/airport/person", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "机场人员装备退装接口", notes = "人员装备报废", produces = "application/json;charset=UTF-8") @ApiOperation(httpMethod = "POST", value = "机场人员装备退装接口", notes = "人员装备报废", produces = "application/json;charset=UTF-8")
public ResponseModel scrapOnPerson(@RequestBody String id) { public ResponseModel scrapOnPerson(@RequestBody Map<String, Object> map) {
try { try {
iScrapService.scrapOnPerson(Long.valueOf(id)); iScrapService.scrapOnPerson(map, getUserInfo());
} catch (Exception e) { } catch (Exception e) {
return CommonResponseUtil.failure("人员装备报废失败!"); return CommonResponseUtil.failure("人员装备报废失败!");
} }
......
...@@ -40,7 +40,7 @@ public class StockDetailController { ...@@ -40,7 +40,7 @@ public class StockDetailController {
/** /**
* 新增库存明细 * 新增库存明细
* *
* @return * @return
*/ */
@RequestMapping(value = "/save", method = RequestMethod.POST) @RequestMapping(value = "/save", method = RequestMethod.POST)
...@@ -52,7 +52,7 @@ public class StockDetailController { ...@@ -52,7 +52,7 @@ public class StockDetailController {
/** /**
* 根据id删除 * 根据id删除
* *
* @param id * @param id
* @return * @return
*/ */
...@@ -65,7 +65,7 @@ public class StockDetailController { ...@@ -65,7 +65,7 @@ public class StockDetailController {
/** /**
* 修改库存明细 * 修改库存明细
* *
* @return * @return
*/ */
@RequestMapping(value = "/updateById", method = RequestMethod.PUT) @RequestMapping(value = "/updateById", method = RequestMethod.PUT)
...@@ -77,7 +77,7 @@ public class StockDetailController { ...@@ -77,7 +77,7 @@ public class StockDetailController {
/** /**
* 根据id查询 * 根据id查询
* *
* @param id * @param id
* @return * @return
*/ */
...@@ -90,7 +90,7 @@ public class StockDetailController { ...@@ -90,7 +90,7 @@ public class StockDetailController {
/** /**
* 列表分页查询 * 列表分页查询
* *
* @return * @return
*/ */
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
...@@ -137,7 +137,7 @@ public class StockDetailController { ...@@ -137,7 +137,7 @@ public class StockDetailController {
/** /**
* 指定位置指定分类下库存查询 以分类为主(灭火药剂入账列表) * 指定位置指定分类下库存查询 以分类为主(灭火药剂入账列表)
* *
* @return * @return
*/ */
@RequestMapping(value = "/category", method = RequestMethod.GET) @RequestMapping(value = "/category", method = RequestMethod.GET)
...@@ -158,7 +158,7 @@ public class StockDetailController { ...@@ -158,7 +158,7 @@ public class StockDetailController {
/** /**
* 指定位置指定分类库存查询 以库存为主(灭火药剂装载列表) * 指定位置指定分类库存查询 以库存为主(灭火药剂装载列表)
* *
* @return * @return
*/ */
@RequestMapping(value = "/stock", method = RequestMethod.GET) @RequestMapping(value = "/stock", method = RequestMethod.GET)
...@@ -180,7 +180,7 @@ public class StockDetailController { ...@@ -180,7 +180,7 @@ public class StockDetailController {
/** /**
* 列表分页查询 * 列表分页查询
* *
* @return * @return
*/ */
@RequestMapping(value = "/place/equipment", method = RequestMethod.GET) @RequestMapping(value = "/place/equipment", method = RequestMethod.GET)
...@@ -215,10 +215,10 @@ public class StockDetailController { ...@@ -215,10 +215,10 @@ public class StockDetailController {
@RequestMapping(value = "/airport/person/bind", method = RequestMethod.POST) @RequestMapping(value = "/airport/person/bind", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "人员装备列装接口", notes = "人员装备列装", produces = "application/json;charset=UTF-8") @ApiOperation(httpMethod = "POST", value = "人员装备列装接口", notes = "人员装备列装", produces = "application/json;charset=UTF-8")
public ResponseModel loadOnPerson(@RequestBody List<String> ids) { public ResponseModel loadOnPerson(@RequestBody List<Map<String, Number>> stocks) {
List<StockDetail> stockDetails = null; List<StockDetail> stockDetails = null;
if (0 < ids.size()) { if (!stocks.isEmpty()) {
stockDetails = iStockDetailService.loadOnPerson(ids); stockDetails = iStockDetailService.loadOnPerson(stocks);
} }
return CommonResponseUtil.success(stockDetails); return CommonResponseUtil.success(stockDetails);
} }
......
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.ScrapDetail; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.ScrapDetail;
import com.yeejoin.equipmanage.common.entity.SystemDic; import com.yeejoin.equipmanage.common.entity.SystemDic;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 服务类 * 服务类
...@@ -29,7 +30,7 @@ public interface IScrapService extends IService<Scrap> { ...@@ -29,7 +30,7 @@ public interface IScrapService extends IService<Scrap> {
void scrapOnCar(Long id); void scrapOnCar(Long id);
void scrapOnPerson(Long id); void scrapOnPerson(Map<String, Object> map, AgencyUserModel agencyUserModel);
void delPerson(Long id); void delPerson(Long id);
} }
...@@ -24,7 +24,7 @@ public interface IStockDetailService extends IService<StockDetail> { ...@@ -24,7 +24,7 @@ public interface IStockDetailService extends IService<StockDetail> {
IPage<StockDetail> pagePlaceEquip(Page<StockDetail> pageBean, Long equipmentDetailId, Long warehouseStructureId); IPage<StockDetail> pagePlaceEquip(Page<StockDetail> pageBean, Long equipmentDetailId, Long warehouseStructureId);
List<StockDetail> loadOnPerson(List<String> ids); List<StockDetail> loadOnPerson(List<Map<String, Number>> stocks);
StockDetail unloadPerson(Map<String, Object> map); StockDetail unloadPerson(Map<String, Object> map);
......
...@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
.collect(Collectors.groupingBy(EquipmentIndex::getEquipmentId)); .collect(Collectors.groupingBy(EquipmentIndex::getEquipmentId));
Map<Long, Unit> unitMap = iUnitService.list().stream().collect(Collectors.toMap(Unit::getId, t -> t)); Map<Long, Unit> unitMap = iUnitService.list().stream().collect(Collectors.toMap(Unit::getId, t -> t));
Map<Long, EquipmentCategory> categoryMap = equipmentCategoryMapper.selectList(null).stream().collect(Collectors.toMap(EquipmentCategory::getId, t -> t)); Map<Long, EquipmentCategory> categoryMap = equipmentCategoryMapper.selectList(null).stream().collect(Collectors.toMap(EquipmentCategory::getId, t -> t));
for (Equipment equipment : list) { for (int i = 0; i <list.size(); i++) {
Equipment equipment = list.get(i);
EquipmentCategory equipmentCategory = categoryMap.get(equipment.getCategoryId());
String categoryCode = equipment.getCode();
// 移除非消耗性设备
if (Objects.isNull(equipmentCategory) || !Objects.equals(equipmentCategory.getIndustryCode(), "2") || categoryCode.charAt(0) == '2' || categoryCode.charAt(0) == '9') {
list.remove(equipment);
i--;
continue;
}
List<EquipmentIndex> quotaList = equipmentIndexMap.get(equipment.getId().toString()); List<EquipmentIndex> quotaList = equipmentIndexMap.get(equipment.getId().toString());
List<EquProperty> properList = new ArrayList<EquProperty>(); List<EquProperty> properList = new ArrayList<EquProperty>();
if (CollUtil.isNotEmpty(quotaList)) { if (CollUtil.isNotEmpty(quotaList)) {
...@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
properList.add(equProperty); properList.add(equProperty);
} }
} }
EquipmentCategory equipmentCategory = categoryMap.get(equipment.getCategoryId());
if (ObjectUtils.isNotEmpty(equipmentCategory)) { if (ObjectUtils.isNotEmpty(equipmentCategory)) {
equipment.setEquipCategoryId(equipmentCategory.getId()); equipment.setEquipCategoryId(equipmentCategory.getId());
equipment.setEquipCategoryCode(equipmentCategory.getCode()); equipment.setEquipCategoryCode(equipmentCategory.getCode());
......
...@@ -1156,17 +1156,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1156,17 +1156,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<AlarmDataVO> list = this.baseMapper.getSystemById(id); List<AlarmDataVO> list = this.baseMapper.getSystemById(id);
// 部件总数 // 部件总数
Integer equipmentCount = equipmentSpecificMapper.selectCount( Integer equipmentCount = equipmentSpecificMapper.selectCount(
Wrappers.<EquipmentSpecific>lambdaQuery().eq(EquipmentSpecific::getSystemId, id) Wrappers.<EquipmentSpecific>lambdaQuery()
.eq(EquipmentSpecific::getSystemId, id)
.eq(EquipmentSpecific::getSingle, true)
); );
// 今日报警次数 // 未复归设备
Integer alarmCount = equipmentSpecificAlarmLogMapper.selectCount( List<EquipmentSpecificAlarmLog> equipSpecIds = equipmentSpecificAlarmLogMapper.selectList(
Wrappers.<EquipmentSpecificAlarmLog>lambdaQuery() Wrappers.<EquipmentSpecificAlarmLog>lambdaQuery()
.select(EquipmentSpecificAlarmLog::getEquipmentSpecificId)
.like(EquipmentSpecificAlarmLog::getSystemIds, id) .like(EquipmentSpecificAlarmLog::getSystemIds, id)
.eq(EquipmentSpecificAlarmLog::getStatus, "1") .eq(EquipmentSpecificAlarmLog::getStatus, "1")
.likeRight(EquipmentSpecificAlarmLog::getCreateDate, LocalDate.now().toString())
); );
int count = (int) equipSpecIds.stream().map(EquipmentSpecificAlarmLog::getEquipmentSpecificId).distinct().count();
list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false)); list.add(new AlarmDataVO("部件总数", equipmentCount + " 个", false));
list.add(new AlarmDataVO("今日报警次数", alarmCount + " 次", false)); list.add(new AlarmDataVO("未复归设备", count + " 个", false));
return list; return list;
} }
......
...@@ -72,6 +72,7 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements ...@@ -72,6 +72,7 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
scrap.setBillCode(stockBillService.generateQrCode("BF")); scrap.setBillCode(stockBillService.generateQrCode("BF"));
scrap.setBillType(type); scrap.setBillType(type);
scrap.setStatus(TaskStatusEnum.INPROGRESS.getCode()); scrap.setStatus(TaskStatusEnum.INPROGRESS.getCode());
scrap.setUserId(Long.valueOf(agencyUserModel.getUserId()));
scrap.setCreatorName(agencyUserModel.getRealName()); scrap.setCreatorName(agencyUserModel.getRealName());
scrapService.save(scrap); scrapService.save(scrap);
for (ScrapDetail scrapDetail : list) { for (ScrapDetail scrapDetail : list) {
...@@ -312,15 +313,20 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements ...@@ -312,15 +313,20 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
} }
@Override @Override
public void scrapOnPerson(Long id) { @Transactional
// QueryWrapper<StockDetail> queryWrapper = new QueryWrapper<>(); public void scrapOnPerson(Map<String, Object> map, AgencyUserModel agencyUserModel) {
// StockDetail stockDetail = stockDetailService.getOne(queryWrapper.eq("equipment_specific_id", id)); Long id = Long.valueOf(map.get("stockDetailId").toString());
double amount = Double.parseDouble(map.get("amount").toString());
StockDetail stockDetail = stockDetailService.getById(id); StockDetail stockDetail = stockDetailService.getById(id);
if (null == stockDetail) { if (null == stockDetail) {
throw new RuntimeException("id为"+ id + "的StockDetail实体不存在!"); throw new RuntimeException("id为"+ id + "的StockDetail实体不存在!");
} }
stockDetail.setStatus(String.valueOf(EquipStatusEnum.SCRAP.getCode()));
stockDetailService.updateById(stockDetail); stockDetailService.updateById(stockDetail);
// 添加报废流程
ScrapDetail scrapDetail = new ScrapDetail();
scrapDetail.setStockDetailId(stockDetail.getId());
scrapDetail.setAmount(amount);
this.create(Collections.singletonList(scrapDetail), BillContentEnum.ZB.getCode(), agencyUserModel);
} }
@Override @Override
......
...@@ -144,15 +144,20 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock ...@@ -144,15 +144,20 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock
} }
@Override @Override
public List<StockDetail> loadOnPerson(List<String> ids) { public List<StockDetail> loadOnPerson(List<Map<String, Number>> stocks) {
List<StockDetail> list = new ArrayList<>(); List<StockDetail> list = new ArrayList<>();
ids.forEach(x -> { stocks.forEach(x -> {
StockDetail stockDetail = this.baseMapper.selectById(Long.valueOf(x)); StockDetail stockDetail = this.baseMapper.selectById(Long.valueOf(x.get("stockDetailId").toString()));
if (null == stockDetail) { if (null == stockDetail) {
throw new RuntimeException("id 为"+ x + "的StockDetail不存在 !"); throw new RuntimeException("id 为"+ x + "的StockDetail不存在 !");
} }
stockDetail.setStatus(String.valueOf(EquipStatusEnum.LOAD.getCode())); double stockAmount = stockDetail.getAmount() - Double.parseDouble(x.get("amount").toString());
stockDetail.setAmount(Math.abs(stockDetail.getAmount() - 1.0)); if (stockAmount < 0) {
throw new RuntimeException("库存不足");
} else if (stockAmount == 0) {
stockDetail.setStatus(String.valueOf(EquipStatusEnum.LOAD.getCode()));
}
stockDetail.setAmount(stockAmount);
this.baseMapper.updateById(stockDetail); this.baseMapper.updateById(stockDetail);
list.add(stockDetail); list.add(stockDetail);
}); });
...@@ -196,12 +201,14 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock ...@@ -196,12 +201,14 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock
@Override @Override
public StockDetail unloadPerson(Map<String, Object> map) { public StockDetail unloadPerson(Map<String, Object> map) {
// Long structureId = Long.valueOf(String.valueOf(map.get("warehouseStructureId")));
Long stockDetailId = Long.valueOf(String.valueOf(map.get("stockDetailId"))); Long stockDetailId = Long.valueOf(String.valueOf(map.get("stockDetailId")));
double amount = Double.parseDouble(String.valueOf(map.get("amount")));
if (amount == 0) {
throw new RuntimeException("数量不能为空");
}
StockDetail stockDetail = this.baseMapper.selectById(stockDetailId); StockDetail stockDetail = this.baseMapper.selectById(stockDetailId);
stockDetail.setStatus(String.valueOf(EquipStatusEnum.REPERTORY.getCode()));//陈浩修改,原本退装枚举值所对应的jcs逻辑是回库,现确定为在位状态 stockDetail.setStatus(String.valueOf(EquipStatusEnum.REPERTORY.getCode()));//陈浩修改,原本退装枚举值所对应的jcs逻辑是回库,现确定为在位状态
// stockDetail.setWarehouseStructureId(structureId); stockDetail.setAmount(stockDetail.getAmount() + amount);
stockDetail.setAmount(stockDetail.getAmount() + 1.0);
this.baseMapper.updateById(stockDetail); this.baseMapper.updateById(stockDetail);
return stockDetail; return stockDetail;
} }
......
...@@ -26,10 +26,7 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -26,10 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -71,8 +68,10 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap ...@@ -71,8 +68,10 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
public WlSpareEquipment saveOrUpdateSpareEquipment(WlSpareEquipment wlSpareEquipment, ReginParams reginParams) { public WlSpareEquipment saveOrUpdateSpareEquipment(WlSpareEquipment wlSpareEquipment, ReginParams reginParams) {
wlSpareEquipment.setBizOrgName(reginParams.getPersonIdentity().getCompanyName()); wlSpareEquipment.setBizOrgName(reginParams.getPersonIdentity().getCompanyName());
wlSpareEquipment.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode()); wlSpareEquipment.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
WarehouseStructure warehouseStructure = warehouseStructureMapper.selectById(wlSpareEquipment.getWarehouseStructureId()); if (Objects.nonNull(wlSpareEquipment.getWarehouseStructureId())) {
wlSpareEquipment.setWarehouseStructureCode(warehouseStructure.getCode()); WarehouseStructure warehouseStructure = warehouseStructureMapper.selectById(wlSpareEquipment.getWarehouseStructureId());
wlSpareEquipment.setWarehouseStructureCode(warehouseStructure.getCode());
}
if (ObjectUtils.isEmpty(wlSpareEquipment.getId())) { if (ObjectUtils.isEmpty(wlSpareEquipment.getId())) {
wlSpareEquipmentMapper.insert(wlSpareEquipment); wlSpareEquipmentMapper.insert(wlSpareEquipment);
} else { } else {
...@@ -147,7 +146,13 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap ...@@ -147,7 +146,13 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
@Override @Override
public Page<WlSpareEquipment> listByPage(WlSpareEquipment dto, Page page, int hierarchy, String codeHead) { public Page<WlSpareEquipment> listByPage(WlSpareEquipment dto, Page page, int hierarchy, String codeHead) {
return wlSpareEquipmentMapper.listByPage(page, dto, hierarchy, codeHead); Page<WlSpareEquipment> wlSpareEquipmentPage = wlSpareEquipmentMapper.listByPage(page, dto, hierarchy, codeHead);
List<WlSpareEquipment> records = wlSpareEquipmentPage.getRecords();
for (WlSpareEquipment record : records) {
record.setImg(getEquipFileList(record.getId(), FileTypeEnum.image.toString()));
}
wlSpareEquipmentPage.setRecords(records);
return wlSpareEquipmentPage;
} }
@Override @Override
...@@ -235,14 +240,12 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap ...@@ -235,14 +240,12 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
@Override @Override
public void subtractNum(Long id, Float num) { public void subtractNum(Long id, Float num) {
synchronized (id.toString()) { WlSpareEquipment wlSpareEquipment = this.getById(id);
WlSpareEquipment wlSpareEquipment = this.getById(id); if (num > wlSpareEquipment.getStockNum()) {
if (num > wlSpareEquipment.getStockNum()) { throw new BadRequest("使用数量大于备品备件库存数量");
throw new BadRequest("使用数量大于备品备件库存数量");
}
wlSpareEquipment.setStockNum(wlSpareEquipment.getStockNum() - num);
this.updateById(wlSpareEquipment);
} }
wlSpareEquipment.setStockNum(wlSpareEquipment.getStockNum() - num);
this.updateById(wlSpareEquipment);
} }
@Override @Override
......
...@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller; ...@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -174,6 +176,16 @@ public class FirefightersJacketController extends BaseController { ...@@ -174,6 +176,16 @@ public class FirefightersJacketController extends BaseController {
} }
/** /**
* 分页查询设备数量(调用装备接口)
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "人员装备数量")
@RequestMapping(value = "/person-equip-count", method = RequestMethod.GET)
public ResponseModel<List<Map<String, Object>>> getPersonEquipCount() {
return ResponseHelper.buildResponse(iFirefightersJacketService.getPersonEquipCount());
}
/**
* 分页查询设备列表(调用装备接口) * 分页查询设备列表(调用装备接口)
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -36,6 +36,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke ...@@ -36,6 +36,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Autowired @Autowired
private EquipFeignClient equipFeignClient; private EquipFeignClient equipFeignClient;
@Autowired
private FirefightersJacketMapper firefightersJacketMapper;
@Override
public List<Map<String, Object>> getPersonEquipCount() {
return firefightersJacketMapper.getPersonEquipCount();
}
@Override @Override
public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) { public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) {
...@@ -47,9 +54,15 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke ...@@ -47,9 +54,15 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Override @Override
public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) { public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) {
List<Long> ids = equipmentOnCarDtos.stream().map(EquipmentOnCarDto::getStockDetailId).collect(Collectors.toList()); List<Map<String, Number>> stocks = new ArrayList<>();
List<Object> result = equipFeignClient.stockBindEquip(ids).getResult(); for (EquipmentOnCarDto dto : equipmentOnCarDtos) {
if (result.size() > 0) { stocks.add(new HashMap<String, Number>() {{
this.put("stockDetailId", dto.getStockDetailId());
this.put("amount", dto.getAmount());
}});
}
List<Object> result = equipFeignClient.stockBindEquip(stocks).getResult();
if (!result.isEmpty()) {
List<FirefightersJacket> firefightersJackets = new ArrayList<>(); List<FirefightersJacket> firefightersJackets = new ArrayList<>();
equipmentOnCarDtos.forEach(x -> { equipmentOnCarDtos.forEach(x -> {
FirefightersJacket firefightersJacket = new FirefightersJacket(); FirefightersJacket firefightersJacket = new FirefightersJacket();
...@@ -70,11 +83,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke ...@@ -70,11 +83,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Override @Override
public boolean update(String type, FirefightersJacket firefightersJacket) { public boolean update(String type, FirefightersJacket firefightersJacket) {
ResponseModel<Object> objectResponseModel = null; ResponseModel<Object> objectResponseModel = null;
if (EquipTypeEnum.退装.getKey().equals(type)) { Map<String, Object> map = new HashMap<>();
objectResponseModel = equipFeignClient.scrapEquip(String.valueOf(firefightersJacket.getStockDetailId())); map.put("firefightersId", firefightersJacket.getFirefightersId());
map.put("stockDetailId", firefightersJacket.getStockDetailId());
map.put("amount", firefightersJacket.getAmount());
if (EquipTypeEnum.报废.getKey().equals(type)) {
objectResponseModel = equipFeignClient.scrapEquip(map);
} else if (EquipTypeEnum.回库.getKey().equals(type)) { } else if (EquipTypeEnum.回库.getKey().equals(type)) {
Map<String, Object> map = new HashMap<>();
map.put("stockDetailId", firefightersJacket.getStockDetailId());
objectResponseModel = equipFeignClient.stockEquip(map); objectResponseModel = equipFeignClient.stockEquip(map);
} }
if (ValidationUtil.isEmpty(objectResponseModel)){ if (ValidationUtil.isEmpty(objectResponseModel)){
......
...@@ -51,7 +51,14 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD ...@@ -51,7 +51,14 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
@Override @Override
public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) { public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) {
List<Long> ids = equipmentOnCarDtos.stream().map(EquipmentOnCarDto::getStockDetailId).collect(Collectors.toList()); List<Long> ids = equipmentOnCarDtos.stream().map(EquipmentOnCarDto::getStockDetailId).collect(Collectors.toList());
List<Object> result = equipFeignClient.stockBindEquip(ids).getResult(); List<Map<String, Number>> stocks = new ArrayList<>();
for (EquipmentOnCarDto dto : equipmentOnCarDtos) {
stocks.add(new HashMap<String, Number>() {{
this.put("id", dto.getStockDetailId());
this.put("amount", dto.getAmount());
}});
}
List<Object> result = equipFeignClient.stockBindEquip(stocks).getResult();
if (result.size() > 0) { if (result.size() > 0) {
List<FirestationJacket> firefightersJackets = new ArrayList<>(); List<FirestationJacket> firefightersJackets = new ArrayList<>();
equipmentOnCarDtos.forEach(x -> { equipmentOnCarDtos.forEach(x -> {
...@@ -73,11 +80,13 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD ...@@ -73,11 +80,13 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
@Override @Override
public boolean update(String type, FirestationJacket firestationJacket) { public boolean update(String type, FirestationJacket firestationJacket) {
ResponseModel<Object> objectResponseModel = null; ResponseModel<Object> objectResponseModel = null;
if (EquipTypeEnum.退装.getKey().equals(type)) { Map<String, Object> map = new HashMap<>();
objectResponseModel = equipFeignClient.scrapEquip(String.valueOf(firestationJacket.getStockDetailId())); map.put("firefightersId", firestationJacket.getFirefightersId());
map.put("stockDetailId", firestationJacket.getStockDetailId());
map.put("amount", firestationJacket.getAmount());
if (EquipTypeEnum.报废.getKey().equals(type)) {
objectResponseModel = equipFeignClient.scrapEquip(map);
} else if (EquipTypeEnum.回库.getKey().equals(type)) { } else if (EquipTypeEnum.回库.getKey().equals(type)) {
Map<String, Object> map = new HashMap<>();
map.put("stockDetailId", firestationJacket.getStockDetailId());
objectResponseModel = equipFeignClient.stockEquip(map); objectResponseModel = equipFeignClient.stockEquip(map);
} }
if (ValidationUtil.isEmpty(objectResponseModel)){ if (ValidationUtil.isEmpty(objectResponseModel)){
...@@ -87,6 +96,7 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD ...@@ -87,6 +96,7 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
return true; return true;
} }
@Override @Override
public ResponseModel<Object> getEquipByStockDetailId(Long stockDetailId) { public ResponseModel<Object> getEquipByStockDetailId(Long stockDetailId) {
return equipFeignClient.getAirEquipSpecificDetail(stockDetailId); return equipFeignClient.getAirEquipSpecificDetail(stockDetailId);
......
//package com.yeejoin.amos.knowledgebase.config;
//
//import com.baomidou.mybatisplus.core.toolkit.Sequence;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * @author 杨博超
// * @ClassName Config
// * @Deacription TODO
// **/
//@Configuration
//public class Config {
//
// @Bean
// public Sequence sequence() {
// return new Sequence();
// }
//}
...@@ -1139,15 +1139,39 @@ ...@@ -1139,15 +1139,39 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="168623599">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_car" />
</preConditions>
<comment>新增属性数据</comment>
<sql>
alter table `wl_car` add column `max_speed` double(10,2) DEFAULT NULL COMMENT '速度阈值';
alter table `wl_car` add column `phone` varchar(50) DEFAULT NULL COMMENT '联系电话';
alter table `wl_car` add column `driver` varchar(250) DEFAULT NULL COMMENT '司机';
</sql>
</changeSet>
<changeSet author="keyong" id="168623588"> <changeSet author="keyong" id="168623588">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<not> <tableExists tableName="wl_equipment_category" />
<tableExists tableName="wl_equipment_category" />
</not>
</preConditions> </preConditions>
<comment>新增属性数据</comment> <comment>新增属性数据</comment>
<sql> <sql>
INSERT INTO `wl_equipment_category`(`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`, `image`) VALUES (860, '123', '21030000', '消防坦克', 0, NULL, '初始导入', '2024-05-23 15:59:42', '2', NULL); INSERT INTO `wl_equipment_category`(`id`, `parent_id`, `code`, `name`, `is_consumptive`, `description`, `remark`, `create_date`, `industry_code`, `image`) VALUES (860, '123', '21030000', '消防坦克', 0, NULL, '初始导入', '2024-05-23 15:59:42', '2', NULL);
DELETE FROM `wl_equipment_category` WHERE id = 759;
</sql>
</changeSet>
<changeSet author="keyong" id="1694056788">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_car" columnName="use_type"/>
</not>
</preConditions>
<comment>新增字段 type_code</comment>
<sql>
alter table `wl_car` add column `use_type` varchar(20) DEFAULT '自购' COMMENT '使用方式';
UPDATE `wl_car` wc SET wc.use_type = '自购';
</sql> </sql>
</changeSet> </changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -2100,109 +2100,117 @@ ...@@ -2100,109 +2100,117 @@
<select id="getColaCategoryAmountEquList" resultMap="CategoryAmountList"> <select id="getColaCategoryAmountEquList" resultMap="CategoryAmountList">
SELECT SELECT
wles.id, wles.id,
wles.qr_code, wles.qr_code,
CONCAT('01#',wles.qr_code) fullqrCode, CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard, wled.standard,
wle.img, wle.img,
wles.name equipmentName, wles.name equipmentName,
wec.name as systemType, wec.name as systemType,
concat_ws('-',wlws.full_name,wled.area) as full_name, concat_ws('-',wlws.full_name,wled.area) as full_name,
wlws.name as belongBuildName, wlws.name as belongBuildName,
wlun.NAME unitName, wlun.NAME unitName,
wles.system_id as systemId, wles.system_id as systemId,
wlsd.amount, wlsd.amount,
wlsd.id as stockDetailId, wlsd.id as stockDetailId,
'equipment' as type, 'equipment' as type,
wlai.`name` manufacturerName, wlai.`name` manufacturerName,
wles.code, wles.code,
wles.iot_code as iotCode, wles.iot_code as iotCode,
case wlsd.`status` case wlsd.`status`
when '1' then '在位' when '1' then '在位'
when '2' then '执勤' when '2' then '执勤'
when '3' then '维修' when '3' then '维修'
when '6' then '退役' when '6' then '退役'
when '7' then '报废' when '7' then '报废'
when '10' then '车载' when '10' then '车载'
when '11' then '损耗' when '11' then '损耗'
when '12' then '配装' when '12' then '配装'
else '未入库' END as status, else '未入库' END as status,
wles.create_date as createDate, wles.create_date as createDate,
wled.code as eqtype, wled.code as eqtype,
wles.biz_org_code as bizOrgCode, wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName, wles.biz_org_name as bizOrgName,
wles.equip_status as equipStatus wles.equip_status as equipStatus,
FROM wec.industry_code as industryCode,
(select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id,equip_status from wl_equipment_specific) wles wle.is_iot as wleIsIot
LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id FROM
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id (select id,name,qr_code,code ,iot_code ,biz_org_code,team_id ,biz_org_name,create_date ,equipment_detail_id ,system_id,equip_status from wl_equipment_specific) wles
LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id LEFT JOIN (select id,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id LEFT JOIN (select id,standard ,name ,area ,code, equipment_id ,manufacturer_id,is_import from wl_equipment_detail) wled on wles.equipment_detail_id = wled.id
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id LEFT JOIN wl_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
WHERE 1=1 LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
<if test="codeHead!=null and codeHead!='' and codeHead!=' '"> LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead} WHERE 1=1
<!-- and wec.`code` like concat(#{codeHead}, '%')--> <if test="codeHead!=null and codeHead!='' and codeHead!=' '">
</if> and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
<if test="equipTypeAmountPage.industryCode!=null"> <!-- and wec.`code` like concat(#{codeHead}, '%')-->
and wec.industry_code = #{equipTypeAmountPage.industryCode} </if>
</if>
<if test="equipTypeAmountPage.teamId!=null"> <if test="equipTypeAmountPage.teamId!=null">
and wles.team_id = #{equipTypeAmountPage.teamId} and wles.team_id = #{equipTypeAmountPage.teamId}
</if> </if>
<if test="equipTypeAmountPage.systemId!=null"> <if test="equipTypeAmountPage.systemId!=null">
and wles.system_id = #{equipTypeAmountPage.systemId} and wles.system_id = #{equipTypeAmountPage.systemId}
</if> </if>
<if test="equipTypeAmountPage.manufacturerId!=null"> <if test="equipTypeAmountPage.manufacturerId!=null">
and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId} and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if> </if>
<if test="equipTypeAmountPage.isImport!=null"> <if test="equipTypeAmountPage.isImport!=null">
and wled.is_import = #{equipTypeAmountPage.isImport} and wled.is_import = #{equipTypeAmountPage.isImport}
</if> </if>
<if test="equipTypeAmountPage.warehouseStructureId!=null"> <if test="equipTypeAmountPage.warehouseStructureId!=null">
and wlsd.warehouse_structure_id in ( and wlsd.warehouse_structure_id in (
select id from wl_warehouse_structure where parent_id in( select id from wl_warehouse_structure where parent_id in(
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId}) select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId})
union union
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or
id = #{equipTypeAmountPage.warehouseStructureId} id = #{equipTypeAmountPage.warehouseStructureId}
) )
</if> </if>
<if test="equipTypeAmountPage.status == 1"> <if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null and wlsd.warehouse_structure_id is null
</if> </if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=#{equipTypeAmountPage.isIot} <if test="equipTypeAmountPage.status == 0">
</if> and wlsd.warehouse_structure_id is not null
<if test="equipTypeAmountPage.status == 0"> </if>
and wlsd.warehouse_structure_id is not null <if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
</if> AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''"> </if>
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%') <if test="equipTypeAmountPage.nameOrCode!=null and equipTypeAmountPage.nameOrCode!=''">
</if> AND (wled.name LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%') or wles.code LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%'))
<if test="equipTypeAmountPage.nameOrCode!=null and equipTypeAmountPage.nameOrCode!=''"> </if>
AND (wled.name LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%') or wles.code LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%')) <if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
</if> AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''"> </if>
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%') <if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
</if> AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''"> </if>
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if> <if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
AND concat_ws('-',wlws.full_name,wled.area) LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
AND wles.biz_org_code LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
group by wles.id
having 1 = 1
<if test="equipTypeAmountPage.industryCode!=null">
AND industryCode = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.isIot!=null">
AND wleIsIot = #{equipTypeAmountPage.isIot}
</if>
order by createDate DESC
</select>
<if test="equipTypeAmountPage.warehouseStructureName!=null and equipTypeAmountPage.warehouseStructureName!=''">
AND concat_ws('-',wlws.full_name,wled.area) LIKE CONCAT('%',#{equipTypeAmountPage.warehouseStructureName},'%')
</if>
<if test="equipTypeAmountPage.bizOrgCode!=null and equipTypeAmountPage.bizOrgCode!=''">
AND wles.biz_org_code LIKE CONCAT(#{equipTypeAmountPage.bizOrgCode},'%')
</if>
order by createDate DESC
</select>
<select id="listByBizOrgCode" resultType="java.util.Map"> <select id="listByBizOrgCode" resultType="java.util.Map">
SELECT SELECT
......
...@@ -53,6 +53,8 @@ ...@@ -53,6 +53,8 @@
</where> </where>
GROUP BY GROUP BY
a.equip_model_id a.equip_model_id
HAVING
sum( a.stock_num ) != 0
</select> </select>
<select id="exportList" resultType="com.yeejoin.equipmanage.common.entity.WlSpareEquipment"> <select id="exportList" resultType="com.yeejoin.equipmanage.common.entity.WlSpareEquipment">
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
, ,
{ {
"code": "scrapPut", "code": "scrapPut",
"emqTopic": "equip/scrap/put", "emqTopic": "equip/scrap/put/zxj",
"akkaTopic": "JKXT2BP-XFYY-Topic" "akkaTopic": "JKXT2BP-XFYY-Topic"
} }
] ]
\ No newline at end of file
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