Commit ebb692ae by huangtao

修复权限、签名问题

parent 9e467ffa
......@@ -23,7 +23,7 @@ public class BillDTO {
@ApiModelProperty(value = "数量")
private Integer physicNum;
@ApiModelProperty(value = "1-入库 2-申请")
@ApiModelProperty(value = "1-收取 2-支出")
private Integer type;
@ApiModelProperty(value = "厂家名称")
......
......@@ -15,9 +15,9 @@ import java.util.List;
@Mapper
public interface PhysicBillMapper extends BaseMapper<PhysicBill> {
Integer selectSumByBatchNo(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName,@Param("batchNo") String batchNo );
Integer selectSumByBatchNo(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName,@Param("batchNo") String batchNo,@Param("deptId") Long deptId );
Integer selectSumByName(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName);
Integer selectSumByName(@Param("name") String name,@Param("spec") String spec,@Param("factoryName") String factoryName,@Param("deptId")Long deptId);
List<BillInfoVO> selectByGroup(@Param("physicName") String physicName);
......
......@@ -128,13 +128,20 @@ public class PhysicApplyServiceImpl extends AbstractService implements PhysicApp
}
if(!CollectionUtils.isEmpty(fy_statusList)){
queryWrapper.and(o->{
o.eq(PhysicApply::getFyDeptId,deptId).in(PhysicApply::getStatus,fy_statusList);
});
if(CollectionUtils.isEmpty(ly_statusList)){
queryWrapper.and(o->{
o.eq(PhysicApply::getFyDeptId,deptId).in(PhysicApply::getStatus,fy_statusList);
});
}else{
queryWrapper.or(o->{
o.eq(PhysicApply::getFyDeptId,deptId).in(PhysicApply::getStatus,fy_statusList);
});
}
}
if(!CollectionUtils.isEmpty(ly_statusList) || !CollectionUtils.isEmpty(fy_statusList)){
physicApplyMapper.selectList(queryWrapper);
physicApplyList= physicApplyMapper.selectList(queryWrapper);
}
......@@ -192,10 +199,17 @@ public class PhysicApplyServiceImpl extends AbstractService implements PhysicApp
if(f){
BillDTO billDTO = new BillDTO();
BeanUtil.copyProperties(physicApply,billDTO);
billDTO.setType(2);
billDTO.setType(1);
billDTO.setPhysicNum(physicApply.getActualNum());
billDTO.setDeptId(physicApply.getLyDeptId());
physicBillService.createBill(billDTO);
BillDTO billDTO2 = new BillDTO();
BeanUtil.copyProperties(physicApply,billDTO);
billDTO2.setType(2);
billDTO2.setPhysicNum(physicApply.getActualNum());
billDTO2.setDeptId(physicApply.getFyDeptId());
physicBillService.createBill(billDTO);
}
return getInfo(physicApplySignReq.getPhysicApplyId());
}
......
......@@ -39,18 +39,21 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
PhysicBill bill = new PhysicBill();
BeanUtil.copyProperties(billDTO,bill);
bill.setType(billDTO.getType());
Integer batchNoSum = physicBillMapper.selectSumByBatchNo(billDTO.getPhysicName(), billDTO.getPhysicSpec(), billDTO.getFactoryName(), billDTO.getBatchNo(),billDTO.getDeptId());
Integer sum = physicBillMapper.selectSumByName(billDTO.getPhysicName(), billDTO.getPhysicSpec(), billDTO.getFactoryName(),billDTO.getDeptId());
if(billDTO.getType()==1){
bill.setAcquireNum(billDTO.getPhysicNum());
bill.setBalance(batchNoSum+billDTO.getPhysicNum());
bill.setBalanceAll(sum+billDTO.getPhysicNum());
}else if(billDTO.getType()==2){
bill.setExpendNum(billDTO.getPhysicNum());
bill.setBalance(batchNoSum-billDTO.getPhysicNum());
bill.setBalanceAll(sum-billDTO.getPhysicNum());
}
bill.setStatus(0);
Integer batchNoSum = physicBillMapper.selectSumByBatchNo(billDTO.getPhysicName(), billDTO.getPhysicSpec(), billDTO.getFactoryName(), billDTO.getBatchNo());
Integer sum = physicBillMapper.selectSumByName(billDTO.getPhysicName(), billDTO.getPhysicSpec(), billDTO.getFactoryName());
bill.setStatus(0);
bill.setBalance(batchNoSum+billDTO.getPhysicNum());
bill.setBalanceAll(sum+billDTO.getPhysicNum());
physicBillMapper.insert(bill);
}
......
......@@ -104,7 +104,7 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
physicWarehouse.setStatus(3);
SignInfoDTO signInfoDTO = new SignInfoDTO(getstamp, LocalDateTime.now(),userId);;
physicWarehouse.setBgUser(JSONUtil.toJsonStr(signInfoDTO));
f = true;
}
if(f){
......
......@@ -8,10 +8,10 @@
</select>
<select id="selectSumByName" resultType="java.lang.Integer">
select (IFNULL(sum(expend_num),0) - IFNULL(sum(acquire_num),0)) from physic_bill where physic_name=#{name} and physic_spec=#{spec} and factory_name =#{factoryName}
select (IFNULL(sum(expend_num),0) - IFNULL(sum(acquire_num),0)) from physic_bill where physic_name=#{name} and physic_spec=#{spec} and factory_name =#{factoryName} and dept_id =#{deptId}
</select>
<select id="selectByGroup" resultType="com.jmai.physic.vo.BillInfoVO">
select physic_name,physic_spec,factory_name from physic_bill where physic_name =#{physicName} group by physic_name,physic_spec,factory_name
select physic_name,physic_spec,factory_name from physic_bill where physic_name LIKE CONCAT('%', #{physicName}, '%') group by physic_name,physic_spec,factory_name,dept_id
</select>
<select id="selectBillPage" resultType="com.jmai.physic.vo.BillQueryVO">
select *,b.dept_name from physic_bill a left join sys_dept b on a.dept_id =b.id where a.physic_name =#{req.physicName} and
......
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment