Commit a27fc08b by 李小惠

修改记账接口

parent 513e7626
......@@ -78,4 +78,7 @@ public class EquipmentSizeDto {
private String instructions;
private String maintenancePeriod;
private String warrantyPeriod;
}
......@@ -122,6 +122,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
@Resource
protected TaskService taskService;
@Resource
private PubOrgService pubOrgService;
@Resource
......@@ -774,7 +776,8 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
else {
orgId=orderMain.getStartOrgId();
}
boolean d = updateSummaryInfo(req, orderDetailReqList, orgId);
PubOrg pubOrg = pubOrgService.PubOrgExist(orgId);
boolean d = updateSummaryInfo(req, orderDetailReqList, orgId,pubOrg.getOrgCode(),pubOrg.getOrgName());
//如果是领用,警员绑定装备
boolean e=true;
......@@ -815,6 +818,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
policeEquipment.setTypeName(updateOrderDetailReq.getTypeName());
policeEquipment.setNum(updateOrderDetailReq.getModifyQuantity());
policeEquipment.setOrgId(orgId);
policeEquipment.setPrice(updateOrderDetailReq.getPrice());
policeEquipment.setLocationId(updateOrderDetailReq.getWarehouseId());
policeEquipment.setCreateTime(DateTimeUtil.getCurrentDateTime());
return policeEquipment;
......@@ -849,7 +853,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
}
//修改装备汇总表中的数据inventory_summary
public boolean updateSummaryInfo(UpdateOrderReq req,List<UpdateOrderDetailReq> orderDetailReqList,Long orgId){
public boolean updateSummaryInfo(UpdateOrderReq req,List<UpdateOrderDetailReq> orderDetailReqList,Long orgId,String orgCode,String orgName){
//将库存summary表中数据进行查询出来一一进行比较,如果说sizeId,typeId,warehouseId相同则对该数据进行修改,如果说该数据不存在的话则在summary表中添加一条数据
List<Object[]> searchCriteria=new ArrayList<>();
for (UpdateOrderDetailReq upReq: orderDetailReqList) {
......@@ -886,18 +890,23 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
//表示库存中没有,那么插入数据
if (!flag){
InventorySummary inventorySummary = new InventorySummary();
inventorySummary.setOrgCode(orgCode);
inventorySummary.setOrgName(orgName);
inventorySummary.setValuekey(orgCode+upReq.getSizeId());
inventorySummary.setSizeId(upReq.getSizeId());
inventorySummary.setSizeName(upReq.getSizeName());
inventorySummary.setTypeName(upReq.getTypeName());
inventorySummary.setTypeId(upReq.getTypeId());
inventorySummary.setLocationName(upReq.getWarehouseName());
inventorySummary.setLocationId(upReq.getWarehouseName());
inventorySummary.setLocationId(upReq.getWarehouseId());
inventorySummary.setUnitPrice(upReq.getPrice());
inventorySummary.setPrice(BigDecimal.valueOf(upReq.getModifyQuantity()).multiply(upReq.getPrice()));
inventorySummary.setLocationType("0");
inventorySummary.setBrokenNumber(0);
inventorySummary.setExpireNumber(0);
inventorySummary.setDestructionNumber(0);
inventorySummary.setNearBrokenNumber(0);
inventorySummary.setNumber(upReq.getModifyQuantity());
inventorySummary.setCreateTime(DateTimeUtil.getCurrentDateTime());
if (req.getOrderType().equals("in")){
inventorySummary.setOutboundNumber(0);
......@@ -917,7 +926,7 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
boolean b = inventorySummaryService.updateBatchById(updateList);
a = a && b;
}
System.out.println("addList.get(0) = " + addList.get(0));
return a;
}
......
......@@ -374,7 +374,8 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
one.setUpdateTime(DateTimeUtil.getCurrentDateTime());
//修改角色
if (req.getRolesList().size()>0){
sysUserRoleService.removeBatchByIds(req.getRolesList());
// sysUserRoleService.removeBatchByIds(req.getRolesList());
sysUserRoleService.remove(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId,req.getUserId()));
List<SysUserRole> collect = req.getRolesList().stream().map(s -> {
SysUserRole sysUserRole = new SysUserRole();
sysUserRole.setUserId(req.getUserId());
......@@ -1017,14 +1018,13 @@ public class PolicemanServiceImpl extends ServiceImpl<PolicemanMapper, Policeman
public String PoliceReassignment(UpdateReassignmentReq req) {
//判断该警员是否已经在审核中,如果是的话,那么则提示报错,存草稿没事,但是一旦发起审核流,则需要进行判断
if (ObjectUtil.isNotNull(req.getProcessDefinitionId())){
Reassignment reassign = reassignmentService.list(new LambdaQueryWrapper<Reassignment>()
List<Reassignment> list = reassignmentService.list(new LambdaQueryWrapper<Reassignment>()
.eq(Reassignment::getPoliceId, req.getPoliceId())
.eq(Reassignment::getReassignmentType, "reassign")
.isNotNull(Reassignment::getReassignmentType)
.eq(Reassignment::getOrgId, req.getOrgId())
.isNotNull(Reassignment::getProcessId)
.eq(Reassignment::getExamineState,"working")
.orderByDesc(Reassignment::getCreateTime)).get(0);
if (ObjectUtil.isNotNull(reassign)){
.orderByDesc(Reassignment::getCreateTime));
if (list.size()>0){
throw new ServiceException(PolicemanExceptionEnum.POLICE_IS_IN_EXAMINE);
}
}
......
......@@ -6,6 +6,8 @@
SELECT
t1.id,
t1.state,
t2.maintenance_period as maintenancePeriod,
t2.warranty_period as warrantyPeriod,
t2.name AS eqName,
t1.name AS name,
t1.type_id as typeId,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论