Commit d4515749 by 李小惠

修改调岗逻辑

parent cc3ef798
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -32,7 +32,7 @@ public class OutInLogsReceiver {
*/
@Resource
private LogRecordApi logRecordApi;
@RabbitListener(queues = "11111")//监听队列名
@RabbitListener(queues = "orderResult")//监听队列名
private void a(String msg, Channel channel, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag){
LogRecordDto logRecordDTO = LogRecordFactory.createLogRecord(LogConstant.LOG_DEFAULT_NAME, "CabinetLogsRecord");
......
......@@ -234,7 +234,6 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
this.save(busForm);
}
}
busFormRepository.save(busForm);
String objJson= redisCache.get(busForm.getProcessId());
redisCache.remove(busForm.getProcessId());
List<MessageSendReq> msgs= JSONObject.parseArray(objJson,MessageSendReq.class);
......
......@@ -1326,7 +1326,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
orderLog= list.get(0);
policeEqsList= policeEquipmentService.list(new LambdaQueryWrapper<PoliceEquipment>()
.eq(PoliceEquipment::getPoliceId, policeman.getId()));
locationId = policeEqsList.get(0).getLocationId();
}
List<Object[]> searchItem=new ArrayList<>();
//判断调岗警员是否已经绑定了箱门
......@@ -1360,7 +1359,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//调岗警员绑定第一个单警柜以后,不管之后他是否还有单警柜,我都默认是不绑了。
// 判断他下面是否有箱门,如果有则表示他已经帮过单警柜并且调岗携带的装备都已经记录过,那么将不再被记录
if (ObjectUtil.isNotNull(orderLog) && list1.size()==0 && !flag && !locationId.trim().isEmpty()){
if (ObjectUtil.isNotNull(orderLog) && list1.size()==0 && !flag ){
flag=true;
cabinetBox = cabinetBoxService.getById(boxId);
......@@ -1509,10 +1508,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
Policeman policeman = getById(req.getPoliceId());
SysDict sysDict = sysDictService.getOne(new LambdaQueryWrapper<SysDict>()
.eq(SysDict::getDictCode, "reassignment_type"));
List<SysDictItem> list = sysDictItemService.list(new LambdaQueryWrapper<SysDictItem>()
.eq(SysDictItem::getDictId, sysDict.getDictId()));
String itemValue = list.get(0).getItemValue();
String itemValue1 = list.get(1).getItemValue();
StringBuilder stringBuilder = new StringBuilder();
Integer inventoryQuantity=0;
Integer actualQuantity=0;
......@@ -1525,7 +1521,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//判断是调入单还是调出单
//0是调入警员,1是调出警员
//assign是调入
if(req.getReassignmentType().equals(itemValue) && itemValue.equals("assign")){
if(req.getReassignmentType().equals("assign")){
//添加账号和组织机构的绑定关系
SysUserOrg sysUserOrg = new SysUserOrg();
sysUserOrg.setOrgId(req.getOrgId());
......@@ -1538,15 +1534,16 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//如果调入的警员携带装备,那么我应该怎么处理呢
stringBuilder.append("警员:"+req.getPoliceName()+",警号为:"+req.getPoliceCode()+",因调岗携带以下装备:");
if(CollectionUtil.isNotEmpty(reqEquipments)){
for (PoliceEquipment equipment:reqEquipments) {
stringBuilder.append(equipment.getTypeName()+
"【"+equipment.getSizeName()+"】,数量为:"+equipment.getNum()+"\n");
inventoryQuantity+=equipment.getNum();
actualQuantity+=equipment.getNum();
}
}
if (CollectionUtil.isNotEmpty(list1)){
for (PoliceEquipment pe:list1) {
......@@ -1557,8 +1554,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
}
//assign是调出
else if (req.getReassignmentType().equals(itemValue1) && itemValue1.equals("reassign")){
//reassign是调出
else if (req.getReassignmentType().equals("reassign")){
//将其组织机构号设为空
policeman.setOrgId(null);
policeman.setState(2);
......@@ -1577,7 +1574,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//更新装备(将装备信息进行删除)
List<PoliceEquipment> updateList=new ArrayList<>();
List<Object[]> searchItem=new ArrayList<>();
stringBuilder.append(req.getOrgName()+"的警员"+req.getPoliceName()+
",警号为:"+req.getPoliceCode()+",因调岗拿走以下装备:");
for (PoliceEquipment policeEquipment:list1) {
......@@ -1585,9 +1581,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
for (PoliceEquipment one:reqEquipments) {
if (policeEquipment.getSizeId().equals(one.getSizeId())
&& policeEquipment.getTypeId().equals(one.getTypeId())){
Object[] item=new Object[]{policeEquipment.getOrgId(),policeEquipment.getLocationId(),
policeEquipment.getTypeId(),policeEquipment.getSizeId(),policeEquipment.getPrice(),one.getNum()};
searchItem.add(item);
stringBuilder.append(policeEquipment.getTypeName()+"【"+policeEquipment.getSizeName()+
"】,原数量:"+policeEquipment.getNum()+",取走:"+one.getNum()+",剩余:"+(policeEquipment.getNum()-one.getNum())+"\n");
inventoryQuantity+=policeEquipment.getNum();
......@@ -1608,6 +1602,34 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
policeEquipmentService.updateBatchById(updateList);
policeEquipmentService.removeBatchByIds(removeList);
List<Object[]> searchItem=new ArrayList<>();
if(CollectionUtil.isNotEmpty(reqEquipments)){
for (PoliceEquipment equipment:reqEquipments) {
stringBuilder.append(equipment.getTypeName()+
"【"+equipment.getSizeName()+"】,数量为:"+equipment.getNum()+"\n");
inventoryQuantity+=equipment.getNum();
actualQuantity+=equipment.getNum();
Object[] item=new Object[]{equipment.getOrgId(),equipment.getLocationId(),equipment.getTypeId(),
equipment.getSizeId(),equipment.getPrice(),0,equipment.getNum()};
searchItem.add(item);
}
List<InventorySummary> inventorySummaryList = inventorySummaryMapper.selectSum(searchItem);
for (InventorySummary is:inventorySummaryList) {
for (Object[] obj:searchItem) {
if (obj[1].equals(is.getLocationId())&& obj[2].equals(is.getTypeId())
&& obj[3].equals(is.getSizeId()) && is.getUnitPrice().compareTo((BigDecimal) obj[4])==0){
is.setOutboundNumber(is.getOutboundNumber()-(Integer) obj[5]);
is.setNumber(is.getNumber()-(Integer) obj[5]);
is.setOutboundNumberPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getOutboundNumber())));
is.setPrice(is.getUnitPrice().multiply(BigDecimal.valueOf(is.getNumber())));
break;
}
}
}
inventorySummaryService.updateBatchById(inventorySummaryList);
}
}
//记录日志(如果警员携带装备,则进行记录 )
......
......@@ -33,6 +33,7 @@ import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult;
import com.junmp.v2.office.api.OfficeExcelApi;
import com.junmp.v2.office.api.bean.ExcelExportParam;
import liquibase.pro.packaged.B;
import org.apache.poi.util.StringUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -383,7 +384,7 @@ public class TjServiceImpl implements TjService {
Comparator<TjOrgEqsDto> orgComparator = createOrgComparator();
Collections.sort(allData, orgComparator);
for (TjOrgEqsDto tjOrgEqsDto:allData) {
if (tjOrgEqsDto.getLevel()==1 || tjOrgEqsDto.getLevel()==0){
if (ObjectUtil.isNotNull(tjOrgEqsDto.getLevel()) &&(tjOrgEqsDto.getLevel()==1 || tjOrgEqsDto.getLevel()==0)){
tjOrgEqsDto.setLevelNum(1);
}else {
tjOrgEqsDto.setLevelNum(0);
......@@ -392,15 +393,23 @@ public class TjServiceImpl implements TjService {
BeanPlusUtil.copyProperties(tjOrgEqsDto,tjOrgEqsReq);
tjOrgEqsReq.setColumn(req.getColumn());
tjOrgEqsReq.setOrder(req.getOrder());
tjOrgEqsReq.setRemoveEmpty(req.getRemoveEmpty());
List<TjOrgEqsDto> tjOrgEqsDtos = GetTjDataDetail(tjOrgEqsReq);
//将汇总合计数量存入
TjOrgEqsDto vo = new TjOrgEqsDto();
BeanPlusUtil.copyProperties(tjOrgEqsDto,vo);
vo.setOrgName("合计");
tjOrgEqsDtos.add(vo);
List<TjOrgEqsExportVo> collect = tjOrgEqsDtos.stream().map(tjOrgEqsDto1 -> {
TjOrgEqsExportVo tjOrgEqsExportVo = new TjOrgEqsExportVo();
BeanPlusUtil.copyProperties(tjOrgEqsDto1, tjOrgEqsExportVo);
return tjOrgEqsExportVo;
}).collect(Collectors.toList());
map.put(tjOrgEqsDto.getDName(),collect);// 将要导出的数据列表放入 map 中,其中 "orgName" 是 sheet 的名称
map.put(tjOrgEqsDto.getDName(),collect);// 将要导出的数据列表放入 map 中,其中 "dname" 是 sheet 的名称
}
HttpServletResponse response = HttpServletUtil.getResponse();
ExcelExportParam excelExportParam = new ExcelExportParam();
excelExportParam.setResponse(response); // 设置 HttpServletResponse
......@@ -684,7 +693,7 @@ public class TjServiceImpl implements TjService {
Collections.sort(tjOrgPriceDtoList, orgComparator);
for (TjOrgPriceDto dto: tjOrgPriceDtoList) {
TjOrgPriceReq tjOrgPriceReq = new TjOrgPriceReq();
if (req.getLevel()!=null){
if (ObjectUtil.isNotNull(dto.getLevel()) &&(dto.getLevel()==1 || dto.getLevel()==0)){
dto.setLevelNum(1);
}else {
dto.setLevelNum(0);
......@@ -693,6 +702,10 @@ public class TjServiceImpl implements TjService {
tjOrgPriceReq.setRemoveEmpty(req.getRemoveEmpty());
tjOrgPriceReq.setYear(req.getYear());
List<TjOrgPriceDto> tjOrgPriceDtos = TjOrgPriceDetail(tjOrgPriceReq);
TjOrgPriceDto vo = new TjOrgPriceDto();
BeanPlusUtil.copyProperties(dto,vo);
vo.setTypeName("合计");
tjOrgPriceDtos.add(vo);
List<TjOrgPriceExportVo> collect = tjOrgPriceDtos.stream().map(tjOrgPriceDto -> {
TjOrgPriceExportVo tjOrgPriceExportVo = new TjOrgPriceExportVo();
BeanPlusUtil.copyProperties(tjOrgPriceDto, tjOrgPriceExportVo);
......@@ -1018,7 +1031,7 @@ public class TjServiceImpl implements TjService {
Map<String, List<?>> map = new LinkedHashMap<>();
for (TjOrgCountDto dto: tjOrgCountList) {
TjOrgCountReq tjOrgCountReq = new TjOrgCountReq();
if (req.getLevel()!=null){
if (ObjectUtil.isNotNull(dto.getLevel()) &&(dto.getLevel()==1 || dto.getLevel()==0)){
dto.setLevelNum(1);
}else {
dto.setLevelNum(0);
......@@ -1027,6 +1040,10 @@ public class TjServiceImpl implements TjService {
tjOrgCountReq.setRemoveEmpty(req.getRemoveEmpty());
tjOrgCountReq.setYear(req.getYear());
List<TjOrgCountDto> tjOrgCountDtoList = TjOrgCountDetail(req);
TjOrgCountDto vo = new TjOrgCountDto();
BeanPlusUtil.copyProperties(dto,vo);
vo.setOrgName("合计");
tjOrgCountDtoList.add(vo);
List<TjOrgCountExportVo> collect = tjOrgCountDtoList.stream().map(tjOrgCountDto -> {
TjOrgCountExportVo tjOrgCountExportVo = new TjOrgCountExportVo();
BeanPlusUtil.copyProperties(tjOrgCountDto, tjOrgCountExportVo);
......
......@@ -674,7 +674,7 @@
FROM
`base_warehouse_inventory` wi
WHERE
wi.org_id = #{orgId}
wi.org_id = #{orgId} and wi.epc_type=0
<if test="warehouseId!= null and warehouseId != ''">
and wi.location_id=#{warehouseId}
</if>
......@@ -707,7 +707,7 @@
i.property,
i.state AS equ_state
FROM
base_inventory i
base_inventory i and wi.epc_type=0 and i.org_id = #{orgId} and i.state!="destory"
) AS t2 ON t2.epc = t1.epc
left JOIN base_equipment_size es ON t1.size_id = es.id
left JOIN base_equipment_type et ON t1.type_id = et.id
......
......@@ -36,13 +36,13 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true&allowMultiQueries=true
url: jdbc:mysql://192.168.1.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true&allowMultiQueries=true
username: root
password: 123456
redis:
#host: 192.168.3.188
host: 192.168.3.188
host: 192.168.3.121
port: 6379
database: 1
password:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论