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();
} }
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论