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 {
* @return
*/
@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 {
* @return
*/
@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 {
**/
@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);
/**
* 车辆信息详情
**/
......@@ -365,7 +365,7 @@ public interface EquipFeignClient {
@RequestMapping(value = "/perf-quota/listAll", method = RequestMethod.POST)
ResponseModel<List<EquipmentIndexDto>> getEquipmentIndexDto(@RequestBody PerfQuotaIotDTO perfQuotaIotDTO);
@RequestMapping(value = "/car/{id}", method = RequestMethod.GET)
ResponseModel<Map<String, Object>> selectOneById( @PathVariable("id") Long id);
......@@ -384,17 +384,17 @@ public interface EquipFeignClient {
@RequestMapping(value = "/equipment/list/{typeCode}", method = RequestMethod.GET)
ResponseModel<List<Object>> getEquipmentList(@PathVariable("typeCode") String typeCode);
@RequestMapping(value = "equipment-category/list-tree", method = RequestMethod.GET)
ResponseModel<Object> list() ;
//获取消防装备权限
@RequestMapping(value = "/equipment-detail/permissions/export", method = RequestMethod.GET)
ResponseModel<ReginParams> getPermissions() ;
@RequestMapping(value = "/building/getBuildingList", method = RequestMethod.GET)
ResponseModel<List<Map<String, Object>>> getBuildingTreeList();
@RequestMapping(value = "/building/companyBuildingTree", method = RequestMethod.GET)
public ResponseModel<Object> getCompanyBuildingTree();
......
......@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
import java.util.List;
import java.util.Map;
/**
* 消防人员配装记录 Mapper 接口
*
......@@ -11,4 +14,6 @@ import com.yeejoin.amos.boot.module.common.api.entity.FirefightersJacket;
*/
public interface FirefightersJacketMapper extends BaseMapper<FirefightersJacket> {
List<Map<String, Object>> getPersonEquipCount();
}
<?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">
<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>
......@@ -1520,7 +1520,7 @@
) g ON u.sequence_nbr = g.instance_id
WHERE
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
<if test="bizOrgCode != null and bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{bizOrgCode}, '%')
......@@ -1535,6 +1535,8 @@
LEFT JOIN ( SELECT * FROM cb_data_dictionary WHERE type = 'XFGLGW' ) b ON LOCATE( b.CODE, a.fireManagementPost ) != 0
WHERE
a.sequenceNbr IS NOT NULL AND b.`name` IS NOT NULL
GROUP BY
sequenceNbr
) a
GROUP BY
postName
......@@ -1642,6 +1644,7 @@
u.biz_org_type = 'person'
AND g.peopleType IN ('1601', '1602', '1603')
AND u.is_delete = 0
AND cf.biz_org_name is not null
<if test="map.bizOrgCode != null and map.bizOrgCode != ''">
AND u.biz_org_code LIKE CONCAT(#{map.bizOrgCode}, '%')
</if>
......
......@@ -249,4 +249,8 @@ public class Car extends BaseEntity {
@TableField(exist = false)
private String equipStatusFilter;
@ApiModelProperty(value = "使用方式")
private String useType;
}
......@@ -13,7 +13,7 @@ public enum EquipTypeEnum {
/**
* 退库,回库
*/
退装("scrap", "退装"),
报废("scrap", "报废"),
回库("stock", "回库");
private String key;
......
......@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.EquipmentOnCarDto;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* 消防人员配装记录 服务类
......@@ -16,6 +17,8 @@ import java.util.List;
*/
public interface IFirefightersJacketService {
List<Map<String, Object>> getPersonEquipCount();
ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size);
boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos);
......
......@@ -267,6 +267,9 @@ public class EquipmentSpecificController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "POST", value = "列表分页查询", notes = "列表分页查询")
public IPage<EquipmentOnCarVo> onCarVoIPage(@RequestBody EquipmentSpecificDto equipmentSpecificDto) {
ReginParams ReginParams = getSelectedOrgInfo();
String bizOrgCode= ReginParams.getPersonIdentity().getBizOrgCode();
equipmentSpecificDto.setBizOrgCode(bizOrgCode);
return equipmentSpecificSerivce.onCarVoIPage(equipmentSpecificDto);
}
......
......@@ -27,9 +27,10 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
*
*
* @author wujiang
* @date 2020-07-07
......@@ -44,7 +45,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 新增
*
*
* @return
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
......@@ -56,7 +57,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 根据id删除
*
*
* @param id
* @return
*/
......@@ -69,7 +70,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 修改
*
*
* @return
*/
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
......@@ -81,7 +82,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 根据id查询
*
*
* @param id
* @return
*/
......@@ -94,7 +95,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 列表分页查询
*
*
* @return
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
......@@ -143,7 +144,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 新建报废
*
*
* @param list
* @return
*/
......@@ -156,7 +157,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 执行报废
*
*
* @param param
* @return
*/
......@@ -172,7 +173,7 @@ public class ScrapController extends AbstractBaseController {
/**
* 执行报废
*
*
* @param
* @return
*/
......@@ -222,9 +223,9 @@ public class ScrapController extends AbstractBaseController {
@RequestMapping(value = "/airport/person", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@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 {
iScrapService.scrapOnPerson(Long.valueOf(id));
iScrapService.scrapOnPerson(map, getUserInfo());
} catch (Exception e) {
return CommonResponseUtil.failure("人员装备报废失败!");
}
......
......@@ -40,7 +40,7 @@ public class StockDetailController {
/**
* 新增库存明细
*
*
* @return
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
......@@ -52,7 +52,7 @@ public class StockDetailController {
/**
* 根据id删除
*
*
* @param id
* @return
*/
......@@ -65,7 +65,7 @@ public class StockDetailController {
/**
* 修改库存明细
*
*
* @return
*/
@RequestMapping(value = "/updateById", method = RequestMethod.PUT)
......@@ -77,7 +77,7 @@ public class StockDetailController {
/**
* 根据id查询
*
*
* @param id
* @return
*/
......@@ -90,7 +90,7 @@ public class StockDetailController {
/**
* 列表分页查询
*
*
* @return
*/
@RequestMapping(value = "/list", method = RequestMethod.GET)
......@@ -137,7 +137,7 @@ public class StockDetailController {
/**
* 指定位置指定分类下库存查询 以分类为主(灭火药剂入账列表)
*
*
* @return
*/
@RequestMapping(value = "/category", method = RequestMethod.GET)
......@@ -158,7 +158,7 @@ public class StockDetailController {
/**
* 指定位置指定分类库存查询 以库存为主(灭火药剂装载列表)
*
*
* @return
*/
@RequestMapping(value = "/stock", method = RequestMethod.GET)
......@@ -180,7 +180,7 @@ public class StockDetailController {
/**
* 列表分页查询
*
*
* @return
*/
@RequestMapping(value = "/place/equipment", method = RequestMethod.GET)
......@@ -215,10 +215,10 @@ public class StockDetailController {
@RequestMapping(value = "/airport/person/bind", method = RequestMethod.POST)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@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;
if (0 < ids.size()) {
stockDetails = iStockDetailService.loadOnPerson(ids);
if (!stocks.isEmpty()) {
stockDetails = iStockDetailService.loadOnPerson(stocks);
}
return CommonResponseUtil.success(stockDetails);
}
......
......@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.ScrapDetail;
import com.yeejoin.equipmanage.common.entity.SystemDic;
import java.util.List;
import java.util.Map;
/**
* 服务类
......@@ -29,7 +30,7 @@ public interface IScrapService extends IService<Scrap> {
void scrapOnCar(Long id);
void scrapOnPerson(Long id);
void scrapOnPerson(Map<String, Object> map, AgencyUserModel agencyUserModel);
void delPerson(Long id);
}
......@@ -24,7 +24,7 @@ public interface IStockDetailService extends IService<StockDetail> {
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);
......
......@@ -355,7 +355,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
.collect(Collectors.groupingBy(EquipmentIndex::getEquipmentId));
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));
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<EquProperty> properList = new ArrayList<EquProperty>();
if (CollUtil.isNotEmpty(quotaList)) {
......@@ -371,7 +380,6 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
properList.add(equProperty);
}
}
EquipmentCategory equipmentCategory = categoryMap.get(equipment.getCategoryId());
if (ObjectUtils.isNotEmpty(equipmentCategory)) {
equipment.setEquipCategoryId(equipmentCategory.getId());
equipment.setEquipCategoryCode(equipmentCategory.getCode());
......
......@@ -1156,17 +1156,20 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
List<AlarmDataVO> list = this.baseMapper.getSystemById(id);
// 部件总数
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()
.select(EquipmentSpecificAlarmLog::getEquipmentSpecificId)
.like(EquipmentSpecificAlarmLog::getSystemIds, id)
.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("今日报警次数", alarmCount + " 次", false));
list.add(new AlarmDataVO("未复归设备", count + " 个", false));
return list;
}
......
......@@ -72,6 +72,7 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
scrap.setBillCode(stockBillService.generateQrCode("BF"));
scrap.setBillType(type);
scrap.setStatus(TaskStatusEnum.INPROGRESS.getCode());
scrap.setUserId(Long.valueOf(agencyUserModel.getUserId()));
scrap.setCreatorName(agencyUserModel.getRealName());
scrapService.save(scrap);
for (ScrapDetail scrapDetail : list) {
......@@ -312,15 +313,20 @@ public class ScrapServiceImpl extends ServiceImpl<ScrapMapper, Scrap> implements
}
@Override
public void scrapOnPerson(Long id) {
// QueryWrapper<StockDetail> queryWrapper = new QueryWrapper<>();
// StockDetail stockDetail = stockDetailService.getOne(queryWrapper.eq("equipment_specific_id", id));
@Transactional
public void scrapOnPerson(Map<String, Object> map, AgencyUserModel agencyUserModel) {
Long id = Long.valueOf(map.get("stockDetailId").toString());
double amount = Double.parseDouble(map.get("amount").toString());
StockDetail stockDetail = stockDetailService.getById(id);
if (null == stockDetail) {
throw new RuntimeException("id为"+ id + "的StockDetail实体不存在!");
}
stockDetail.setStatus(String.valueOf(EquipStatusEnum.SCRAP.getCode()));
stockDetailService.updateById(stockDetail);
// 添加报废流程
ScrapDetail scrapDetail = new ScrapDetail();
scrapDetail.setStockDetailId(stockDetail.getId());
scrapDetail.setAmount(amount);
this.create(Collections.singletonList(scrapDetail), BillContentEnum.ZB.getCode(), agencyUserModel);
}
@Override
......
......@@ -144,15 +144,20 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock
}
@Override
public List<StockDetail> loadOnPerson(List<String> ids) {
public List<StockDetail> loadOnPerson(List<Map<String, Number>> stocks) {
List<StockDetail> list = new ArrayList<>();
ids.forEach(x -> {
StockDetail stockDetail = this.baseMapper.selectById(Long.valueOf(x));
stocks.forEach(x -> {
StockDetail stockDetail = this.baseMapper.selectById(Long.valueOf(x.get("stockDetailId").toString()));
if (null == stockDetail) {
throw new RuntimeException("id 为"+ x + "的StockDetail不存在 !");
}
stockDetail.setStatus(String.valueOf(EquipStatusEnum.LOAD.getCode()));
stockDetail.setAmount(Math.abs(stockDetail.getAmount() - 1.0));
double stockAmount = stockDetail.getAmount() - Double.parseDouble(x.get("amount").toString());
if (stockAmount < 0) {
throw new RuntimeException("库存不足");
} else if (stockAmount == 0) {
stockDetail.setStatus(String.valueOf(EquipStatusEnum.LOAD.getCode()));
}
stockDetail.setAmount(stockAmount);
this.baseMapper.updateById(stockDetail);
list.add(stockDetail);
});
......@@ -196,12 +201,14 @@ public class StockDetailServiceImpl extends ServiceImpl<StockDetailMapper, Stock
@Override
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")));
double amount = Double.parseDouble(String.valueOf(map.get("amount")));
if (amount == 0) {
throw new RuntimeException("数量不能为空");
}
StockDetail stockDetail = this.baseMapper.selectById(stockDetailId);
stockDetail.setStatus(String.valueOf(EquipStatusEnum.REPERTORY.getCode()));//陈浩修改,原本退装枚举值所对应的jcs逻辑是回库,现确定为在位状态
// stockDetail.setWarehouseStructureId(structureId);
stockDetail.setAmount(stockDetail.getAmount() + 1.0);
stockDetail.setAmount(stockDetail.getAmount() + amount);
this.baseMapper.updateById(stockDetail);
return stockDetail;
}
......
......@@ -26,10 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
@Service
......@@ -71,8 +68,10 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
public WlSpareEquipment saveOrUpdateSpareEquipment(WlSpareEquipment wlSpareEquipment, ReginParams reginParams) {
wlSpareEquipment.setBizOrgName(reginParams.getPersonIdentity().getCompanyName());
wlSpareEquipment.setBizOrgCode(reginParams.getPersonIdentity().getCompanyBizOrgCode());
WarehouseStructure warehouseStructure = warehouseStructureMapper.selectById(wlSpareEquipment.getWarehouseStructureId());
wlSpareEquipment.setWarehouseStructureCode(warehouseStructure.getCode());
if (Objects.nonNull(wlSpareEquipment.getWarehouseStructureId())) {
WarehouseStructure warehouseStructure = warehouseStructureMapper.selectById(wlSpareEquipment.getWarehouseStructureId());
wlSpareEquipment.setWarehouseStructureCode(warehouseStructure.getCode());
}
if (ObjectUtils.isEmpty(wlSpareEquipment.getId())) {
wlSpareEquipmentMapper.insert(wlSpareEquipment);
} else {
......@@ -147,7 +146,13 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
@Override
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
......@@ -235,14 +240,12 @@ public class WlSpareEquipmentServiceImpl extends ServiceImpl<WlSpareEquipmentMap
@Override
public void subtractNum(Long id, Float num) {
synchronized (id.toString()) {
WlSpareEquipment wlSpareEquipment = this.getById(id);
if (num > wlSpareEquipment.getStockNum()) {
throw new BadRequest("使用数量大于备品备件库存数量");
}
wlSpareEquipment.setStockNum(wlSpareEquipment.getStockNum() - num);
this.updateById(wlSpareEquipment);
WlSpareEquipment wlSpareEquipment = this.getById(id);
if (num > wlSpareEquipment.getStockNum()) {
throw new BadRequest("使用数量大于备品备件库存数量");
}
wlSpareEquipment.setStockNum(wlSpareEquipment.getStockNum() - num);
this.updateById(wlSpareEquipment);
}
@Override
......
......@@ -3,9 +3,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
......@@ -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)
......
......@@ -36,6 +36,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Autowired
private EquipFeignClient equipFeignClient;
@Autowired
private FirefightersJacketMapper firefightersJacketMapper;
@Override
public List<Map<String, Object>> getPersonEquipCount() {
return firefightersJacketMapper.getPersonEquipCount();
}
@Override
public ResponseModel<Page<Object>> getAirEquipSpecificPage(EquipSpecificDto equipSpecificDto, int current, int size) {
......@@ -47,9 +54,15 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Override
public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) {
List<Long> ids = equipmentOnCarDtos.stream().map(EquipmentOnCarDto::getStockDetailId).collect(Collectors.toList());
List<Object> result = equipFeignClient.stockBindEquip(ids).getResult();
if (result.size() > 0) {
List<Map<String, Number>> stocks = new ArrayList<>();
for (EquipmentOnCarDto dto : equipmentOnCarDtos) {
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<>();
equipmentOnCarDtos.forEach(x -> {
FirefightersJacket firefightersJacket = new FirefightersJacket();
......@@ -70,11 +83,13 @@ public class FirefightersJacketServiceImpl extends BaseService<FirefightersJacke
@Override
public boolean update(String type, FirefightersJacket firefightersJacket) {
ResponseModel<Object> objectResponseModel = null;
if (EquipTypeEnum.退装.getKey().equals(type)) {
objectResponseModel = equipFeignClient.scrapEquip(String.valueOf(firefightersJacket.getStockDetailId()));
Map<String, Object> map = new HashMap<>();
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)) {
Map<String, Object> map = new HashMap<>();
map.put("stockDetailId", firefightersJacket.getStockDetailId());
objectResponseModel = equipFeignClient.stockEquip(map);
}
if (ValidationUtil.isEmpty(objectResponseModel)){
......
......@@ -51,7 +51,14 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
@Override
public boolean saveOrUpdateBatch(Long firefightersId, List<EquipmentOnCarDto> equipmentOnCarDtos) {
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) {
List<FirestationJacket> firefightersJackets = new ArrayList<>();
equipmentOnCarDtos.forEach(x -> {
......@@ -73,11 +80,13 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
@Override
public boolean update(String type, FirestationJacket firestationJacket) {
ResponseModel<Object> objectResponseModel = null;
if (EquipTypeEnum.退装.getKey().equals(type)) {
objectResponseModel = equipFeignClient.scrapEquip(String.valueOf(firestationJacket.getStockDetailId()));
Map<String, Object> map = new HashMap<>();
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)) {
Map<String, Object> map = new HashMap<>();
map.put("stockDetailId", firestationJacket.getStockDetailId());
objectResponseModel = equipFeignClient.stockEquip(map);
}
if (ValidationUtil.isEmpty(objectResponseModel)){
......@@ -87,6 +96,7 @@ public class FirestationJacketServiceImpl extends BaseService<FirestationJacketD
return true;
}
@Override
public ResponseModel<Object> getEquipByStockDetailId(Long 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 @@
</sql>
</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">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="wl_equipment_category" />
</not>
<tableExists tableName="wl_equipment_category" />
</preConditions>
<comment>新增属性数据</comment>
<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);
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>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -2100,109 +2100,117 @@
<select id="getColaCategoryAmountEquList" resultMap="CategoryAmountList">
SELECT
wles.id,
wles.qr_code,
CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard,
wle.img,
wles.name equipmentName,
wec.name as systemType,
concat_ws('-',wlws.full_name,wled.area) as full_name,
wlws.name as belongBuildName,
wlun.NAME unitName,
wles.system_id as systemId,
wlsd.amount,
wlsd.id as stockDetailId,
'equipment' as type,
wlai.`name` manufacturerName,
wles.code,
wles.iot_code as iotCode,
case wlsd.`status`
when '1' then '在位'
when '2' then '执勤'
when '3' then '维修'
when '6' then '退役'
when '7' then '报废'
when '10' then '车载'
when '11' then '损耗'
when '12' then '配装'
else '未入库' END as status,
wles.create_date as createDate,
wled.code as eqtype,
wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName,
wles.equip_status as equipStatus
FROM
(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,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.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_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
<!-- and wec.`code` like concat(#{codeHead}, '%')-->
</if>
<if test="equipTypeAmountPage.industryCode!=null">
and wec.industry_code = #{equipTypeAmountPage.industryCode}
</if>
<if test="equipTypeAmountPage.teamId!=null">
and wles.team_id = #{equipTypeAmountPage.teamId}
</if>
<if test="equipTypeAmountPage.systemId!=null">
and wles.system_id = #{equipTypeAmountPage.systemId}
</if>
<if test="equipTypeAmountPage.manufacturerId!=null">
and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if>
<if test="equipTypeAmountPage.isImport!=null">
and wled.is_import = #{equipTypeAmountPage.isImport}
</if>
<if test="equipTypeAmountPage.warehouseStructureId!=null">
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 = #{equipTypeAmountPage.warehouseStructureId})
union
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or
id = #{equipTypeAmountPage.warehouseStructureId}
)
</if>
<if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null
</if>
<if test="equipTypeAmountPage.isIot!=null">
and wle.is_iot=#{equipTypeAmountPage.isIot}
</if>
<if test="equipTypeAmountPage.status == 0">
and wlsd.warehouse_structure_id is not null
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.nameOrCode!=null and equipTypeAmountPage.nameOrCode!=''">
AND (wled.name LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%') or wles.code LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%'))
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
AND wles.iot_code LIKE CONCAT('%',#{equipTypeAmountPage.iotCode},'%')
</if>
SELECT
wles.id,
wles.qr_code,
CONCAT('01#',wles.qr_code) fullqrCode,
wled.standard,
wle.img,
wles.name equipmentName,
wec.name as systemType,
concat_ws('-',wlws.full_name,wled.area) as full_name,
wlws.name as belongBuildName,
wlun.NAME unitName,
wles.system_id as systemId,
wlsd.amount,
wlsd.id as stockDetailId,
'equipment' as type,
wlai.`name` manufacturerName,
wles.code,
wles.iot_code as iotCode,
case wlsd.`status`
when '1' then '在位'
when '2' then '执勤'
when '3' then '维修'
when '6' then '退役'
when '7' then '报废'
when '10' then '车载'
when '11' then '损耗'
when '12' then '配装'
else '未入库' END as status,
wles.create_date as createDate,
wled.code as eqtype,
wles.biz_org_code as bizOrgCode,
wles.biz_org_name as bizOrgName,
wles.equip_status as equipStatus,
wec.industry_code as industryCode,
wle.is_iot as wleIsIot
FROM
(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,amount,status,equipment_specific_id,warehouse_structure_id from wl_stock_detail ) wlsd on wlsd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure wlws on wlsd.warehouse_structure_id = wlws.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_equipment wle ON wle.id = wled.equipment_id
LEFT JOIN wl_unit wlun ON wle.unit_id = wlun.id
LEFT JOIN wl_manufacturer_info wlai on wled.manufacturer_id=wlai.id
LEFT JOIN wl_equipment_category wec ON wle.category_id = wec.id
WHERE 1=1
<if test="codeHead!=null and codeHead!='' and codeHead!=' '">
and LEFT (wle.CODE, #{hierarchy}) = #{codeHead}
<!-- and wec.`code` like concat(#{codeHead}, '%')-->
</if>
<if test="equipTypeAmountPage.teamId!=null">
and wles.team_id = #{equipTypeAmountPage.teamId}
</if>
<if test="equipTypeAmountPage.systemId!=null">
and wles.system_id = #{equipTypeAmountPage.systemId}
</if>
<if test="equipTypeAmountPage.manufacturerId!=null">
and wled.manufacturer_id = #{equipTypeAmountPage.manufacturerId}
</if>
<if test="equipTypeAmountPage.isImport!=null">
and wled.is_import = #{equipTypeAmountPage.isImport}
</if>
<if test="equipTypeAmountPage.warehouseStructureId!=null">
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 = #{equipTypeAmountPage.warehouseStructureId})
union
select id from wl_warehouse_structure where parent_id = #{equipTypeAmountPage.warehouseStructureId} or
id = #{equipTypeAmountPage.warehouseStructureId}
)
</if>
<if test="equipTypeAmountPage.status == 1">
and wlsd.warehouse_structure_id is null
</if>
<if test="equipTypeAmountPage.status == 0">
and wlsd.warehouse_structure_id is not null
</if>
<if test="equipTypeAmountPage.equipmentName!=null and equipTypeAmountPage.equipmentName!=''">
AND wled.name LIKE CONCAT('%',#{equipTypeAmountPage.equipmentName},'%')
</if>
<if test="equipTypeAmountPage.nameOrCode!=null and equipTypeAmountPage.nameOrCode!=''">
AND (wled.name LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%') or wles.code LIKE CONCAT('%',#{equipTypeAmountPage.nameOrCode},'%'))
</if>
<if test="equipTypeAmountPage.code!=null and equipTypeAmountPage.code!=''">
AND wles.code LIKE CONCAT('%',#{equipTypeAmountPage.code},'%')
</if>
<if test="equipTypeAmountPage.iotCode!=null and equipTypeAmountPage.iotCode!=''">
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
......
......@@ -53,6 +53,8 @@
</where>
GROUP BY
a.equip_model_id
HAVING
sum( a.stock_num ) != 0
</select>
<select id="exportList" resultType="com.yeejoin.equipmanage.common.entity.WlSpareEquipment">
......
......@@ -83,7 +83,7 @@
,
{
"code": "scrapPut",
"emqTopic": "equip/scrap/put",
"emqTopic": "equip/scrap/put/zxj",
"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