Commit a4834e3e by 李小惠

修改接口bug以及新增需要参数,删除不需要的接口

parent a30195b9
......@@ -40,6 +40,16 @@ public class BusFormDto {
private String orgName;
/**
* 发物单位id
*/
private Long startOrgId;
/**
* 发物单位
*/
private String startOrgName;
/**
* 收物单位id
*/
private Long endOrgId;
......@@ -69,6 +79,8 @@ public class BusFormDto {
*/
private String attachmentLocation;
private String agentId;
/**
* 经办人
*/
......@@ -107,7 +119,7 @@ public class BusFormDto {
/**
* 调拨类型(2支拨,1价拨)
*/
private Integer transferType;
private String allocateType;
/**
* 备注
......@@ -144,4 +156,25 @@ public class BusFormDto {
* 更新人
*/
private String updateUser;
/**
* 报废类型(1报废出库,2移入报废区)
*/
private Integer type;
/**
* 维修单位id
*/
private String repairId;
/**
* 维修单位名称
*/
private String repairName;
/**
* 销毁、报废单位id
*/
private String destoryId;
/**
* 销毁、报废单位名称
*/
private String destoryName;
}
......@@ -76,4 +76,6 @@ public class EquipmentSizeDto {
private String photo;
private String instructions;
}
......@@ -13,6 +13,7 @@ public class InventorySumReq extends BaseRequest {
* 组织机构
*/
private Long orgId;
/**
* 组织机构名称
*/
......@@ -57,5 +58,33 @@ public class InventorySumReq extends BaseRequest {
*/
private String column;
/**
* 装备总数
*/
private String number;
/**
* 在库数
*/
private String stockNumber;
/**
* 出库数
*/
private String outboundNumber;
/**
* 过质保数
*/
private String expireNumber;
/**
* 报废数
*/
private String brokenNumber;
/**
* 单价
*/
private String unitPrice;
/**
* 总金额
*/
private String price;
}
......@@ -45,6 +45,16 @@ public class QueryBusFormReq extends BaseRequest {
private String orgName;
/**
* 发物单位id
*/
private Long startOrgId;
/**
* 发物单位
*/
private String startOrgName;
/**
* 收物单位id
*/
private Long endOrgId;
......@@ -73,6 +83,8 @@ public class QueryBusFormReq extends BaseRequest {
* 附件地址
*/
private String attachmentLocation;
private String agentId;
/**
* 经办人
*/
......@@ -112,7 +124,7 @@ public class QueryBusFormReq extends BaseRequest {
/**
* 调拨类型(2支拨,1价拨)
*/
private Integer transferType;
private Integer allocateType;
/**
* 备注
......@@ -169,4 +181,26 @@ public class QueryBusFormReq extends BaseRequest {
* 排序规则
*/
private String order;
/**
* 报废类型(1报废出库,2移入报废区)
*/
private Integer type;
/**
* 维修单位id
*/
private String repairId;
/**
* 维修单位名称
*/
private String repairName;
/**
* 销毁、报废单位id
*/
private String destoryId;
/**
* 销毁、报废单位名称
*/
private String destoryName;
}
......@@ -25,4 +25,6 @@ public class QueryEquipmentSizeReq extends BaseRequest {
private BigDecimal price;
private Integer state;
private String instructions;
}
......@@ -19,14 +19,26 @@ public class CabinetInOutRecordsReq {
//出入设备:0手持机/1单警柜/2通道
private Integer deviceType;
/**
* 单警柜id
*/
private String locationId;
//单警柜名称
private String locationName;
/**
* 箱门id
*/
private String cabinetboxId;
//操作时间
private Date useTIme;
/**
* 操作人员
*/
private String userName;
/**
* 出入装备集合
*/
private List<InventoryReq> inventoryList;
}
......@@ -6,6 +6,7 @@ import com.junmp.jyzb.api.bean.query.OrderMainReq;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@Data
......@@ -20,5 +21,13 @@ public class RabbitMqOrderReq implements Serializable {
private String device;
//出入设备
private Integer deviceType;
/**
* 操作人员
*/
private String userName;
/**
* 操作时间
*/
private Date useTime;
}
......@@ -18,7 +18,7 @@ public class UpdateBusFormReq extends BaseRequest {
@NotBlank(message = "单据id不能为空",groups = {edit.class})
private String id;
private String userId;
// private String userId;
/**
* 工作流id
*/
......@@ -47,6 +47,15 @@ public class UpdateBusFormReq extends BaseRequest {
private String orgName;
/**
* 发物单位id
*/
private Long startOrgId;
/**
* 发物单位
*/
private String startOrgName;
/**
* 收物单位id
*/
private Long endOrgId;
......@@ -76,6 +85,7 @@ public class UpdateBusFormReq extends BaseRequest {
*/
private String attachmentLocation;
private String agentId;
/**
* 经办人
*/
......@@ -114,7 +124,7 @@ public class UpdateBusFormReq extends BaseRequest {
/**
* 调拨类型(2支拨,1价拨)
*/
private Integer transferType;
private Integer allocateType;
/**
* 备注
......@@ -151,4 +161,26 @@ public class UpdateBusFormReq extends BaseRequest {
* 更新人
*/
private String updateUser;
/**
* 报废类型(1报废出库,2移入报废区)
*/
private Integer type;
/**
* 维修单位id
*/
private String repairId;
/**
* 维修单位名称
*/
private String repairName;
/**
* 销毁、报废单位id
*/
private String destoryId;
/**
* 销毁、报废单位名称
*/
private String destoryName;
}
......@@ -27,4 +27,6 @@ public class UpdateEquipmentSizeReq {
private String state;
private String photo;
private String instructions;
}
......@@ -36,6 +36,9 @@ public class UpdatePolicemanReq extends BaseRequest {
private String doorCode;
/**
* 用户名
*/
private String account;
private String password;
......
......@@ -91,7 +91,7 @@ public class InventoryController {
return ApiRes.success(inventorySummaryService.getEquipmentInfo(req));
}
//根据组织机构id/单警柜id/仓库id查询出库存汇总数量以及金额
//根据组织机构id/单警柜id/仓库id查询出库存汇总数量以及金额(和getEquipmentInfo同时调用,汇总出符合查询条件的装备)
@PostMapping("/getTotalNumberAndPrice")
@ApiOperation("查询总金额以及各个汇总数量")
public ApiRes<List<InventorySummary>> getTotalNumberAndPrice(@RequestBody InventorySumReq req){
......@@ -99,20 +99,6 @@ public class InventoryController {
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是List)
@PostMapping("/")
@ApiOperation("查询库存装备详细信息(list)")
public ApiRes<List<InventoryDto>> EqsBySearchType(@RequestBody @Validated(ValidationApi.edit.class) InventoryReq req ){
return ApiRes.success(inventoryService.EqsBySearchType(req));
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
@PostMapping("/EqsByTypePage")
@ApiOperation("查询库存装备详细信息(page)")
public ApiRes<PageResult<InventoryDto>> EqsByTypePage(@RequestBody @Validated(ValidationApi.edit.class) InventoryReq req ){
return ApiRes.success(inventoryService.EqsByTypePage(req));
}
//根据装备id查询出装备的详细信息
@PostMapping("/GetDetail")
@ApiOperation("根据装备id查询装备明细信息")
......@@ -202,7 +188,7 @@ public class InventoryController {
return ApiRes.success(inventoryService.GetListEquipment(req));
}
//根据条件查询仓库/单警柜下的所有装备信息(业务状态,在库状态,仓库id,超期状态)
//根据条件查询仓库/单警柜下的所有装备信息
@PostMapping("/GetDetailByTerms")
@ApiOperation("根据条件查询仓库/单警柜下的所有装备信息")
public ApiRes<PageResult<InventoryDto>> GetDetailByTerms(@RequestBody @Validated(ValidationApi.export.class) InventoryReq req){
......@@ -254,6 +240,7 @@ public class InventoryController {
@PostMapping("/test")
public ApiRes<Boolean> test(@RequestBody InventorySumReq req){
System.out.println("req = " + req);
return ApiRes.success(true);
}
......
......@@ -51,6 +51,17 @@ public class BusForm implements Serializable {
private String orgName;
/**
* 发物单位id
*/
@TableField(value = "start_org_id")
private Long startOrgId;
/**
* 发物单位
*/
@TableField(value = "start_org_name")
private String startOrgName;
/**
* 收物单位id
*/
@TableField(value = "end_org_id")
......@@ -85,6 +96,11 @@ public class BusForm implements Serializable {
*/
@TableField(value = "attachment_location")
private String attachmentLocation;
/**
* 经办人id
*/
@TableField(value = "agent_id")
private String agentId;
/**
* 经办人
......@@ -131,8 +147,8 @@ public class BusForm implements Serializable {
/**
* 调拨类型(2支拨,1价拨)
*/
@TableField(value = "transfer_type")
private Integer transferType;
@TableField(value = "allocate_type")
private Integer allocateType;
/**
* 备注
......@@ -187,6 +203,31 @@ public class BusForm implements Serializable {
@TableField(value = "update_user")
private String updateUser;
/**
* 报废类型(1报废出库,2移入报废区)
*/
private Integer type;
/**
* 维修单位id
*/
@TableField(value = "repair_id")
private String repairId;
/**
* 维修单位名称
*/
@TableField(value = "repair_name")
private String repairName;
/**
* 销毁、报废单位id
*/
@TableField(value = "destory_id")
private String destoryId;
/**
* 销毁、报废单位名称
*/
@TableField(value = "destory_name")
private String destoryName;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -81,5 +81,11 @@ public class EquipmentSize implements Serializable {
private String photo;
/**
* 使用教学说明
*/
@TableField(value = "instructions")
private String instructions;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -191,6 +191,8 @@ public class InventorySummary implements Serializable {
@TableField(exist = false,updateStrategy = FieldStrategy.IGNORED)
private String photo;
@TableField(exist = false)
private String instructions;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -31,7 +31,6 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
//根据仓库统计装备信息
boolean SetWarehouseInventory(@Param("brokenNumberDays") Integer brokenNumberDays);
List<InventoryDto> EqsBySearchType(InventoryReq req);
//根据货架id查询汇总信息(list)
List<InventorySummary> getSumByShelf(String shelfId);
......@@ -54,7 +53,6 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
//查询组织机构下面的装备信息
List<InventoryVo> selectListByOrg(Long orgId);
IPage<InventoryDto> EqsByTypePage(Page<InventoryDto> page,@Param("queryType")String queryType,@Param("orgId") Long orgId,@Param("warehouseId")String warehouseId,@Param("cabinetId")String cabinetId);
//通过单警柜箱门id获取箱门下的装备汇总信息(page)
IPage<InventorySummary> EqsByCabinetBoxIdPage(Page<InventorySummary> page, String id);
......
......@@ -12,6 +12,10 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.io.IOException;
/**
* 单警柜出入库记录上报并且记录到数据库中
*/
@Component
public class CabinetLogReceiver {
@Resource
......
......@@ -27,23 +27,15 @@ public class OrderMQReceiver {
try {
System.out.println("req = " + req);
//将消息进行消费
Boolean result = inventorySummaryService.processInventoryRecords(req);
Long ordId;
if (req.getOrderMainReq().getOrderType().equals("in")){
ordId=req.getOrderMainReq().getEndOrgId();
}else {
ordId=req.getOrderMainReq().getStartOrgId();
}
Boolean aBoolean = inventorySummaryService.updateSummaryInsByOrder(ordId);
System.out.println("result = " + result);
if (result && aBoolean){
// Boolean result = inventorySummaryService.processInventoryRecords(req);
// if (result){
// // 手动确认消息
// channel.basicAck(deliveryTag, false);
// }else {
// channel.basicNack(deliveryTag, false, true);
// }
// 手动确认消息
channel.basicAck(deliveryTag, false);
}else {
channel.basicNack(deliveryTag, false, true);
}
// 手动确认消息
// channel.basicAck(deliveryTag, false);
} catch (Exception e) {
// 处理消息过程中发生异常,拒绝消息并将其重新放回队列
try {
......
......@@ -32,11 +32,7 @@ public interface InventoryService extends IService<Inventory> {
List<InventoryDto> GetInvInfoByEpc(InventoryReq req);
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是List)
List<InventoryDto> EqsBySearchType(InventoryReq req);
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
PageResult<InventoryDto> EqsByTypePage(InventoryReq req);
//查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId)
List<EqsBriefDto> searchEqsByBoxId(CabinetBoxReq req);
......
......@@ -22,6 +22,8 @@ import com.junmp.v2.common.util.BeanPlusUtil;
import com.junmp.v2.db.api.factory.PageFactory;
import com.junmp.v2.db.api.factory.PageResultFactory;
import com.junmp.v2.db.api.page.PageResult;
import com.junmp.v2.sys.user.entity.SysUserOrg;
import com.junmp.v2.sys.user.service.SysUserOrgService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
......@@ -43,6 +45,9 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
@Resource
private IFlowInstanceService FlowInstanceService;
@Resource
private SysUserOrgService sysUserOrgService;
/**
* 创建业务单
* @param req
......@@ -56,15 +61,25 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
if (ObjectUtil.isNull(req.getId())){
String id= UUID.randomUUID().toString();
busForm.setId(id);
//设置单据号
OrderNum orderNum = stocktakeService.setOrderCode(req.getBussinessType(), req.getOrgId());
//设置单据号(调拨的单号根据和登录人员的组织机构id有关)
//根据userId去查询组织机构id
OrderNum orderNum=new OrderNum();
if (req.getBussinessType().equals("allocate")){
if (req.getStartOrgId() == req.getOrgId()){
orderNum = stocktakeService.setOrderCode(req.getBussinessType(), req.getStartOrgId());
} else {
orderNum = stocktakeService.setOrderCode(req.getBussinessType(), req.getEndOrgId());
}
}else {
orderNum = stocktakeService.setOrderCode(req.getBussinessType(), req.getOrgId());
}
String codeValue=String.format("%04d",orderNum.getNum());
busForm.setBussinessCode(orderNum.getBussinessType()+orderNum.getYear()+
String.format("%02d",LocalDateTime.now().getMonth().getValue())+
String.format("%02d",LocalDateTime.now().getDayOfMonth())+codeValue);
}
busForm.setCreateTime(DateTimeUtil.getCurrentDateTime());
}
//执行工作流
if (req.getExamineState().equals("working"))
......@@ -73,7 +88,7 @@ public class BusFormServiceImpl extends ServiceImpl<BusFormMapper, BusForm> impl
startProcessInstanceDTO.setProcessDefinitionId(req.getProcessDefinitionId());
startProcessInstanceDTO.setOrderId(busForm.getId());
startProcessInstanceDTO.setOrderType("workOrder");
startProcessInstanceDTO.setUserId(req.getUserId());
startProcessInstanceDTO.setUserId(req.getApplyUserId());
String ProcessInstanceId= FlowInstanceService.startProcessInstanceById(startProcessInstanceDTO);
busForm.setProcessId(ProcessInstanceId);
......
......@@ -233,47 +233,6 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return inventoryDtoList;
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是List)
@Override
public List<InventoryDto> EqsBySearchType(InventoryReq req) {
//判断传入的queryType参数是否是正确的
if (!req.getQueryType().equals("org") && !req.getQueryType().equals("warehouse") && !req.getQueryType().equals("cabinet")){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}
//判断如果传递了类别,判断传递的值是否为空或者是否不存在
if (ObjectUtil.isNotNull(req.getOrgId())){
pubOrgService.PubOrgExist(req.getOrgId());
} else if (ObjectUtil.isNotNull(req.getWarehouseId())){
warehouseService.WarehoustExist(req.getWarehouseId());
} else if (ObjectUtil.isNotNull(req.getCabinetId())){
cabinetService.CabinetExist(req.getCabinetId());
}else {
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}
return inventoryMapper.EqsBySearchType(req);
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
public PageResult<InventoryDto> EqsByTypePage(InventoryReq req) {
//判断传入的queryType参数是否是正确的
if (!req.getQueryType().equals("org") && !req.getQueryType().equals("warehouse") && !req.getQueryType().equals("cabinet")){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}
//判断如果传递了类别,判断传递的值是否为空或者是否不存在
if (ObjectUtil.isNotNull(req.getOrgId())){
pubOrgService.PubOrgExist(req.getOrgId());
} else if (ObjectUtil.isNotNull(req.getWarehouseId())){
warehouseService.WarehoustExist(req.getWarehouseId());
} else if (ObjectUtil.isNotNull(req.getCabinetId())){
cabinetService.CabinetExist(req.getCabinetId());
}else {
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}
Page<InventoryDto> page = PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize());
IPage<InventoryDto> pages= inventoryMapper.EqsByTypePage(page,req.getQueryType(),req.getOrgId(),req.getWarehouseId(),req.getCabinetId());
page.setRecords(pages.getRecords());
return PageResultFactory.createPageResult(page);
}
//查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId)
@Override
......
......@@ -93,6 +93,9 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
.eq(Inventory::getOrgId, data.getOrgId())
.eq(Inventory::getSizeId, data.getSizeId())
.eq(Inventory::getTypeId, data.getTypeId())).get(0);
String instructions = equipmentSizeService.getOne(new LambdaQueryWrapper<EquipmentSize>()
.eq(EquipmentSize::getId, data.getSizeId())).getInstructions();
data.setInstructions(instructions);
data.setWarrantyPeriod(inventory.getWarrantyPeriod());
data.setMaintenancePeriod(inventory.getMaintenancePeriod());
String photo = equipmentSizeService.getOne(new LambdaQueryWrapper<EquipmentSize>().eq(EquipmentSize::getId,inventory.getSizeId())).getPhoto();
......@@ -185,7 +188,8 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
}
//对装备进行记录,存入log表形成出入库记录
Boolean c = insertLog(req,orderMain,addList,updateList);
return (b && c );
Boolean d = updateSummaryInsByOrder(orgId);
return (b && c && d );
}
......@@ -197,6 +201,8 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
logSummary.setDevice(req.getDevice());
logSummary.setDeviceType(req.getDeviceType());
logSummary.setLocationType(0);
logSummary.setUserName(req.getUserName());
logSummary.setUseTime(req.getUseTime());
if (orderMain.getOrderType().equals("in")){
logSummary.setOutInState("in");
logSummary.setOrgId(orderMain.getEndOrgId());
......@@ -258,7 +264,6 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
boolean a = inventorySummaryMapper.deleteByWarehouse(allWarehouse);
//根据仓库id重新计算汇总信息
boolean sumByWarehouse = inventorySummaryMapper.getSumByWarehouse(allWarehouse, brokenNumberDays);
System.out.println("sumByWarehouse = " + sumByWarehouse);
return (a && sumByWarehouse);
}
......@@ -269,10 +274,12 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//批量修改装备信息
List<InventoryReq> inventoryList = req.getInventoryList();
boolean a=true;
List<Inventory> inventoryLogsList=new ArrayList<>();
for (InventoryReq inventoryReq:inventoryList) {
Inventory inventory = new Inventory();
BeanPlusUtil.copyProperties(inventoryReq,inventory);
boolean result = inventoryService.updateById(inventory);
boolean result = inventoryService.saveOrUpdate(inventory);
inventoryLogsList.add(inventory);
if (!result){
a=false;
break;
......@@ -281,7 +288,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//修改summary表中数据
boolean b = updateSummaryInsByCabinet(req.getLocationId());
//添加日志记录、
Boolean c = insertCabinetLog(req);
Boolean c = insertCabinetLog(req,inventoryLogsList);
return (a && b && c);
}
......@@ -307,18 +314,19 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
}
//添加单警柜出入库记录日志
public Boolean insertCabinetLog(CabinetInOutRecordsReq req){
public Boolean insertCabinetLog(CabinetInOutRecordsReq req,List<Inventory> inventoryLogsList){
LogSummary logSummary = new LogSummary();
BeanPlusUtil.copyProperties(req,logSummary);
logSummary.setLocationType(1);
boolean a = logSummaryService.save(logSummary);
List<InventoryReq> inventoryList = req.getInventoryList();
List<LogDetail> logDetailList=new ArrayList<>();
for (InventoryReq inventoryReq:inventoryList) {
for (Inventory inventory:inventoryLogsList) {
LogDetail logDetail = new LogDetail();
BeanPlusUtil.copyProperties(inventoryReq,logDetail);
BeanPlusUtil.copyProperties(inventory,logDetail);
logDetail.setInventoryId(inventory.getId());
logDetail.setCabinetboxId(req.getLocationId());
logDetail.setOutInState(inventoryReq.getLocationState());
logDetail.setOutInState(inventory.getLocationState());
logDetail.setSummaryId(logSummary.getId());
logDetailList.add(logDetail);
}
......@@ -354,6 +362,87 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
if (ObjectUtil.isEmpty(req)) {
return wrapper;
}
/**
* 判断是否有高级搜索,如果有则进行添加查询条件
*/
if (ObjectUtil.isNotNull(req.getNumber())){
//将值进行切割,> = <并将其判断为哪个符号,如果为>则使用ge,=为eq,<为le
String symbol = req.getNumber().substring(0, 1);
String value = req.getNumber().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getNumber,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getNumber,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getNumber,value);
}
}
if (ObjectUtil.isNotNull(req.getStockNumber())){
String symbol = req.getStockNumber().substring(0, 1);
String value = req.getStockNumber().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getStockNumber,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getStockNumber,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getStockNumber,value);
}
}
if (ObjectUtil.isNotNull(req.getOutboundNumber())){
String symbol = req.getOutboundNumber().substring(0, 1);
String value = req.getOutboundNumber().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getOutboundNumber,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getOutboundNumber,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getOutboundNumber,value);
}
}
if (ObjectUtil.isNotNull(req.getExpireNumber())){
String symbol = req.getExpireNumber().substring(0, 1);
String value = req.getExpireNumber().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getExpireNumber,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getExpireNumber,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getExpireNumber,value);
}
}
if (ObjectUtil.isNotNull(req.getBrokenNumber())){
String symbol = req.getBrokenNumber().substring(0, 1);
String value = req.getBrokenNumber().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getBrokenNumber,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getBrokenNumber,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getBrokenNumber,value);
}
}
if (ObjectUtil.isNotNull(req.getUnitPrice())){
String symbol = req.getUnitPrice().substring(0, 1);
String value = req.getUnitPrice().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getUnitPrice,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getUnitPrice,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getUnitPrice,value);
}
}
if (ObjectUtil.isNotNull(req.getPrice())){
String symbol = req.getPrice().substring(0, 1);
String value = req.getPrice().substring(1);
if (symbol.equals(">")){
wrapper.gt(InventorySummary::getPrice,value);
} else if (symbol.equals("=")) {
wrapper.eq(InventorySummary::getPrice,value);
}else if (symbol.equals("<")){
wrapper.lt(InventorySummary::getPrice,value);
}
}
//根据组织机构号查询
wrapper.eq(ObjectUtil.isNotEmpty(req.getOrgId()), InventorySummary::getOrgId, req.getOrgId());
//根据组织机构名模糊查询
......
......@@ -506,8 +506,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
for (UpdateOrderDetailReq uploadDetailReq : reqList) {
OrderDetail orderDetail = new OrderDetail();
BeanPlusUtil.copyProperties(uploadDetailReq,orderDetail);
//获取修改后的数量并且记录(如果modifyQuantity不为空则表示该子单据进行了修改)
if (ObjectUtil.isNotNull(uploadDetailReq.getModifyQuantity())){
//获取修改后的数量并且记录(如果modifyQuantity不为空并且于实际入库数量不一致则表示该子单据进行了修改)
if (ObjectUtil.isNotNull(uploadDetailReq.getModifyQuantity()) && uploadDetailReq.getModifyQuantity() != uploadDetailReq.getActualNum()){
String log = "将"+uploadDetailReq.getTypeName()+":"+
uploadDetailReq.getSizeName()+"的物资数量从"+uploadDetailReq.getActualNum()+"修改为"+uploadDetailReq.getModifyQuantity()+";";
stringBuilder.append(log);
......@@ -552,11 +552,11 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
// updateWarehouseInfo(req,orderDetailReqList,orgId);
//更新主单据的数量和价格
//修改记账状态,0未记账,1已记账
orderMain.setActualQuantity(updateQuantity);
orderMain.setPrice(priceTotal);
orderMain.setOrderState("finished");
orderMain.setManualState(1);
//修改记账状态,0未记账,1已记账
// orderMain.setManualState(1);
orderMain.setUpdateTime(DateTimeUtil.getCurrentDateTime());
//如果是领用出库,那记账结束以后将装备挂到警员名下(存储到policemanEquipment表中)
......
......@@ -220,59 +220,6 @@ delete from base_inventory_summary
</insert>
<select id="EqsBySearchType" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
select
i.id as id,
i.package_id as package_id,
i.epc as epc,
i.size_id as sizeId,
es.name as sizeName,
i.type_id as typeId,
et.name as typeName,
i.supplier_id as supplierId,
s.name as supplierName,
i.state as state,
i.location_state as locationState,
i.production_date as productionDate,
i.location_type as locationType,
<if test="queryType=='warehouse'">
i.location_id as locationId,
</if>
<if test="queryType=='cabinet'">
(select id from base_cabinet where id =#{cabinetId}) as locationId,
</if>
i.price as price,
i.shelf_id as shelfId,
i.shelf_location as shelfLocation,
i.bussiness_state as bussinessState,
i.warranty_period as warrantyPeriod,
i.maintenance_period as maintenancePeriod,
i.tid as tid,
i.note as note,
i.fix_count as fixCount,
i.lost_flag as lostFlag,
i.create_time as createTime,
i.update_time as updateTime,
i.update_user as updateUser,
i.create_user as create_user,
i.org_id_int as orgId,
po.org_name as orgName
from base_inventory i
join base_equipment_type et on et.id = i.type_id
join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id
<if test="queryType == 'org'">
where org_id_int = #{orgId}
</if>
<if test="queryType == 'warehouse' ">
where location_id = #{warehouseId}
</if>
<if test="queryType == 'cabinet'">
where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId})
</if>
ORDER BY i.type_id,i.size_id
</select>
<select id="getSumByShelf" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="java.lang.String">
select t.id,t.orgId,t.orgName,t.locationId,t.locationName,t.shelf_id,t.type_id,t.typeName,t.size_id,t.sizeName,
......@@ -432,59 +379,7 @@ delete from base_inventory_summary
join pub_org po on i.org_id_int=po.org_id
where org_id_int=#{orgId}
</select>
<select id="EqsByTypePage" resultType="com.junmp.jyzb.api.bean.dto.InventoryDto">
select
i.id as id,
i.package_id as package_id,
i.epc as epc,
i.size_id as sizeId,
es.name as sizeName,
i.type_id as typeId,
et.name as typeName,
i.supplier_id as supplierId,
s.name as supplierName,
i.state as state,
i.location_state as locationState,
i.production_date as productionDate,
i.location_type as locationType,
<if test="queryType=='warehouse'">
i.location_id as locationId,
</if>
<if test="queryType=='cabinet'">
(select id from base_cabinet where id =#{cabinetId}) as locationId,
</if>
i.price as price,
i.shelf_id as shelfId,
i.shelf_location as shelfLocation,
i.bussiness_state as bussinessState,
i.warranty_period as warrantyPeriod,
i.maintenance_period as maintenancePeriod,
i.tid as tid,
i.note as note,
i.fix_count as fixCount,
i.lost_flag as lostFlag,
i.create_time as createTime,
i.update_time as updateTime,
i.update_user as updateUser,
i.create_user as create_user,
i.org_id_int as orgId,
po.org_name as orgName
from base_inventory i
join base_equipment_type et on et.id = i.type_id
join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id
<if test="queryType == 'org'">
where org_id_int = #{orgId}
</if>
<if test="queryType == 'warehouse' ">
where location_id = #{warehouseId}
</if>
<if test="queryType == 'cabinet'">
where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId})
</if>
ORDER BY i.type_id,i.size_id
</select>
<select id="EqsByCabinetBoxIdPage" resultType="com.junmp.jyzb.entity.InventorySummary">
SELECT
UUID() as id,
......
......@@ -124,7 +124,22 @@
<select id="getTotalNumberAndPrice" resultType="com.junmp.jyzb.entity.InventorySummary">
select sum(number) as number,sum(price)as price,sum(stock_number)as stockNumber,
sum(outbound_number)as outboundNumber,sum(destruction_number)as destructionNumber,
sum(expire_number)as expireNumber,sum(broken_number)as brokenNumber,max(location_type)
sum(expire_number)as expireNumber,sum(broken_number)as brokenNumber
<if test="req.orgId != null and req.orgId != ''">
,org_id_int as orgId
</if>
<if test="req.locationId !=null and req.locationId != ''">
,location_id as locationId
</if>
<if test="req.sizeId != null and req.sizeId != ''">
,size_id as sizeId
</if>
<if test="req.TypeId != null and req.typeId != ''">
,type_id as typeId
</if>
<if test="req.locationType != null and req.locationType != ''">
,location_type as locationId
</if>
FROM base_inventory_summary where 1=1
<if test="req.orgId != null and req.orgId != ''">
and org_id_int=#{req.orgId}
......@@ -140,8 +155,98 @@
</if>
<if test="req.locationType != null and req.locationType != ''">
and location_type=#{req.locationType}
</if>
<choose>
<when test="req.number != null and req.number != ''">
<if test="req.number.charAt(0) == '='">
AND number = SUBSTRING(#{req.number}, 2)
</if>
<if test="req.number.charAt(0) == '&lt;'">
AND number &lt; SUBSTRING(#{req.number}, 2)
</if>
<if test="req.number.charAt(0) == '&gt;'">
AND number &gt; SUBSTRING(#{req.number}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.stockNumber != null and req.stockNumber != ''">
<if test="req.stockNumber.charAt(0) == '='">
AND stock_number = SUBSTRING(#{req.stockNumber}, 2)
</if>
<if test="req.stockNumber.charAt(0) == '&lt;'">
AND stock_number &lt; SUBSTRING(#{req.stockNumber}, 2)
</if>
<if test="req.stockNumber.charAt(0) == '&gt;'">
AND stock_number &gt; SUBSTRING(#{req.stockNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.outboundNumber != null and req.outboundNumber != ''">
<if test="req.outboundNumber.charAt(0) == '='">
AND outbound_number = SUBSTRING(#{req.outboundNumber}, 2)
</if>
<if test="req.outboundNumber.charAt(0) == '&lt;'">
AND outbound_number &lt; SUBSTRING(#{req.outboundNumber}, 2)
</if>
<if test="req.outboundNumber.charAt(0) == '&gt;'">
AND outbound_number &gt; SUBSTRING(#{req.outboundNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.expireNumber != null and req.expireNumber != ''">
<if test="req.expireNumber.charAt(0) == '='">
AND expire_number = SUBSTRING(#{req.expireNumber}, 2)
</if>
<if test="req.expireNumber.charAt(0) == '&lt;'">
AND expire_number &lt; SUBSTRING(#{req.expireNumber}, 2)
</if>
<if test="req.expireNumber.charAt(0) == '&gt;'">
AND expire_number &gt; SUBSTRING(#{req.expireNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.brokenNumber != null and req.brokenNumber != ''">
<if test="req.brokenNumber.charAt(0) == '='">
AND broken_number = SUBSTRING(#{req.brokenNumber}, 2)
</if>
<if test="req.brokenNumber.charAt(0) == '&lt;'">
AND broken_number &lt; SUBSTRING(#{req.brokenNumber}, 2)
</if>
<if test="req.brokenNumber.charAt(0) == '&gt;'">
AND broken_number &gt; SUBSTRING(#{req.brokenNumber}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.unitPrice != null and req.unitPrice != ''">
<if test="req.unitPrice.charAt(0) == '='">
AND unit_price = SUBSTRING(#{req.unitPrice}, 2)
</if>
<if test="req.unitPrice.charAt(0) == '&lt;'">
AND unit_price &lt; SUBSTRING(#{req.unitPrice}, 2)
</if>
<if test="req.unitPrice.charAt(0) == '&gt;'">
AND unit_price &gt; SUBSTRING(#{req.unitPrice}, 2)
</if>
</when>
</choose>
<choose>
<when test="req.price != null and req.price != ''">
<if test="req.price.charAt(0) == '='">
AND price = SUBSTRING(#{req.price}, 2)
</if>
<if test="req.price.charAt(0) == '&lt;'">
AND price &lt; SUBSTRING(#{req.price}, 2)
</if>
<if test="req.price.charAt(0) == '&gt;'">
AND price &gt; SUBSTRING(#{req.price}, 2)
</if>
</when>
</choose>
</select>
<select id="EquipmentStatistics" resultType="com.junmp.jyzb.entity.InventorySummary"
parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论