Commit 8eda3b0e by 李小惠

1

parent 508f4720
......@@ -180,4 +180,19 @@ public class BusFormDto {
*/
private String currentAssign;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
}
......@@ -46,6 +46,6 @@ public class CabinetBoxDto implements Serializable {
* 箱门类型:1单警柜,2公共柜
*/
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
private Integer boxType;
private Integer containType;
}
......@@ -22,6 +22,8 @@ public class CabinetBoxPoliceDto {
private Integer num;
private Integer box_type;
/**
* 主柜号
*/
......
......@@ -46,4 +46,19 @@ public class OrderDetailDto implements Serializable {
* 在库数
*/
private Integer stockNumber;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
}
......@@ -12,9 +12,10 @@ public class PolicemanDto {
private String name;
private String cabinetBoxId;
private List<CabinetBoxPoliceDto> cabinetBoxList;
private List<String> soloBoxList;
private List<String> publicBoxList;
private String soloBoxName;
private String publicBoxName;
private String policeCode;
private String sex;
......
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.api.bean.query;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class BussinessOrderDetialReq {
......@@ -23,4 +24,21 @@ public class BussinessOrderDetialReq {
private BigDecimal totalPrice;
//备注
private String remark;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
//在库数
private Integer stockNumber;
}
......@@ -62,7 +62,7 @@ public class CabinetBoxReq extends BaseRequest {
*/
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
private String boxType;
private Integer containType;
private String cabinetName;
......
......@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
......@@ -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 = "单警柜编号")
private String serialNum;
private String serverNum;
/**
* 箱数
......
......@@ -58,4 +58,19 @@ public class OrderDetailReq extends BaseRequest {
*/
private Integer modifyQuantity;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
}
......@@ -19,9 +19,6 @@ public class PolicemanReq extends BaseRequest {
@NotBlank(message = "姓名不能为空", groups = {add.class})
private String name;
@NotBlank(message = "箱门id不能为空", groups = { delete.class})
private String cabinetBoxId;
private String cabinetId;
private List<CabinetBoxReq> boxList;
......@@ -40,6 +37,8 @@ public class PolicemanReq extends BaseRequest {
//判断是否将系统账号和警员账号返回,如果是true,那么直接将警员返回,如果为空或者其他值,那么将系统账号和警员一起返回
private String flag;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
private String doorCode;
......
......@@ -208,4 +208,7 @@ public class QueryBusFormReq extends BaseRequest {
//当前登录人员
private String userId;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
}
......@@ -26,4 +26,7 @@ public class QuerySupplierReq extends BaseRequest {
private Integer state;
//联系人
private String contacts;
//判断是否需要全部的厂商商信息还是只需要名字去重的厂商名称,如果是去重的,这里给true
private Boolean flag;
}
......@@ -21,7 +21,7 @@ public class UpdateCabinetBoxReq extends BaseRequest {
private String boxName;
private String equipmentConfig;
private String boxType;
private Integer containType;
private String power;
private List<String> boxNum;
private Integer num;
......
......@@ -64,4 +64,19 @@ public class UpdateOrderDetailReq implements Serializable {
private Integer modifyQuantity;
/**
* 生产日期
*/
private Date productionDate;
/**
* 质保期
*/
private Integer warrantyPeriod;
/**
* 维保期
*/
private Integer maintenancePeriod;
}
......@@ -19,7 +19,6 @@ public class UpdatePolicemanReq extends BaseRequest {
@NotBlank(message = "警员名字不能为空", groups = {add.class,edit.class})
private String name;
private String cabinetBoxId;
@NotNull(message = "组织机构id不能为空", groups = {add.class,edit.class})
private Long orgId;
......
......@@ -104,15 +104,15 @@ public class CabinetController {
@PostMapping("/boxBindPolice")
@ApiOperation("箱门绑定人员")
public ApiRes<Boolean> boxBindPolice(@RequestBody CabinetBoxReq req) {
boolean result = cabinetService.boxBindPolice(req);
if (!result){
return ApiRes.failure("操作失败");
}
return ApiRes.success(result);
}
// @PostMapping("/boxBindPolice")
// @ApiOperation("箱门绑定人员")
// public ApiRes<Boolean> boxBindPolice(@RequestBody CabinetBoxReq req) {
// boolean result = cabinetService.boxBindPolice(req);
// if (!result){
// return ApiRes.failure("操作失败");
// }
// return ApiRes.success(result);
// }
@PostMapping("/SearchOrgId")
@ApiOperation("/根据单警柜id查询组织机构id")
......
......@@ -3,6 +3,7 @@ package com.junmp.jyzb.controller.ES;
import com.junmp.jyzb.Repository.BlogRepository;
import com.junmp.jyzb.entity.ES.Blog;
import com.junmp.jyzb.entity.EquipmentSize;
import com.junmp.jyzb.service.BusFormService;
import com.junmp.jyzb.service.EquipmentSizeService;
import com.junmp.jyzb.service.EquipmentTypeService;
import com.junmp.jyzb.service.PubOrgService;
......@@ -38,6 +39,9 @@ public class CrudController {
public EquipmentSizeService equipmentSizeService;
@Resource
public PubOrgService pubOrgService;
@Resource
public BusFormService busFormService;
@ApiOperation("测试")
@PostMapping("testDocument")
public Object testDocument() {
......@@ -55,6 +59,7 @@ public class CrudController {
pubOrgService.AddToEs();
equipmentTypeService.addEs();
equipmentSizeService.addEs();
busFormService.addEs();
return true;
}
@ApiOperation("添加单个文档")
......
......@@ -5,7 +5,12 @@ import com.baomidou.mybatisplus.annotation.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
/**
......@@ -14,12 +19,16 @@ import org.springframework.data.elasticsearch.annotations.Document;
*/
@TableName(value ="bussiness_bus_form")
@Data
@Document(indexName = "busform", shards = 1, replicas = 1)
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "busform")
@JsonIgnoreProperties(ignoreUnknown = true)
public class BusForm implements Serializable {
/**
* id
*/
@TableId(value = "id",type = IdType.ASSIGN_UUID)
@Id
private String id;
/**
......@@ -134,17 +143,6 @@ public class BusForm implements Serializable {
@TableField(value = "apply_time")
private Date applyTime;
/**
* 申请人
*/
@TableField(value = "apply_user")
private String applyUser;
/**
* 申请人id
*/
@TableField(value = "apply_user_id")
private String applyUserId;
/**
* 调拨类型(2支拨,1价拨)
......@@ -232,7 +230,6 @@ public class BusForm implements Serializable {
@TableField(value = "use_count")
private String useCount;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -71,8 +71,8 @@ public class CabinetBox implements Serializable {
* 箱门类型:1单警柜,2公共柜
*/
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
@TableField("box_type")
private String boxType;
@TableField("contain_type")
private Integer containType;
/**
* 使用日志存储位置信息
*/
......@@ -80,12 +80,6 @@ public class CabinetBox implements Serializable {
@TableField("log_map")
private String logMap;
/**
* 箱门类型:1单警柜,2公共柜
*/
@ApiModelProperty(value = "箱门类型:1单警柜,2公共柜")
@TableField("box_type")
private Integer boxType;
private static final long serialVersionUID = 1L;
......
......@@ -58,6 +58,12 @@ public class CabinetBoxPolice implements Serializable {
@TableField(value = "update_time")
private Date updateTime;
/**
* 箱门类型(1单警柜,2公共柜)
*/
@TableField(value = "contain_type")
private Integer containType;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
......
......@@ -85,5 +85,21 @@ import java.util.Date;
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 {
@TableField(value = "name")
private String name;
@TableField(value = "cabinet_box_id",updateStrategy = FieldStrategy.IGNORED)
private String cabinetBoxId;
@TableField(value = "org_id_int",updateStrategy = FieldStrategy.IGNORED)
private Long orgId;
......
......@@ -83,6 +83,7 @@ import java.util.stream.Collectors;
for (HistoricVariableInstance a:bussinessType) {
System.out.println("a = " + a);
}
if(orderType.size()>0) {
......@@ -116,13 +117,18 @@ import java.util.stream.Collectors;
BusForm busForm = busFormService.getOne(new LambdaQueryWrapper<BusForm>()
.eq(BusForm::getProcessId, processInstanceId));
busForm.setExamineState("finished");
// if (){
// String detailList = busForm.getDetailList();
// List<BussinessOrderDetialReq> list = JSON.parseArray(detailList, BussinessOrderDetialReq.class);
// for (:) {
//
// }
// }
if (busForm.getBussinessType().equals("remove")){
String detailList = busForm.getDetailList();
List<BussinessOrderDetialReq> list = JSON.parseArray(detailList, BussinessOrderDetialReq.class);
for (BussinessOrderDetialReq bussinessOrderDetialReq:list) {
//如果数量相同则直接将全部在库数的装备表中的该仓库的装备状态全部设置为报废,并且修改库存汇总表中的数据
if (bussinessOrderDetialReq.getPlanNum()==bussinessOrderDetialReq.getStockNumber()){
}else {//如果数量不相等,状态不进行修改,只修改库存汇总表中的信息
}
}
}
busFormService.updateById(busForm);
}
if (Type.equals("reassigment")){//调岗申请单
......
......@@ -13,7 +13,7 @@ import java.util.Map;
public interface CabinetMapper extends BaseMapper<Cabinet> {
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);
}
\ No newline at end of file
package com.junmp.jyzb.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.api.bean.dto.SupplierDto;
import com.junmp.jyzb.entity.Supplier;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
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> {
* @param req
* @return
*/
boolean boxBindPolice(CabinetBoxReq req);
// boolean boxBindPolice(CabinetBoxReq req);
/**
......
......@@ -24,6 +24,7 @@ import com.junmp.jyzb.service.BusFormService;
import com.junmp.jyzb.mapper.BusFormMapper;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.StocktakeService;
import com.junmp.jyzb.utils.CreateNullData;
import com.junmp.jyzb.utils.DateTimeUtil;
import com.junmp.v2.common.exception.base.ServiceException;
import com.junmp.v2.common.util.BeanPlusUtil;
......@@ -221,20 +222,12 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
BeanPlusUtil.copyProperties(busForm, busFormDto);
return busFormDto;
}).collect(Collectors.toList());
//余数
long num= size % 10;
//整数
long integer=size / 10;
List<BusFormDto> collect1=new ArrayList<>();
if (num!=0){
//判断整数是什么,就在第几页进行补
if(req.getPageNo()-1==integer){
for (int i = 0; i < 10-num; i++) {
BusFormDto busFormDto = new BusFormDto();
collect1.add(busFormDto);
}
}
collect.addAll(collect1);
//创建空的数据返回前端
if(req.getIsCreateNullDate()==null || req.getIsCreateNullDate()){
Class<BusFormDto> busFormDto=BusFormDto.class;
List<BusFormDto> nullData = CreateNullData.createNullData(size, req.getPageNo(), busFormDto);
collect.addAll(nullData);
}
Page<BusFormDto> page1=new Page<>(req.getPageNo(),req.getPageSize());
......
......@@ -66,7 +66,7 @@ public class CabinetBoxServiceImpl extends ServiceImpl<CabinetBoxMapper, Cabinet
box.setCabinetId(cabinet.getId());
box.setPower(boxReq.getPower());
box.setEquipmentConfig(boxReq.getEquipmentConfig());
box.setBoxType(boxReq.getBoxType());
box.setContainType(boxReq.getContainType());
box.setState(0);
box.setBoxName(boxReq.getBoxName());
box.setNum(boxReq.getNum());
......
......@@ -45,6 +45,9 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
private CabinetBoxService cabinetBoxService;
@Resource
private PolicemanService policemanService;
@Resource
private CabinetBoxPoliceService cabinetBoxPoliceService;
@Autowired
private RabbitMQSendMsg MQ;
......@@ -102,7 +105,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
box.setCabinetId(cabinet.getId());
box.setPower(boxReq.getPower());
box.setEquipmentConfig(boxReq.getEquipmentConfig());
box.setBoxType(boxReq.getBoxType());
box.setContainType(boxReq.getContainType());
box.setState(0);
box.setNum(boxReq.getNum());
return box;
......@@ -144,24 +147,16 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
//通过单警柜id循环遍历出并删除所有箱门信息
List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>()
.eq(ObjectUtil.isNotEmpty(id), CabinetBox::getCabinetId, id));
//创建police列表方便批量删除操作
List<Policeman> policemanList=new ArrayList<>();
//创建cabinetBox列表方便批量删除操作
List<CabinetBox> cabinetBoxList=new ArrayList<>();
for (CabinetBox cabinetBox: list) {
CabinetBox cabinetBox1 = new CabinetBox();
BeanPlusUtil.copyProperties(cabinetBox,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);
//批量删除单警柜id
......@@ -210,7 +205,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
LambdaQueryWrapper<Cabinet> eq = new LambdaQueryWrapper<Cabinet>()
.eq(Cabinet::getOrgIdInt, req.getOrgId())
.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 开始分页
Page<Cabinet> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
......@@ -250,12 +245,12 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
@Override
public CabinetDto showOneCabinet(CabinetReq req) {
// 查询单警柜信息
Cabinet cabinet = CabinetExistByNum(req.getSerialNum());
Cabinet cabinet = CabinetExistByNum(req.getServerNum());
// 查询单警柜的箱门信息
List<CabinetBox> list = cabinetBoxService.list(new LambdaQueryWrapper<CabinetBox>()
.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()
.map(cabinetBox -> {
......@@ -333,40 +328,40 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
* @param req
* @return
*/
@Override
public boolean boxBindPolice(CabinetBoxReq req) {
//通过箱门id查询出箱门信息
CabinetBox one = cabinetBoxService.getOne(new LambdaQueryWrapper<CabinetBox>()
.eq(ObjectUtil.isNotEmpty(req.getId()), CabinetBox::getId, req.getId()));
if (ObjectUtil.isEmpty(one)){
//箱门id不存在
throw new ServiceException(CabinetExceptionEnum.CABINETBOX_ISNOT_EXISTS);
}
//获取箱门的主柜id
String cabinetId = one.getCabinetId();
//通过主柜id获取机构id
Cabinet one1 = getOne(new LambdaQueryWrapper<Cabinet>()
.eq(ObjectUtil.isNotEmpty(cabinetId), Cabinet::getId,cabinetId));
if (ObjectUtil.isEmpty(one1)){
//单警柜不存在异常
throw new ServiceException(CabinetExceptionEnum.CABINET_ISNOT_EXISTS);
}
long orgId = one1.getOrgIdInt();
//通过警员id获取警员所在的机构id
Policeman one2 = policemanService.getOne(new LambdaQueryWrapper<Policeman>()
.eq(ObjectUtil.isNotEmpty(req.getPoliceId()), Policeman::getId, req.getPoliceId()));
if (ObjectUtil.isEmpty(one2)){
//警员不存在异常
throw new ServiceException(PolicemanExceptionEnum.POLICEMAN_NOT_EXIST);
}
Long orgId1 = one2.getOrgId();
//判断两个机构id是否相同,相同则可以绑定,不相同则绑定失败
if (!(orgId1==orgId)){
return false;
}
one2.setCabinetBoxId(one.getId());
return policemanService.updateById(one2);
}
// @Override
// public boolean boxBindPolice(CabinetBoxReq req) {
// //通过箱门id查询出箱门信息
// CabinetBox one = cabinetBoxService.getOne(new LambdaQueryWrapper<CabinetBox>()
// .eq(ObjectUtil.isNotEmpty(req.getId()), CabinetBox::getId, req.getId()));
// if (ObjectUtil.isEmpty(one)){
// //箱门id不存在
// throw new ServiceException(CabinetExceptionEnum.CABINETBOX_ISNOT_EXISTS);
// }
// //获取箱门的主柜id
// String cabinetId = one.getCabinetId();
// //通过主柜id获取机构id
// Cabinet one1 = getOne(new LambdaQueryWrapper<Cabinet>()
// .eq(ObjectUtil.isNotEmpty(cabinetId), Cabinet::getId,cabinetId));
// if (ObjectUtil.isEmpty(one1)){
// //单警柜不存在异常
// throw new ServiceException(CabinetExceptionEnum.CABINET_ISNOT_EXISTS);
// }
// long orgId = one1.getOrgIdInt();
// //通过警员id获取警员所在的机构id
// Policeman one2 = policemanService.getOne(new LambdaQueryWrapper<Policeman>()
// .eq(ObjectUtil.isNotEmpty(req.getPoliceId()), Policeman::getId, req.getPoliceId()));
// if (ObjectUtil.isEmpty(one2)){
// //警员不存在异常
// throw new ServiceException(PolicemanExceptionEnum.POLICEMAN_NOT_EXIST);
// }
// Long orgId1 = one2.getOrgId();
// //判断两个机构id是否相同,相同则可以绑定,不相同则绑定失败
// if (!(orgId1==orgId)){
// return false;
// }
// one2.setCabinetBoxId(one.getId());
// return policemanService.updateById(one2);
// }
/**
......@@ -394,7 +389,7 @@ public class CabinetServiceImpl extends ServiceImpl<CabinetMapper, Cabinet> impl
//根据单警柜id查询出组织机构id
@Override
public Long SearchOrgId(CabinetReq req) {
Cabinet cabinet = CabinetExistByNum(req.getSerialNum());
Cabinet cabinet = CabinetExistByNum(req.getServerNum());
return cabinet.getOrgIdInt();
}
......
......@@ -29,6 +29,9 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
@Resource
OrderMainService orderMainService;
@Resource
private SupplierMapper supplierMapper;
@Override
public String AddSupplier(UpdateSupplierReq req) {
Supplier one = getOne(new LambdaQueryWrapper<Supplier>().eq(Supplier::getName, req.getName()));
......@@ -101,12 +104,20 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
LambdaQueryWrapper<Supplier> wrapper = createWrapper(req);
List<SupplierDto> dto=new ArrayList<>();
this.list(wrapper).forEach(p->
{
SupplierDto sd=new SupplierDto();
BeanPlusUtil.copyProperties(p, sd);
dto.add(sd);
});
//判断是否需要全部的厂商商信息还是只需要名字去重的厂商名称,如果是去重的,这里给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();
BeanPlusUtil.copyProperties(supplier, sd);
dto.add(sd);
}
}
return dto;
}
......
......@@ -5,8 +5,8 @@ import java.util.List;
public class CreateNullData {
public static <T> List<T> createNullData(List<T> info,Long pageNo,Class<T> clazz) {
int size = info.size();
public static <T> List<T> createNullData(Long size,Long pageNo,Class<T> clazz) {
//余数
long num= size % 10;
//整数
......
......@@ -77,11 +77,11 @@
FROM base_cabinet c
JOIN pub_org o ON c.org_id_int = o.org_id
WHERE c.org_id_int = #{orgId}
AND (#{boxType} IS NULL OR #{boxType} = '' OR EXISTS (
AND (#{containType} IS NULL OR #{containType} = '' OR EXISTS (
SELECT 1
FROM base_cabinet_box cb
WHERE cb.cabinet_id = c.id
AND cb.box_type = #{boxType}
AND cb.contain_type = #{containType}
))
</select>
......
......@@ -252,7 +252,7 @@ WHERE o.org_id IN
select b.* FROM(
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,
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
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
......
......@@ -18,6 +18,11 @@
id, equipment_id, `name`, supplier_code, short_name, contacts, create_time, create_user,
update_time, update_user
</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>
\ No newline at end of file
......@@ -27,4 +27,9 @@ public class ApplyDTO extends PageDTO {
private String typeName;
//审核状态
private String businessStatus;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
}
......@@ -34,4 +34,7 @@ public class StartProcessInstanceDTO {
//出入库单据状态(出库还是入库)
private String outInState;
//调岗类型,调入还是调出
private Integer reassigmentType;
}
......@@ -30,4 +30,7 @@ public class TaskDTO extends PageDTO {
private String typeName;
//审核状态
private String businessStatus;
//是否创建空数据,true则创建,false则不创建
private Boolean isCreateNullDate;
}
......@@ -22,8 +22,10 @@ import com.junmp.junmpProcess.mapper.OrgUserMapper;
import com.junmp.junmpProcess.service.IFlowInstanceService;
import com.junmp.junmpProcess.service.IFlowTaskService;
import com.junmp.junmpProcess.service.Repository.ProcessTemplateService;
import com.junmp.junmpProcess.utils.CreateNullData;
import com.junmp.junmpProcess.vo.*;
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.context.LoginContext;
import com.junmp.v2.common.bean.response.ApiRes;
......@@ -350,6 +352,13 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
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.setTotal(count);
page.setCurrent(taskDTO.getPageNo());
......@@ -475,6 +484,14 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
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.setCurrent(taskDTO.getPageNo());
page.setSize(taskDTO.getPageSize());
......@@ -586,22 +603,12 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
historyProcessInstanceVO.setDuration(spendTimes);
historyProcessInstanceVOS.add(historyProcessInstanceVO);
}
//余数
long num= count % 10;
//整数
long integer=count / 10;
List<HistoryProcessInstanceVO> historyProcessInstanceVOList=new ArrayList<>();
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);
//判断是否需要添加空数据
if(applyDTO.getIsCreateNullDate()==null || applyDTO.getIsCreateNullDate()){
Class<HistoryProcessInstanceVO> historyProcessInstanceVO = HistoryProcessInstanceVO.class;
List<HistoryProcessInstanceVO> nullData = CreateNullData.createNullData(count, Long.valueOf(applyDTO.getPageNo()), historyProcessInstanceVO);
historyProcessInstanceVOS.addAll(nullData);
}
pageResult.setRecords(historyProcessInstanceVOS);
// pageResult.setTotalRows(Long.valueOf(applyDTO.getPageNo()));
pageResult.setTotalRows(count);
......
package com.junmp.jyzb.utils;
package com.junmp.junmpProcess.utils;
import java.util.ArrayList;
import java.util.List;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论