Commit 8eda3b0e by 李小惠

1

parent 508f4720
...@@ -180,4 +180,19 @@ public class BusFormDto { ...@@ -180,4 +180,19 @@ public class BusFormDto {
*/ */
private String currentAssign; private String currentAssign;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
} }
...@@ -46,6 +46,6 @@ public class CabinetBoxDto implements Serializable { ...@@ -46,6 +46,6 @@ public class CabinetBoxDto implements Serializable {
* 箱门类型:1单警柜,2公共柜 * 箱门类型:1单警柜,2公共柜
*/ */
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜") @ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
private Integer boxType; private Integer containType;
} }
...@@ -22,6 +22,8 @@ public class CabinetBoxPoliceDto { ...@@ -22,6 +22,8 @@ public class CabinetBoxPoliceDto {
private Integer num; private Integer num;
private Integer box_type;
/** /**
* 主柜号 * 主柜号
*/ */
......
...@@ -46,4 +46,19 @@ public class OrderDetailDto implements Serializable { ...@@ -46,4 +46,19 @@ public class OrderDetailDto implements Serializable {
* 在库数 * 在库数
*/ */
private Integer stockNumber; private Integer stockNumber;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
} }
...@@ -12,9 +12,10 @@ public class PolicemanDto { ...@@ -12,9 +12,10 @@ public class PolicemanDto {
private String name; private String name;
private String cabinetBoxId; private List<String> soloBoxList;
private List<CabinetBoxPoliceDto> cabinetBoxList; private List<String> publicBoxList;
private String soloBoxName;
private String publicBoxName;
private String policeCode; private String policeCode;
private String sex; private String sex;
......
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.query; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.query;
import lombok.Data; import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
@Data @Data
public class BussinessOrderDetialReq { public class BussinessOrderDetialReq {
...@@ -23,4 +24,21 @@ public class BussinessOrderDetialReq { ...@@ -23,4 +24,21 @@ public class BussinessOrderDetialReq {
private BigDecimal totalPrice; private BigDecimal totalPrice;
//备注 //备注
private String remark; private String remark;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
//在库数
private Integer stockNumber;
} }
...@@ -62,7 +62,7 @@ public class CabinetBoxReq extends BaseRequest { ...@@ -62,7 +62,7 @@ public class CabinetBoxReq extends BaseRequest {
*/ */
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜") @ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
private String boxType; private Integer containType;
private String cabinetName; private String cabinetName;
......
...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -22,9 +23,9 @@ public class CabinetReq extends BaseRequest { ...@@ -22,9 +23,9 @@ public class CabinetReq extends BaseRequest {
/** /**
* 单警柜编号 * 单警柜编号
*/ */
@NotNull(message = "单警柜ID主键不能为空", groups = {edit.class, delete.class, detail.class}) @NotBlank(message = "单警柜ID主键不能为空", groups = {edit.class, delete.class, detail.class})
@ApiModelProperty(value = "单警柜编号") @ApiModelProperty(value = "单警柜编号")
private String serialNum; private String serverNum;
/** /**
* 箱数 * 箱数
......
...@@ -58,4 +58,19 @@ public class OrderDetailReq extends BaseRequest { ...@@ -58,4 +58,19 @@ public class OrderDetailReq extends BaseRequest {
*/ */
private Integer modifyQuantity; private Integer modifyQuantity;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
} }
...@@ -19,9 +19,6 @@ public class PolicemanReq extends BaseRequest { ...@@ -19,9 +19,6 @@ public class PolicemanReq extends BaseRequest {
@NotBlank(message = "姓名不能为空", groups = {add.class}) @NotBlank(message = "姓名不能为空", groups = {add.class})
private String name; private String name;
@NotBlank(message = "箱门id不能为空", groups = { delete.class})
private String cabinetBoxId;
private String cabinetId; private String cabinetId;
private List<CabinetBoxReq> boxList; private List<CabinetBoxReq> boxList;
...@@ -40,6 +37,8 @@ public class PolicemanReq extends BaseRequest { ...@@ -40,6 +37,8 @@ public class PolicemanReq extends BaseRequest {
//判断是否将系统账号和警员账号返回,如果是true,那么直接将警员返回,如果为空或者其他值,那么将系统账号和警员一起返回 //判断是否将系统账号和警员账号返回,如果是true,那么直接将警员返回,如果为空或者其他值,那么将系统账号和警员一起返回
private String flag; private String flag;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
private String doorCode; private String doorCode;
......
...@@ -208,4 +208,7 @@ public class QueryBusFormReq extends BaseRequest { ...@@ -208,4 +208,7 @@ public class QueryBusFormReq extends BaseRequest {
//当前登录人员 //当前登录人员
private String userId; private String userId;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
} }
...@@ -26,4 +26,7 @@ public class QuerySupplierReq extends BaseRequest { ...@@ -26,4 +26,7 @@ public class QuerySupplierReq extends BaseRequest {
private Integer state; private Integer state;
//联系人 //联系人
private String contacts; private String contacts;
//判断是否需要全部的厂商商信息还是只需要名字去重的厂商名称,如果是去重的,这里给true
private Boolean flag;
} }
...@@ -21,7 +21,7 @@ public class UpdateCabinetBoxReq extends BaseRequest { ...@@ -21,7 +21,7 @@ public class UpdateCabinetBoxReq extends BaseRequest {
private String boxName; private String boxName;
private String equipmentConfig; private String equipmentConfig;
private String boxType; private Integer containType;
private String power; private String power;
private List<String> boxNum; private List<String> boxNum;
private Integer num; private Integer num;
......
...@@ -64,4 +64,19 @@ public class UpdateOrderDetailReq implements Serializable { ...@@ -64,4 +64,19 @@ public class UpdateOrderDetailReq implements Serializable {
private Integer modifyQuantity; private Integer modifyQuantity;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
} }
...@@ -19,7 +19,6 @@ public class UpdatePolicemanReq extends BaseRequest { ...@@ -19,7 +19,6 @@ public class UpdatePolicemanReq extends BaseRequest {
@NotBlank(message = "警员名字不能为空", groups = {add.class,edit.class}) @NotBlank(message = "警员名字不能为空", groups = {add.class,edit.class})
private String name; private String name;
private String cabinetBoxId;
@NotNull(message = "组织机构id不能为空", groups = {add.class,edit.class}) @NotNull(message = "组织机构id不能为空", groups = {add.class,edit.class})
private Long orgId; private Long orgId;
......
...@@ -104,15 +104,15 @@ public class CabinetController { ...@@ -104,15 +104,15 @@ public class CabinetController {
@PostMapping("/boxBindPolice") // @PostMapping("/boxBindPolice")
@ApiOperation("箱门绑定人员") // @ApiOperation("箱门绑定人员")
public ApiRes<Boolean> boxBindPolice(@RequestBody CabinetBoxReq req) { // public ApiRes<Boolean> boxBindPolice(@RequestBody CabinetBoxReq req) {
boolean result = cabinetService.boxBindPolice(req); // boolean result = cabinetService.boxBindPolice(req);
if (!result){ // if (!result){
return ApiRes.failure("操作失败"); // return ApiRes.failure("操作失败");
} // }
return ApiRes.success(result); // return ApiRes.success(result);
} // }
@PostMapping("/SearchOrgId") @PostMapping("/SearchOrgId")
@ApiOperation("/根据单警柜id查询组织机构id") @ApiOperation("/根据单警柜id查询组织机构id")
......
...@@ -3,6 +3,7 @@ package com.junmp.jyzb.controller.ES; ...@@ -3,6 +3,7 @@ package com.junmp.jyzb.controller.ES;
import com.junmp.jyzb.Repository.BlogRepository; import com.junmp.jyzb.Repository.BlogRepository;
import com.junmp.jyzb.entity.ES.Blog; import com.junmp.jyzb.entity.ES.Blog;
import com.junmp.jyzb.entity.EquipmentSize; import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.service.BusFormService;
import com.junmp.jyzb.service.EquipmentSizeService; import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.jyzb.service.EquipmentTypeService; import com.junmp.jyzb.service.EquipmentTypeService;
import com.junmp.jyzb.service.PubOrgService; import com.junmp.jyzb.service.PubOrgService;
...@@ -38,6 +39,9 @@ public class CrudController { ...@@ -38,6 +39,9 @@ public class CrudController {
public EquipmentSizeService equipmentSizeService; public EquipmentSizeService equipmentSizeService;
@Resource @Resource
public PubOrgService pubOrgService; public PubOrgService pubOrgService;
@Resource
public BusFormService busFormService;
@ApiOperation("测试") @ApiOperation("测试")
@PostMapping("testDocument") @PostMapping("testDocument")
public Object testDocument() { public Object testDocument() {
...@@ -55,6 +59,7 @@ public class CrudController { ...@@ -55,6 +59,7 @@ public class CrudController {
pubOrgService.AddToEs(); pubOrgService.AddToEs();
equipmentTypeService.addEs(); equipmentTypeService.addEs();
equipmentSizeService.addEs(); equipmentSizeService.addEs();
busFormService.addEs();
return true; return true;
} }
@ApiOperation("添加单个文档") @ApiOperation("添加单个文档")
......
...@@ -5,7 +5,12 @@ import com.baomidou.mybatisplus.annotation.*; ...@@ -5,7 +5,12 @@ import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Document;
/** /**
...@@ -14,12 +19,16 @@ import org.springframework.data.elasticsearch.annotations.Document; ...@@ -14,12 +19,16 @@ import org.springframework.data.elasticsearch.annotations.Document;
*/ */
@TableName(value ="bussiness_bus_form") @TableName(value ="bussiness_bus_form")
@Data @Data
@Document(indexName = "busform", shards = 1, replicas = 1) @AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "busform")
@JsonIgnoreProperties(ignoreUnknown = true)
public class BusForm implements Serializable { public class BusForm implements Serializable {
/** /**
* id * id
*/ */
@TableId(value = "id",type = IdType.ASSIGN_UUID) @TableId(value = "id",type = IdType.ASSIGN_UUID)
@Id
private String id; private String id;
/** /**
...@@ -134,17 +143,6 @@ public class BusForm implements Serializable { ...@@ -134,17 +143,6 @@ public class BusForm implements Serializable {
@TableField(value = "apply_time") @TableField(value = "apply_time")
private Date applyTime; private Date applyTime;
/**
* 申请人
*/
@TableField(value = "apply_user")
private String applyUser;
/**
* 申请人id
*/
@TableField(value = "apply_user_id")
private String applyUserId;
/** /**
* 调拨类型(2支拨,1价拨) * 调拨类型(2支拨,1价拨)
...@@ -232,7 +230,6 @@ public class BusForm implements Serializable { ...@@ -232,7 +230,6 @@ public class BusForm implements Serializable {
@TableField(value = "use_count") @TableField(value = "use_count")
private String useCount; private String useCount;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -71,8 +71,8 @@ public class CabinetBox implements Serializable { ...@@ -71,8 +71,8 @@ public class CabinetBox implements Serializable {
* 箱门类型:1单警柜,2公共柜 * 箱门类型:1单警柜,2公共柜
*/ */
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜") @ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
@TableField("box_type") @TableField("contain_type")
private String boxType; private Integer containType;
/** /**
* 使用日志存储位置信息 * 使用日志存储位置信息
*/ */
...@@ -80,12 +80,6 @@ public class CabinetBox implements Serializable { ...@@ -80,12 +80,6 @@ public class CabinetBox implements Serializable {
@TableField("log_map") @TableField("log_map")
private String logMap; private String logMap;
/**
* 箱门类型:1单警柜,2公共柜
*/
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
@TableField("box_type")
private Integer boxType;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -58,6 +58,12 @@ public class CabinetBoxPolice implements Serializable { ...@@ -58,6 +58,12 @@ public class CabinetBoxPolice implements Serializable {
@TableField(value = "update_time") @TableField(value = "update_time")
private Date updateTime; private Date updateTime;
/**
* 箱门类型(1单警柜,2公共柜)
*/
@TableField(value = "contain_type")
private Integer containType;
@TableField(exist = false) @TableField(exist = false)
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -85,5 +85,21 @@ import java.util.Date; ...@@ -85,5 +85,21 @@ import java.util.Date;
private String updateUser; private String updateUser;
/**
* 生产日期
*/
@TableField("production_date")
private Date productionDate;
/**
* 质保期
*/
@TableField("warranty_period")
private Integer warrantyPeriod;
/**
* 维保期
*/
@TableField("maintenance_period")
private Integer maintenancePeriod;
} }
...@@ -27,8 +27,6 @@ public class Policeman implements Serializable { ...@@ -27,8 +27,6 @@ public class Policeman implements Serializable {
@TableField(value = "name") @TableField(value = "name")
private String name; private String name;
@TableField(value = "cabinet_box_id",updateStrategy = FieldStrategy.IGNORED)
private String cabinetBoxId;
@TableField(value = "org_id_int",updateStrategy = FieldStrategy.IGNORED) @TableField(value = "org_id_int",updateStrategy = FieldStrategy.IGNORED)
private Long orgId; private Long orgId;
......
...@@ -83,6 +83,7 @@ import java.util.stream.Collectors; ...@@ -83,6 +83,7 @@ import java.util.stream.Collectors;
for (HistoricVariableInstance a:bussinessType) { for (HistoricVariableInstance a:bussinessType) {
System.out.println("a = " + a); System.out.println("a = " + a);
} }
if(orderType.size()>0) { if(orderType.size()>0) {
...@@ -116,13 +117,18 @@ import java.util.stream.Collectors; ...@@ -116,13 +117,18 @@ import java.util.stream.Collectors;
BusForm busForm = busFormService.getOne(new LambdaQueryWrapper<BusForm>() BusForm busForm = busFormService.getOne(new LambdaQueryWrapper<BusForm>()
.eq(BusForm::getProcessId, processInstanceId)); .eq(BusForm::getProcessId, processInstanceId));
busForm.setExamineState("finished"); busForm.setExamineState("finished");
// if (){ if (busForm.getBussinessType().equals("remove")){
// String detailList = busForm.getDetailList(); String detailList = busForm.getDetailList();
// List<BussinessOrderDetialReq> list = JSON.parseArray(detailList, BussinessOrderDetialReq.class); List<BussinessOrderDetialReq> list = JSON.parseArray(detailList, BussinessOrderDetialReq.class);
// for (:) { for (BussinessOrderDetialReq bussinessOrderDetialReq:list) {
// //如果数量相同则直接将全部在库数的装备表中的该仓库的装备状态全部设置为报废,并且修改库存汇总表中的数据
// } if (bussinessOrderDetialReq.getPlanNum()==bussinessOrderDetialReq.getStockNumber()){
// }
}else {//如果数量不相等,状态不进行修改,只修改库存汇总表中的信息
}
}
}
busFormService.updateById(busForm); busFormService.updateById(busForm);
} }
if (Type.equals("reassigment")){//调岗申请单 if (Type.equals("reassigment")){//调岗申请单
......
...@@ -13,7 +13,7 @@ import java.util.Map; ...@@ -13,7 +13,7 @@ import java.util.Map;
public interface CabinetMapper extends BaseMapper<Cabinet> { public interface CabinetMapper extends BaseMapper<Cabinet> {
List<Cabinet> getAllCabinetByOrgList(@Param("list") List<Long> allOrgId); List<Cabinet> getAllCabinetByOrgList(@Param("list") List<Long> allOrgId);
List<Cabinet> getAllCabinetsWithSingleCabinet(@Param("orgId")String id, @Param("boxType") String boxType); List<Cabinet> getAllCabinetsWithSingleCabinet(@Param("orgId")String id, @Param("containType") String containType);
boolean SetInventoryInfo(String id); boolean SetInventoryInfo(String id);
} }
\ No newline at end of file
package com.junmp.jyzb.mapper; package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.api.bean.dto.SupplierDto;
import com.junmp.jyzb.entity.Supplier; import com.junmp.jyzb.entity.Supplier;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface SupplierMapper extends BaseMapper<Supplier> { public interface SupplierMapper extends BaseMapper<Supplier> {
List<SupplierDto> selectDistinctList();
} }
\ No newline at end of file
...@@ -63,7 +63,7 @@ public interface CabinetService extends IService<Cabinet> { ...@@ -63,7 +63,7 @@ public interface CabinetService extends IService<Cabinet> {
* @param req * @param req
* @return * @return
*/ */
boolean boxBindPolice(CabinetBoxReq req); // boolean boxBindPolice(CabinetBoxReq req);
/** /**
......
...@@ -24,6 +24,7 @@ import com.junmp.jyzb.service.BusFormService; ...@@ -24,6 +24,7 @@ import com.junmp.jyzb.service.BusFormService;
import com.junmp.jyzb.mapper.BusFormMapper; import com.junmp.jyzb.mapper.BusFormMapper;
import com.junmp.jyzb.service.InventorySummaryService; import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.StocktakeService; import com.junmp.jyzb.service.StocktakeService;
import com.junmp.jyzb.utils.CreateNullData;
import com.junmp.jyzb.utils.DateTimeUtil; import com.junmp.jyzb.utils.DateTimeUtil;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil; import com.junmp.v2.common.util.BeanPlusUtil;
...@@ -221,20 +222,12 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl ...@@ -221,20 +222,12 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
BeanPlusUtil.copyProperties(busForm, busFormDto); BeanPlusUtil.copyProperties(busForm, busFormDto);
return busFormDto; return busFormDto;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//余数 //创建空的数据返回前端
long num= size % 10;
//整数 if(req.getIsCreateNullDate()==null || req.getIsCreateNullDate()){
long integer=size / 10; Class<BusFormDto> busFormDto=BusFormDto.class;
List<BusFormDto> collect1=new ArrayList<>(); List<BusFormDto> nullData = CreateNullData.createNullData(size, req.getPageNo(), busFormDto);
if (num!=0){ collect.addAll(nullData);
//判断整数是什么,就在第几页进行补
if(req.getPageNo()-1==integer){
for (int i = 0; i < 10-num; i++) {
BusFormDto busFormDto = new BusFormDto();
collect1.add(busFormDto);
}
}
collect.addAll(collect1);
} }
Page<BusFormDto> page1=new Page<>(req.getPageNo(),req.getPageSize()); Page<BusFormDto> page1=new Page<>(req.getPageNo(),req.getPageSize());
......
...@@ -66,7 +66,7 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet ...@@ -66,7 +66,7 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
box.setCabinetId(cabinet.getId()); box.setCabinetId(cabinet.getId());
box.setPower(boxReq.getPower()); box.setPower(boxReq.getPower());
box.setEquipmentConfig(boxReq.getEquipmentConfig()); box.setEquipmentConfig(boxReq.getEquipmentConfig());
box.setBoxType(boxReq.getBoxType()); box.setContainType(boxReq.getContainType());
box.setState(0); box.setState(0);
box.setBoxName(boxReq.getBoxName()); box.setBoxName(boxReq.getBoxName());
box.setNum(boxReq.getNum()); box.setNum(boxReq.getNum());
......
...@@ -45,6 +45,9 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -45,6 +45,9 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
private CabinetBoxService cabinetBoxService; private CabinetBoxService cabinetBoxService;
@Resource @Resource
private PolicemanService policemanService; private PolicemanService policemanService;
@Resource
private CabinetBoxPoliceService cabinetBoxPoliceService;
@Autowired @Autowired
private RabbitMQSendMsg MQ; private RabbitMQSendMsg MQ;
...@@ -102,7 +105,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -102,7 +105,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
box.setCabinetId(cabinet.getId()); box.setCabinetId(cabinet.getId());
box.setPower(boxReq.getPower()); box.setPower(boxReq.getPower());
box.setEquipmentConfig(boxReq.getEquipmentConfig()); box.setEquipmentConfig(boxReq.getEquipmentConfig());
box.setBoxType(boxReq.getBoxType()); box.setContainType(boxReq.getContainType());
box.setState(0); box.setState(0);
box.setNum(boxReq.getNum()); box.setNum(boxReq.getNum());
return box; return box;
...@@ -144,24 +147,16 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -144,24 +147,16 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
//通过单警柜id循环遍历出并删除所有箱门信息 //通过单警柜id循环遍历出并删除所有箱门信息
List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>() List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>()
.eq(ObjectUtil.isNotEmpty(id), CabinetBox::getCabinetId, id)); .eq(ObjectUtil.isNotEmpty(id), CabinetBox::getCabinetId, id));
//创建police列表方便批量删除操作
List<Policeman> policemanList=new ArrayList<>();
//创建cabinetBox列表方便批量删除操作 //创建cabinetBox列表方便批量删除操作
List<CabinetBox> cabinetBoxList=new ArrayList<>(); List<CabinetBox> cabinetBoxList=new ArrayList<>();
for (CabinetBox cabinetBox: list) { for (CabinetBox cabinetBox: list) {
CabinetBox cabinetBox1 = new CabinetBox(); CabinetBox cabinetBox1 = new CabinetBox();
BeanPlusUtil.copyProperties(cabinetBox,cabinetBox1); BeanPlusUtil.copyProperties(cabinetBox,cabinetBox1);
cabinetBoxList.add(cabinetBox1); cabinetBoxList.add(cabinetBox1);
//删除箱门信息的同时需要去判断箱门是否绑定警员,如果有,则解除绑定 //
Policeman one = policemanService.getOne(new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(cabinetBox.getId()),Policeman::getCabinetBoxId,cabinetBox.getId()));
if (!ObjectUtil.isNull(one)){
one.setCabinetBoxId(null);
policemanList.add(one);
}
} }
//批量修改绑定箱门的警员信息,将其解绑 //批量修改绑定箱门的警员信息,将其解绑
policemanService.updateBatchById(policemanList); cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>().eq(CabinetBoxPolice::getCabinetId,cabinetIdList));
//批量删除箱门数 //批量删除箱门数
cabinetBoxService.removeBatchByIds(cabinetBoxList); cabinetBoxService.removeBatchByIds(cabinetBoxList);
//批量删除单警柜id //批量删除单警柜id
...@@ -210,7 +205,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -210,7 +205,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
LambdaQueryWrapper<Cabinet> eq = new LambdaQueryWrapper<Cabinet>() LambdaQueryWrapper<Cabinet> eq = new LambdaQueryWrapper<Cabinet>()
.eq(Cabinet::getOrgIdInt, req.getOrgId()) .eq(Cabinet::getOrgIdInt, req.getOrgId())
.like(ObjectUtil.isNotNull(req.getName()), Cabinet::getName, req.getName()) .like(ObjectUtil.isNotNull(req.getName()), Cabinet::getName, req.getName())
.like(ObjectUtil.isNotNull(req.getSerialNum()), Cabinet::getCabinetNum, req.getSerialNum()); .like(ObjectUtil.isNotNull(req.getServerNum()), Cabinet::getCabinetNum, req.getServerNum());
// 使用 PageHelper 开始分页 // 使用 PageHelper 开始分页
Page<Cabinet> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()); Page<Cabinet> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
...@@ -250,12 +245,12 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -250,12 +245,12 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
@Override @Override
public CabinetDto showOneCabinet(CabinetReq req) { public CabinetDto showOneCabinet(CabinetReq req) {
// 查询单警柜信息 // 查询单警柜信息
Cabinet cabinet = CabinetExistByNum(req.getSerialNum()); Cabinet cabinet = CabinetExistByNum(req.getServerNum());
// 查询单警柜的箱门信息 // 查询单警柜的箱门信息
List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>() List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>()
.eq(ObjectUtil.isNotEmpty(cabinet.getId()), CabinetBox::getCabinetId, cabinet.getId()) .eq(ObjectUtil.isNotEmpty(cabinet.getId()), CabinetBox::getCabinetId, cabinet.getId())
.eq(ObjectUtil.isNotEmpty(req.getContainType()), CabinetBox::getBoxType, req.getContainType())); .eq(ObjectUtil.isNotEmpty(req.getContainType()), CabinetBox::getContainType, req.getContainType()));
List<CabinetBoxDto> boxList = list.stream() List<CabinetBoxDto> boxList = list.stream()
.map(cabinetBox -> { .map(cabinetBox -> {
...@@ -333,40 +328,40 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -333,40 +328,40 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
* @param req * @param req
* @return * @return
*/ */
@Override // @Override
public boolean boxBindPolice(CabinetBoxReq req) { // public boolean boxBindPolice(CabinetBoxReq req) {
//通过箱门id查询出箱门信息 // //通过箱门id查询出箱门信息
CabinetBox one = cabinetBoxService.getOne(new LambdaQueryWrapper<CabinetBox>() // CabinetBox one = cabinetBoxService.getOne(new LambdaQueryWrapper<CabinetBox>()
.eq(ObjectUtil.isNotEmpty(req.getId()), CabinetBox::getId, req.getId())); // .eq(ObjectUtil.isNotEmpty(req.getId()), CabinetBox::getId, req.getId()));
if (ObjectUtil.isEmpty(one)){ // if (ObjectUtil.isEmpty(one)){
//箱门id不存在 // //箱门id不存在
throw new ServiceException(CabinetExceptionEnum.CABINETBOX_ISNOT_EXISTS); // throw new ServiceException(CabinetExceptionEnum.CABINETBOX_ISNOT_EXISTS);
} // }
//获取箱门的主柜id // //获取箱门的主柜id
String cabinetId = one.getCabinetId(); // String cabinetId = one.getCabinetId();
//通过主柜id获取机构id // //通过主柜id获取机构id
Cabinet one1 = getOne(new LambdaQueryWrapper<Cabinet>() // Cabinet one1 = getOne(new LambdaQueryWrapper<Cabinet>()
.eq(ObjectUtil.isNotEmpty(cabinetId), Cabinet::getId,cabinetId)); // .eq(ObjectUtil.isNotEmpty(cabinetId), Cabinet::getId,cabinetId));
if (ObjectUtil.isEmpty(one1)){ // if (ObjectUtil.isEmpty(one1)){
//单警柜不存在异常 // //单警柜不存在异常
throw new ServiceException(CabinetExceptionEnum.CABINET_ISNOT_EXISTS); // throw new ServiceException(CabinetExceptionEnum.CABINET_ISNOT_EXISTS);
} // }
long orgId = one1.getOrgIdInt(); // long orgId = one1.getOrgIdInt();
//通过警员id获取警员所在的机构id // //通过警员id获取警员所在的机构id
Policeman one2 = policemanService.getOne(new LambdaQueryWrapper<Policeman>() // Policeman one2 = policemanService.getOne(new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(req.getPoliceId()), Policeman::getId, req.getPoliceId())); // .eq(ObjectUtil.isNotEmpty(req.getPoliceId()), Policeman::getId, req.getPoliceId()));
if (ObjectUtil.isEmpty(one2)){ // if (ObjectUtil.isEmpty(one2)){
//警员不存在异常 // //警员不存在异常
throw new ServiceException(PolicemanExceptionEnum.POLICEMAN_NOT_EXIST); // throw new ServiceException(PolicemanExceptionEnum.POLICEMAN_NOT_EXIST);
} // }
Long orgId1 = one2.getOrgId(); // Long orgId1 = one2.getOrgId();
//判断两个机构id是否相同,相同则可以绑定,不相同则绑定失败 // //判断两个机构id是否相同,相同则可以绑定,不相同则绑定失败
if (!(orgId1==orgId)){ // if (!(orgId1==orgId)){
return false; // return false;
} // }
one2.setCabinetBoxId(one.getId()); // one2.setCabinetBoxId(one.getId());
return policemanService.updateById(one2); // return policemanService.updateById(one2);
} // }
/** /**
...@@ -394,7 +389,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl ...@@ -394,7 +389,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
//根据单警柜id查询出组织机构id //根据单警柜id查询出组织机构id
@Override @Override
public Long SearchOrgId(CabinetReq req) { public Long SearchOrgId(CabinetReq req) {
Cabinet cabinet = CabinetExistByNum(req.getSerialNum()); Cabinet cabinet = CabinetExistByNum(req.getServerNum());
return cabinet.getOrgIdInt(); return cabinet.getOrgIdInt();
} }
......
...@@ -2,8 +2,10 @@ package com.junmp.jyzb.service.impl; ...@@ -2,8 +2,10 @@ package com.junmp.jyzb.service.impl;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -22,6 +24,7 @@ import com.junmp.jyzb.entity.*; ...@@ -22,6 +24,7 @@ import com.junmp.jyzb.entity.*;
import com.junmp.jyzb.mapper.*; import com.junmp.jyzb.mapper.*;
import com.junmp.jyzb.service.*; import com.junmp.jyzb.service.*;
import com.junmp.jyzb.utils.*; import com.junmp.jyzb.utils.*;
import com.junmp.v2.auth.api.password.IStoredEncryptApi;
import com.junmp.v2.common.enums.LogicDelEnum; import com.junmp.v2.common.enums.LogicDelEnum;
import com.junmp.v2.common.exception.base.ServiceException; import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil; import com.junmp.v2.common.util.BeanPlusUtil;
...@@ -32,6 +35,7 @@ import com.junmp.v2.file.api.constant.FileConstant; ...@@ -32,6 +35,7 @@ import com.junmp.v2.file.api.constant.FileConstant;
import com.junmp.v2.sys.api.bean.user.SysUserDto; import com.junmp.v2.sys.api.bean.user.SysUserDto;
import com.junmp.v2.sys.api.bean.user.req.SysUserReq; import com.junmp.v2.sys.api.bean.user.req.SysUserReq;
import com.junmp.v2.sys.api.bean.user.req.UserOrgReq; import com.junmp.v2.sys.api.bean.user.req.UserOrgReq;
import com.junmp.v2.sys.api.expander.SystemConfigExpander;
import com.junmp.v2.sys.user.entity.SysUser; import com.junmp.v2.sys.user.entity.SysUser;
import com.junmp.v2.sys.user.entity.SysUserOrg; import com.junmp.v2.sys.user.entity.SysUserOrg;
import com.junmp.v2.sys.user.entity.SysUserRole; import com.junmp.v2.sys.user.entity.SysUserRole;
...@@ -39,6 +43,7 @@ import com.junmp.v2.sys.user.factory.SysUserCreateFactory; ...@@ -39,6 +43,7 @@ import com.junmp.v2.sys.user.factory.SysUserCreateFactory;
import com.junmp.v2.sys.user.service.SysUserOrgService; import com.junmp.v2.sys.user.service.SysUserOrgService;
import com.junmp.v2.sys.user.service.SysUserRoleService; import com.junmp.v2.sys.user.service.SysUserRoleService;
import com.junmp.v2.sys.user.service.SysUserService; import com.junmp.v2.sys.user.service.SysUserService;
import liquibase.pro.packaged.S;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -226,27 +231,36 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -226,27 +231,36 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
Policeman one = PoliceExist(req.getId()); Policeman one = PoliceExist(req.getId());
PubOrg pubOrg = pubOrgService.PubOrgExist(one.getOrgId()); PubOrg pubOrg = pubOrgService.PubOrgExist(one.getOrgId());
PolicemanDto policemanDto = new PolicemanDto(); PolicemanDto policemanDto = new PolicemanDto();
if (ObjectUtil.isNotNull(one.getCabinetBoxId())){ BeanPlusUtil.copyProperties(one, policemanDto);
String cabinetId = cabinetBoxService.getById(one.getCabinetBoxId()).getCabinetId();
Cabinet cabinet = cabinetService.getById(cabinetId);
CabinetDto cabinetDto = new CabinetDto();
BeanPlusUtil.copyProperties(cabinet,cabinetDto);
policemanDto.setCabinetInfo(cabinetDto);
}
//将箱门信息展示: //将箱门信息展示:
List<CabinetBoxPolice> list = cabinetBoxPoliceService.list(new LambdaQueryWrapper<CabinetBoxPolice>() List<CabinetBoxPolice> list = cabinetBoxPoliceService.list(new LambdaQueryWrapper<CabinetBoxPolice>()
.eq(CabinetBoxPolice::getPoliceId, req.getId())); .eq(CabinetBoxPolice::getPoliceId, req.getId()));
List<String> soloList=new ArrayList<>();
List<String> publicList=new ArrayList<>();
String soloName="";
String publicName="";
if (list.size()>0){ if (list.size()>0){
List<CabinetBoxPoliceDto> collect = list.stream().map(cabinetBoxPolice -> { for (CabinetBoxPolice boxPolice:list) {
CabinetBoxPoliceDto cabinetBoxPoliceDto = new CabinetBoxPoliceDto();
BeanPlusUtil.copyProperties(cabinetBoxPolice, cabinetBoxPoliceDto); if (boxPolice.getContainType()==1){
return cabinetBoxPoliceDto; soloList.add(boxPolice.getCabinetBoxId());
}).collect(Collectors.toList()); soloName = soloName+ boxPolice.getCabinetName()+",";
policemanDto.setCabinetBoxList(collect);
}else { }else {
policemanDto.setCabinetBoxList(new ArrayList<>()); publicList.add(boxPolice.getCabinetBoxId());
publicName = publicName+ boxPolice.getCabinetName()+",";
} }
BeanPlusUtil.copyProperties(one, policemanDto); }
policemanDto.setPublicBoxList(publicList);
policemanDto.setSoloBoxList(soloList);
}else {
policemanDto.setSoloBoxList(new ArrayList<>());
policemanDto.setPublicBoxList(new ArrayList<>());
}
policemanDto.setSoloBoxName(soloName.trim().isEmpty()?soloName:soloName.substring(0,soloName.length()-1));
policemanDto.setPublicBoxName(publicName.trim().isEmpty()?publicName:publicName.substring(0,publicName.length()-1));
//将警员的指纹信息查询出来 //将警员的指纹信息查询出来
List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>() List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
.eq(ObjectUtil.isNotNull(req.getId()), PoliceFinger::getPoliceId, req.getId())); .eq(ObjectUtil.isNotNull(req.getId()), PoliceFinger::getPoliceId, req.getId()));
...@@ -292,11 +306,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -292,11 +306,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public boolean DeletePolice(UpdatePolicemanReq req) { public boolean DeletePolice(UpdatePolicemanReq req) {
//通过警员id查询警员信息 //通过警员id查询警员信息
Policeman policeman = PoliceExist(req.getId()); Policeman policeman = PoliceExist(req.getId());
//如果查询出来的警员信息中没有绑定箱门而参数传递了箱门id,则抛出异常警员绑定箱门错误 cabinetBoxPoliceService.list(new LambdaQueryWrapper<CabinetBoxPolice>().eq(CabinetBoxPolice::getPoliceId,req.getId()));
//如果传递的箱门id参数与查询出来的箱门id不一致,则抛出异常警员绑定的箱门与实际绑定不符合
if ((ObjectUtil.isNull(policeman.getCabinetBoxId()) && ObjectUtil.isNotNull(req.getCabinetBoxId()))) {
throw new ServiceException(CabinetBoxExceptionEnum.CABINETBOX_ISNOT_EXISTS);
}
//通过警员信息中的userId对账号进行删除 //通过警员信息中的userId对账号进行删除
sysUserService.remove(new LambdaQueryWrapper<SysUser>() sysUserService.remove(new LambdaQueryWrapper<SysUser>()
.eq(SysUser::getUserId, policeman.getUserId())); .eq(SysUser::getUserId, policeman.getUserId()));
...@@ -316,14 +326,24 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -316,14 +326,24 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean UpdatePolice(UpdatePolicemanReq req) { public boolean UpdatePolice(UpdatePolicemanReq req) {
//判断警员是否存在
Policeman policeman = new Policeman(); Policeman one = PoliceExist(req.getId());
BeanPlusUtil.copyProperties(req, policeman); IStoredEncryptApi storedEncryptApi = (IStoredEncryptApi) SpringUtil.getBean(IStoredEncryptApi.class);
//如果不为空则表示修改警员密码
if (ObjectUtil.isNotEmpty(req.getPassword()) || !req.getPassword().trim().isEmpty()) {
String newPassword = storedEncryptApi.encrypt(req.getPassword());
req.setPassword(newPassword);
//修改警员密码的同时修改账号表中的密码
sysUserService.update(new SysUser(),
new LambdaUpdateWrapper<SysUser>().eq(SysUser::getUserId, one.getUserId())
.set(SysUser::getPassword, newPassword)
.set(SysUser::getUpdateTime, DateTimeUtil.getCurrentDateTime())
);
}
//查询传入的组织机构id是否存在 //查询传入的组织机构id是否存在
pubOrgService.PubOrgExist(req.getOrgId()); pubOrgService.PubOrgExist(req.getOrgId());
//判断传入的修改的警员编号与本身编号一致,如果一致则无所谓,如果不一致则需要判断修改的警员编号是否已经存在 //判断传入的修改的警员编号与本身编号一致,如果一致则无所谓,如果不一致则需要判断修改的警员编号是否已经存在
//判断警员是否存在 BeanPlusUtil.copyProperties(req, one);
Policeman one = PoliceExist(req.getId());
if (!req.getPoliceCode().equals(one.getPoliceCode())) { if (!req.getPoliceCode().equals(one.getPoliceCode())) {
Policeman one1 = getOne(new LambdaQueryWrapper<Policeman>() Policeman one1 = getOne(new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotNull(req.getPoliceCode()), Policeman::getPoliceCode, req.getPoliceCode())); .eq(ObjectUtil.isNotNull(req.getPoliceCode()), Policeman::getPoliceCode, req.getPoliceCode()));
...@@ -331,13 +351,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -331,13 +351,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
throw new ServiceException(PolicemanExceptionEnum.POLICECODE_IS_EXISTS); throw new ServiceException(PolicemanExceptionEnum.POLICECODE_IS_EXISTS);
} }
} }
//判断是否传递了箱子id,如果传了则判断箱子是否存在 one.setUpdateTime(DateTimeUtil.getCurrentDateTime());
if (ObjectUtil.isNotNull(req.getCabinetBoxId()) && !req.getCabinetBoxId().equals("")){
//查询单警柜箱号是否存在,箱门不存在抛异常
cabinetBoxService.CabinetBoxExist(req.getCabinetBoxId());
}
policeman.setUpdateTime(DateTimeUtil.getCurrentDateTime());
//修改角色 //修改角色
if (req.getRolesList().size()>0){
sysUserRoleService.removeBatchByIds(req.getRolesList()); sysUserRoleService.removeBatchByIds(req.getRolesList());
List<SysUserRole> collect = req.getRolesList().stream().map(s -> { List<SysUserRole> collect = req.getRolesList().stream().map(s -> {
SysUserRole sysUserRole = new SysUserRole(); SysUserRole sysUserRole = new SysUserRole();
...@@ -347,7 +363,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -347,7 +363,9 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
return sysUserRole; return sysUserRole;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
sysUserRoleService.saveBatch(collect); sysUserRoleService.saveBatch(collect);
return updateById(policeman); }
return updateById(one);
} }
...@@ -456,20 +474,11 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -456,20 +474,11 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds
(req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(), (req.getOrgId(),req.getAccount(),req.getName(),req.getPoliceCode(),
req.getState(),req.getPhone(),req.getFlag(),(pageNo-1),pageSize,req.getColumn(),req.getOrder()); req.getState(),req.getPhone(),req.getFlag(),(pageNo-1),pageSize,req.getColumn(),req.getOrder());
//余数 //判断是否需要添加空数据
long num= size % 10; if(req.getIsCreateNullDate()==null || req.getIsCreateNullDate()){
//整数 Class<PolicemanDto> policemanDto = PolicemanDto.class;
long integer=size / 10; List<PolicemanDto> nullData = CreateNullData.createNullData(size, req.getPageNo(), policemanDto);
List<PolicemanDto> collect1=new ArrayList<>(); policemanDtos.addAll(nullData);
if (num!=0){
//判断整数是什么,就在第几页进行补
if(req.getPageNo()-1==integer){
for (int i = 0; i < 10-num; i++) {
PolicemanDto policemanDto = new PolicemanDto();
collect1.add(policemanDto);
}
}
policemanDtos.addAll(collect1);
} }
Page<PolicemanDto> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()); Page<PolicemanDto> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
page1.setRecords(policemanDtos); page1.setRecords(policemanDtos);
...@@ -478,42 +487,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -478,42 +487,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
} }
public PageResult<PolicemanDto> GetAllPolicemanPage1(PolicemanReq req) {
//查询传入的组织机构id是否存在
PubOrg pubOrg = pubOrgService.PubOrgExist(req.getOrgId());
//查询出组织机构下的所有警员信息
LambdaQueryWrapper<Policeman> eq = new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(req.getOrgId()), Policeman::getOrgId, req.getOrgId())
.like(ObjectUtil.isNotEmpty(req.getName()), Policeman::getName, req.getName())
.like(ObjectUtil.isNotEmpty(req.getPoliceCode()), Policeman::getPoliceCode, req.getPoliceCode())
.like(ObjectUtil.isNotEmpty(req.getPhone()),Policeman::getPhone,req.getPhone())
.eq(ObjectUtil.isNotEmpty(req.getState()), Policeman::getState, req.getState());
long size = list(eq).size();
Page<Policeman> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), eq);
List<Policeman> records = page.getRecords();
List<Long> collect = records.stream().map(Policeman::getUserId).collect(Collectors.toList());
// List<PolicemanDto> policemanDtos = policemanMapper.selectUserBypoliceIds(collect);
//// 查询出警员信息下的指纹列表信息
// for (PolicemanDto p : policemanDtos) {
// List<PoliceFinger> list1 = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
// .eq(ObjectUtil.isNotNull(p.getId()), PoliceFinger::getPoliceId, p.getId()));
// List<PoliceFingerDto> policeFingerDtoList = new ArrayList<>();
// for (PoliceFinger policeFinger : list1) {
// PoliceFingerDto policeFingerDto = new PoliceFingerDto();
// BeanPlusUtil.copyProperties(policeFinger, policeFingerDto);
// policeFingerDtoList.add(policeFingerDto);
// }
// p.setFingersList(policeFingerDtoList);
// p.setOrgName(pubOrg.getOrgName());
//
// }
Page<PolicemanDto> page1 = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
// page1.setRecords(policemanDtos);
page1.setTotal(size);
return PageResultFactory.createPageResult(page1);
}
//根据单警柜id查询警员信息(list) //根据单警柜id查询警员信息(list)
@Override @Override
public List<PolicemanDto> GetPoliceData(CabinetReq req) { public List<PolicemanDto> GetPoliceData(CabinetReq req) {
...@@ -629,13 +602,23 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -629,13 +602,23 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public boolean PoliceBindBox(PolicemanReq req) { public boolean PoliceBindBox(PolicemanReq req) {
Policeman policeman = PoliceExist(req.getId()); Policeman policeman = PoliceExist(req.getId());
//判断箱子是否存在 //判断箱子是否存在
if (req.getCabinetBoxId()!=null && !req.getCabinetBoxId().isEmpty()){
cabinetBoxService.CabinetBoxExist(req.getCabinetBoxId());
}
//判断箱门是否存在 //判断箱门是否存在
boolean a=true;
if (req.getBoxList().size()>0){ if (req.getBoxList().size()>0){
// List<String> cabinetIdList=new ArrayList<>();
// for (CabinetBoxReq cabinetBoxReq:req.getBoxList()) {
// if (cabinetIdList.size()==0){
// cabinetIdList.add(cabinetBoxReq.getCabinetId());
// }
// if (!cabinetIdList.contains(cabinetBoxReq.getCabinetId())){
// cabinetIdList.add(cabinetBoxReq.getCabinetId());
// }
// }
// List<Cabinet> list1 = cabinetService.list(new LambdaQueryWrapper<Cabinet>()
// .in(Cabinet::getId, cabinetIdList)
// .eq(Cabinet::getOrgIdInt, req.getOrgId()));
//
//
// List<String> collect1 = req.getBoxList().stream() // List<String> collect1 = req.getBoxList().stream()
// .map(CabinetBoxReq::getId) // .map(CabinetBoxReq::getId)
// .collect(Collectors.toList()); // .collect(Collectors.toList());
...@@ -651,6 +634,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -651,6 +634,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//根据警员id和箱门id绑定公共柜 //根据警员id和箱门id绑定公共柜
List<CabinetBoxPolice> cabinetBoxPoliceList=new ArrayList<>(); List<CabinetBoxPolice> cabinetBoxPoliceList=new ArrayList<>();
List<CabinetBoxReq> boxList = req.getBoxList(); List<CabinetBoxReq> boxList = req.getBoxList();
//将箱门全部清除 //将箱门全部清除
cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>().eq(CabinetBoxPolice::getPoliceId, req.getId())); cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>().eq(CabinetBoxPolice::getPoliceId, req.getId()));
for (CabinetBoxReq boxReq:boxList ) { for (CabinetBoxReq boxReq:boxList ) {
...@@ -661,15 +645,18 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -661,15 +645,18 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
cabinetBoxPolice.setCreateTime(DateTimeUtil.getCurrentDateTime()); cabinetBoxPolice.setCreateTime(DateTimeUtil.getCurrentDateTime());
cabinetBoxPolice.setCabinetName(boxReq.getCabinetName()); cabinetBoxPolice.setCabinetName(boxReq.getCabinetName());
cabinetBoxPolice.setNum(boxReq.getNum()); cabinetBoxPolice.setNum(boxReq.getNum());
cabinetBoxPolice.setContainType(boxReq.getContainType());
cabinetBoxPoliceList.add(cabinetBoxPolice); cabinetBoxPoliceList.add(cabinetBoxPolice);
} }
if (cabinetBoxPoliceList.size()>0){ if (cabinetBoxPoliceList.size()>0){
cabinetBoxPoliceService.saveBatch(cabinetBoxPoliceList); a= cabinetBoxPoliceService.saveBatch(cabinetBoxPoliceList);
} }
}else {
a= cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>().eq(CabinetBoxPolice::getPoliceId, req.getId()));
} }
//将单警柜绑定到警员
policeman.setCabinetBoxId(req.getCabinetBoxId()); return a;
return updateById(policeman);
} }
...@@ -706,10 +693,25 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -706,10 +693,25 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public boolean changePoliceOrg(UpdateReassignmentReq req) { public boolean changePoliceOrg(UpdateReassignmentReq req) {
//通过警员id查询出该警员的基本信息 //通过警员id查询出该警员的基本信息
Policeman policeman = getById(req.getPoliceId()); Policeman policeman = getById(req.getPoliceId());
//判断是调入单还是调出单
//0是调入警员,1是调出警员
if(req.getReassigmentType()==0){
//添加账号和组织机构的绑定关系
SysUserOrg sysUserOrg = new SysUserOrg();
sysUserOrg.setOrgId(req.getOrgId());
sysUserOrg.setUserId(policeman.getUserId());
sysUserOrg.setCreateTime(DateTimeUtil.getCurrentDateTime());
sysUserOrgService.save(sysUserOrg);
//将警员中的组织机构id设置
policeman.setOrgId(req.getOrgId());
//
}else {
//将其组织机构号设为空 //将其组织机构号设为空
policeman.setOrgId(null); policeman.setOrgId(null);
//将角色关联表进行删除 //将角色关联表进行删除
//角色账号信息也进行删除 //角色账号信息也进行删除
sysUserOrgService.remove(new LambdaQueryWrapper<SysUserOrg>().eq(SysUserOrg::getUserId,policeman.getUserId()));
// sysUserRoleService.delByUserId(policeman.getUserId()); // sysUserRoleService.delByUserId(policeman.getUserId());
//修改警员的个人信息(删除指纹信息) //修改警员的个人信息(删除指纹信息)
List<PoliceFinger> fingerList = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>() List<PoliceFinger> fingerList = policeFingerService.list(new LambdaQueryWrapper<PoliceFinger>()
...@@ -719,10 +721,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -719,10 +721,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
} }
//人脸信息删除 //人脸信息删除
policeman.setFaceInfo(null); policeman.setFaceInfo(null);
//如果绑定箱门,进行解绑
if (ObjectUtil.isNotNull(policeman.getCabinetBoxId())){
policeman.setCabinetBoxId(null);
}
cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>() cabinetBoxPoliceService.remove(new LambdaQueryWrapper<CabinetBoxPolice>()
.eq(CabinetBoxPolice::getPoliceId,policeman.getId())); .eq(CabinetBoxPolice::getPoliceId,policeman.getId()));
...@@ -758,6 +757,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -758,6 +757,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
policeEquipmentService.removeBatchByIds(removeList); policeEquipmentService.removeBatchByIds(removeList);
} }
}
return updateById(policeman); return updateById(policeman);
} }
...@@ -821,7 +821,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -821,7 +821,7 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
} }
reassignment.setCreateTime(DateTimeUtil.getCurrentDateTime()); reassignment.setCreateTime(DateTimeUtil.getCurrentDateTime());
if (ObjectUtil.isNull(req.getId()) || req.getId().isEmpty()){ if (ObjectUtil.isNull(req.getId()) || req.getId().isEmpty()){
OrderNum orderNum = stocktakeService.setOrderCode("transfer", req.getOrgId()); OrderNum orderNum = stocktakeService.setOrderCode(req.getBussinessType(), req.getOrgId());
String codeValue=String.format("%04d",orderNum.getNum()); String codeValue=String.format("%04d",orderNum.getNum());
reassignment.setOrderCode(orderNum.getBussinessType()+orderNum.getYear()+ reassignment.setOrderCode(orderNum.getBussinessType()+orderNum.getYear()+
String.format("%02d", LocalDateTime.now().getMonth().getValue())+ String.format("%02d", LocalDateTime.now().getMonth().getValue())+
...@@ -836,7 +836,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -836,7 +836,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
startProcessInstanceDTO.setOrderId(reassignment.getId()); startProcessInstanceDTO.setOrderId(reassignment.getId());
startProcessInstanceDTO.setOrderType("reassigment"); startProcessInstanceDTO.setOrderType("reassigment");
startProcessInstanceDTO.setUserId(req.getUserId()); startProcessInstanceDTO.setUserId(req.getUserId());
startProcessInstanceDTO.setBussinessType("transfer"); startProcessInstanceDTO.setBussinessType(req.getBussinessType());
startProcessInstanceDTO.setReassigmentType(req.getReassigmentType());
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO); String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
reassignment.setProcessId(ProcessInstanceId); reassignment.setProcessId(ProcessInstanceId);
String assigns= FlowInstanceService.GetNextAssign(ProcessInstanceId);//这里需要手动更新审核人信息 String assigns= FlowInstanceService.GetNextAssign(ProcessInstanceId);//这里需要手动更新审核人信息
...@@ -936,54 +937,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman ...@@ -936,54 +937,6 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
//添加人脸和指纹照片或修改 //添加人脸和指纹照片或修改
@Override @Override
public boolean addFaceAndfinger(UpdatePolicemanReq req) { public boolean addFaceAndfinger(UpdatePolicemanReq req) {
// List<PoliceFace> addFaceInfoList=new ArrayList<>();
// List<PoliceFace> delFaceInfoList=new ArrayList<>();
// //库中存储的照片信息
// List<PoliceFace> faceList = policeFaceService.list(new LambdaQueryWrapper<PoliceFace>()
// .eq(PoliceFace::getPoliceId, req.getId()));
// List<String> faceInfoList = req.getFaceInfoList();
// Set<String> set = new HashSet<>();
// for (PoliceFace face : faceList) {
// set.add(face.getFaceInfo());
// }
// if (faceList.size()>0){
// if (faceInfoList.size()>0){
// for (String face : faceInfoList) {
// if (!set.contains(face)) {
// PoliceFace policeFace = new PoliceFace();
// policeFace.setFaceInfo(face);
// policeFace.setPoliceId(req.getId());
// policeFace.setCreateTime(DateTimeUtil.getCurrentDateTime());
// addFaceInfoList.add(policeFace);
// }
// }
// for (PoliceFace face : faceList) {
// if (!faceInfoList.contains(face.getFaceInfo())) {
// delFaceInfoList.add(face);
// }
// }
// }else {
// delFaceInfoList.addAll(faceList);
// }
// }else {
// if (faceInfoList.size()>0){
// for (String face:faceInfoList) {
// PoliceFace policeFace = new PoliceFace();
// policeFace.setFaceInfo(face);
// policeFace.setPoliceId(req.getId());
// policeFace.setCreateTime(DateTimeUtil.getCurrentDateTime());
// addFaceInfoList.add(policeFace);
// }
// }
// }
// boolean a=true;
// if (addFaceInfoList.size()>0){
// a=policeFaceService.saveBatch(addFaceInfoList);
// }
// boolean b=true;
// if (delFaceInfoList.size()>0){
// b=policeFaceService.removeByIds(delFaceInfoList);
// }
//人脸 //人脸
boolean a=true; boolean a=true;
boolean flag=false; boolean flag=false;
......
...@@ -29,6 +29,9 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i ...@@ -29,6 +29,9 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
@Resource @Resource
OrderMainService orderMainService; OrderMainService orderMainService;
@Resource
private SupplierMapper supplierMapper;
@Override @Override
public String AddSupplier(UpdateSupplierReq req) { public String AddSupplier(UpdateSupplierReq req) {
Supplier one = getOne(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, req.getName())); Supplier one = getOne(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, req.getName()));
...@@ -101,12 +104,20 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i ...@@ -101,12 +104,20 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
LambdaQueryWrapper<Supplier> wrapper = createWrapper(req); LambdaQueryWrapper<Supplier> wrapper = createWrapper(req);
List<SupplierDto> dto=new ArrayList<>(); List<SupplierDto> dto=new ArrayList<>();
this.list(wrapper).forEach(p->
{ //判断是否需要全部的厂商商信息还是只需要名字去重的厂商名称,如果是去重的,这里给true,但是返回的id默认是第一个名称的id
if (ObjectUtil.isNotNull(req.getFlag()) && req.getFlag()){
dto=supplierMapper.selectDistinctList();
}else {
List<Supplier> list = this.list(wrapper);
for (Supplier supplier:list) {
SupplierDto sd=new SupplierDto(); SupplierDto sd=new SupplierDto();
BeanPlusUtil.copyProperties(p, sd); BeanPlusUtil.copyProperties(supplier, sd);
dto.add(sd); dto.add(sd);
}); }
}
return dto; return dto;
} }
......
...@@ -5,8 +5,8 @@ import java.util.List; ...@@ -5,8 +5,8 @@ import java.util.List;
public class CreateNullData { public class CreateNullData {
public static <T> List<T> createNullData(List<T> info,Long pageNo,Class<T> clazz) { public static <T> List<T> createNullData(Long size,Long pageNo,Class<T> clazz) {
int size = info.size();
//余数 //余数
long num= size % 10; long num= size % 10;
//整数 //整数
......
...@@ -77,11 +77,11 @@ ...@@ -77,11 +77,11 @@
FROM base_cabinet c FROM base_cabinet c
JOIN pub_org o ON c.org_id_int = o.org_id JOIN pub_org o ON c.org_id_int = o.org_id
WHERE c.org_id_int = #{orgId} WHERE c.org_id_int = #{orgId}
AND (#{boxType} IS NULL OR #{boxType} = '' OR EXISTS ( AND (#{containType} IS NULL OR #{containType} = '' OR EXISTS (
SELECT 1 SELECT 1
FROM base_cabinet_box cb FROM base_cabinet_box cb
WHERE cb.cabinet_id = c.id WHERE cb.cabinet_id = c.id
AND cb.box_type = #{boxType} AND cb.contain_type = #{containType}
)) ))
</select> </select>
......
...@@ -252,7 +252,7 @@ WHERE o.org_id IN ...@@ -252,7 +252,7 @@ WHERE o.org_id IN
select b.* FROM( select b.* FROM(
select select
su.user_id,su.account,su.status_flag as state,suo.org_id,p.id,p.name,p.cabinet_box_id,p.police_code, su.user_id,su.account,su.status_flag as state,suo.org_id,p.id,p.name,p.cabinet_box_id,p.police_code,
p.face_info,p.password,p.photo,p.phone,p.id_card,p.identity,su.create_time p.face_info,p.password,p.photo,p.phone,p.id_card,p.identity,su.create_time,p.hk_face_device
FROM sys_user su FROM sys_user su
join sys_user_org suo on su.user_id=suo.user_id and suo.org_id=#{orgId} join sys_user_org suo on su.user_id=suo.user_id and suo.org_id=#{orgId}
left join base_policeman p on p.user_id=su.user_id left join base_policeman p on p.user_id=su.user_id
......
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
id, equipment_id, `name`, supplier_code, short_name, contacts, create_time, create_user, id, equipment_id, `name`, supplier_code, short_name, contacts, create_time, create_user,
update_time, update_user update_time, update_user
</sql> </sql>
<select id="selectDistinctList" resultType="com.junmp.jyzb.api.bean.dto.SupplierDto">
SELECT MIN(id) AS id, name
FROM base_supplier
GROUP BY name
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -27,4 +27,9 @@ public class ApplyDTO extends PageDTO { ...@@ -27,4 +27,9 @@ public class ApplyDTO extends PageDTO {
private String typeName; private String typeName;
//审核状态 //审核状态
private String businessStatus; private String businessStatus;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
} }
...@@ -34,4 +34,7 @@ public class StartProcessInstanceDTO { ...@@ -34,4 +34,7 @@ public class StartProcessInstanceDTO {
//出入库单据状态(出库还是入库) //出入库单据状态(出库还是入库)
private String outInState; private String outInState;
//调岗类型,调入还是调出
private Integer reassigmentType;
} }
...@@ -30,4 +30,7 @@ public class TaskDTO extends PageDTO { ...@@ -30,4 +30,7 @@ public class TaskDTO extends PageDTO {
private String typeName; private String typeName;
//审核状态 //审核状态
private String businessStatus; private String businessStatus;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
} }
...@@ -22,8 +22,10 @@ import com.junmp.junmpProcess.mapper.OrgUserMapper; ...@@ -22,8 +22,10 @@ import com.junmp.junmpProcess.mapper.OrgUserMapper;
import com.junmp.junmpProcess.service.IFlowInstanceService; import com.junmp.junmpProcess.service.IFlowInstanceService;
import com.junmp.junmpProcess.service.IFlowTaskService; import com.junmp.junmpProcess.service.IFlowTaskService;
import com.junmp.junmpProcess.service.Repository.ProcessTemplateService; import com.junmp.junmpProcess.service.Repository.ProcessTemplateService;
import com.junmp.junmpProcess.utils.CreateNullData;
import com.junmp.junmpProcess.vo.*; import com.junmp.junmpProcess.vo.*;
import com.junmp.jyzb.api.bean.dto.BusFormDto; import com.junmp.jyzb.api.bean.dto.BusFormDto;
import com.junmp.jyzb.api.bean.dto.PolicemanDto;
import com.junmp.v2.auth.api.bean.login.LoginUser; import com.junmp.v2.auth.api.bean.login.LoginUser;
import com.junmp.v2.auth.api.context.LoginContext; import com.junmp.v2.auth.api.context.LoginContext;
import com.junmp.v2.common.bean.response.ApiRes; import com.junmp.v2.common.bean.response.ApiRes;
...@@ -350,6 +352,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -350,6 +352,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
taskVOS.addAll(taskVOList); taskVOS.addAll(taskVOList);
} }
//判断是否需要添加空数据
if(taskDTO.getIsCreateNullDate()==null || taskDTO.getIsCreateNullDate()){
Class<TaskVO> taskVO = TaskVO.class;
List<TaskVO> nullData = CreateNullData.createNullData(count, Long.valueOf(taskDTO.getPageNo()), taskVO);
taskVOS.addAll(nullData);
}
page.setRecords(taskVOS); page.setRecords(taskVOS);
page.setTotal(count); page.setTotal(count);
page.setCurrent(taskDTO.getPageNo()); page.setCurrent(taskDTO.getPageNo());
...@@ -475,6 +484,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -475,6 +484,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
} }
taskVOS.addAll(taskVOList); taskVOS.addAll(taskVOList);
} }
//判断是否需要添加空数据
if(taskDTO.getIsCreateNullDate()==null || taskDTO.getIsCreateNullDate()){
Class<TaskVO> taskVO = TaskVO.class;
List<TaskVO> nullData = CreateNullData.createNullData(count, Long.valueOf(taskDTO.getPageNo()), taskVO);
taskVOS.addAll(nullData);
}
page.setRecords(taskVOS); page.setRecords(taskVOS);
page.setCurrent(taskDTO.getPageNo()); page.setCurrent(taskDTO.getPageNo());
page.setSize(taskDTO.getPageSize()); page.setSize(taskDTO.getPageSize());
...@@ -586,22 +603,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask ...@@ -586,22 +603,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
historyProcessInstanceVO.setDuration(spendTimes); historyProcessInstanceVO.setDuration(spendTimes);
historyProcessInstanceVOS.add(historyProcessInstanceVO); historyProcessInstanceVOS.add(historyProcessInstanceVO);
} }
//余数 //判断是否需要添加空数据
long num= count % 10; if(applyDTO.getIsCreateNullDate()==null || applyDTO.getIsCreateNullDate()){
//整数 Class<HistoryProcessInstanceVO> historyProcessInstanceVO = HistoryProcessInstanceVO.class;
long integer=count / 10; List<HistoryProcessInstanceVO> nullData = CreateNullData.createNullData(count, Long.valueOf(applyDTO.getPageNo()), historyProcessInstanceVO);
List<HistoryProcessInstanceVO> historyProcessInstanceVOList=new ArrayList<>(); historyProcessInstanceVOS.addAll(nullData);
if (num!=0){
//判断整数是什么,就在第几页进行补
if(applyDTO.getPageNo()-1==integer){
for (int i = 0; i < 10-num; i++) {
HistoryProcessInstanceVO historyProcessInstanceVO = new HistoryProcessInstanceVO();
historyProcessInstanceVOList.add(historyProcessInstanceVO);
}
} }
historyProcessInstanceVOS.addAll(historyProcessInstanceVOList);
}
pageResult.setRecords(historyProcessInstanceVOS); pageResult.setRecords(historyProcessInstanceVOS);
// pageResult.setTotalRows(Long.valueOf(applyDTO.getPageNo())); // pageResult.setTotalRows(Long.valueOf(applyDTO.getPageNo()));
pageResult.setTotalRows(count); pageResult.setTotalRows(count);
......
package com.junmp.jyzb.utils; package com.junmp.junmpProcess.utils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论