三期内容优化
This commit is contained in:
@@ -41,6 +41,8 @@ public class SysUser extends BaseEntity {
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@@ -146,6 +148,11 @@ public class SysUser extends BaseEntity {
|
||||
|
||||
private String bankCard;
|
||||
|
||||
/**
|
||||
* 保险费
|
||||
*/
|
||||
private Double insure;
|
||||
|
||||
private Long laborCost;
|
||||
|
||||
@TableField(exist = false)
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.oa.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
import com.ruoyi.oa.service.ISysOaWarehouseMasterService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 出库单管理
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/oa/oaWarehouseMaster")
|
||||
public class SysOaWarehouseMasterController extends BaseController {
|
||||
|
||||
private final ISysOaWarehouseMasterService iSysOaWarehouseMasterService;
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<SysOaWarehouseMasterVo> list(SysOaWarehouseMasterBo bo, PageQuery pageQuery) {
|
||||
return iSysOaWarehouseMasterService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出出库单管理列表
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:export")
|
||||
@Log(title = "出库单管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(SysOaWarehouseMasterBo bo, HttpServletResponse response) {
|
||||
List<SysOaWarehouseMasterVo> list = iSysOaWarehouseMasterService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "出库单管理", SysOaWarehouseMasterVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取出库单管理详细信息
|
||||
*
|
||||
* @param masterId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:query")
|
||||
@GetMapping("/{masterId}")
|
||||
public R<SysOaWarehouseMasterVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long masterId) {
|
||||
return R.ok(iSysOaWarehouseMasterService.queryById(masterId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单管理
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:add")
|
||||
@Log(title = "出库单管理", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody SysOaWarehouseMasterBo bo) {
|
||||
return toAjax(iSysOaWarehouseMasterService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单管理
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:edit")
|
||||
@Log(title = "出库单管理", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysOaWarehouseMasterBo bo) {
|
||||
return toAjax(iSysOaWarehouseMasterService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除出库单管理
|
||||
*
|
||||
* @param masterIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa:oaWarehouseMaster:remove")
|
||||
@Log(title = "出库单管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{masterIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] masterIds) {
|
||||
return toAjax(iSysOaWarehouseMasterService.deleteWithValidByIds(Arrays.asList(masterIds), true));
|
||||
}
|
||||
}
|
||||
@@ -55,4 +55,9 @@ public class OaSalary extends BaseEntity {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 保险
|
||||
*/
|
||||
private Double insure;
|
||||
|
||||
}
|
||||
|
||||
@@ -43,6 +43,11 @@ public class SysOaReceiveAccount extends BaseEntity {
|
||||
@ExcelProperty(value = "父节点")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private Double balance;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.oa.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出库单管理对象 sys_oa_warehouse_master
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_oa_warehouse_master")
|
||||
public class SysOaWarehouseMaster extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "master_id")
|
||||
private Long masterId;
|
||||
/**
|
||||
* 0出库单1入库单
|
||||
*/
|
||||
private Long type;
|
||||
/**
|
||||
* 绑定项目
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 编写日期
|
||||
*/
|
||||
private Date signTime;
|
||||
/**
|
||||
* 导入人
|
||||
*/
|
||||
private String signUser;
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -62,5 +62,7 @@ public class OaSalaryBo extends BaseEntity {
|
||||
|
||||
private String filePath;
|
||||
|
||||
private Double insure;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,4 +46,10 @@ public class SysOaReceiveAccountBo extends BaseEntity {
|
||||
@ExcelProperty(value = "父节点")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private Double balance;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.ruoyi.oa.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 出库单管理业务对象 sys_oa_warehouse_master
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class SysOaWarehouseMasterBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long masterId;
|
||||
|
||||
/**
|
||||
* 0出库单1入库单
|
||||
*/
|
||||
private Long type;
|
||||
|
||||
/**
|
||||
* 绑定项目
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 编写日期
|
||||
*/
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 导入人
|
||||
*/
|
||||
private String signUser;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -5,8 +5,9 @@ import lombok.Data;
|
||||
// 物料出库明细VO
|
||||
@Data
|
||||
public class MaterialVO {
|
||||
private Long materialId;
|
||||
private String name;
|
||||
private Long detailId;
|
||||
private String detailTitle;
|
||||
private Double price;
|
||||
private Integer amount;
|
||||
private String financeParties;
|
||||
private String remark;
|
||||
}
|
||||
@@ -74,4 +74,6 @@ public class OaSalaryVo extends OaSalary {
|
||||
private Double punishSalary;
|
||||
|
||||
private Double laborCost;
|
||||
|
||||
private Double insure;
|
||||
}
|
||||
|
||||
@@ -45,4 +45,5 @@ public class SysOaCostAllVo {
|
||||
|
||||
private Double peopleDay;
|
||||
|
||||
private Double funds;
|
||||
}
|
||||
|
||||
@@ -54,5 +54,11 @@ public class SysOaReceiveAccountVo {
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 余额
|
||||
*/
|
||||
private Double balance;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.ruoyi.oa.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 出库单管理视图对象 sys_oa_warehouse_master
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SysOaWarehouseMasterVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ExcelProperty(value = "主键id")
|
||||
private Long masterId;
|
||||
|
||||
/**
|
||||
* 0出库单1入库单
|
||||
*/
|
||||
@ExcelProperty(value = "0出库单1入库单")
|
||||
private Long type;
|
||||
|
||||
/**
|
||||
* 绑定项目
|
||||
*/
|
||||
@ExcelProperty(value = "绑定项目")
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 编写日期
|
||||
*/
|
||||
@ExcelProperty(value = "编写日期")
|
||||
private Date signTime;
|
||||
|
||||
/**
|
||||
* 导入人
|
||||
*/
|
||||
@ExcelProperty(value = "导入人")
|
||||
private String signUser;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.oa.mapper;
|
||||
|
||||
import com.ruoyi.oa.domain.SysOaWarehouseMaster;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 出库单管理Mapper接口
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
public interface SysOaWarehouseMasterMapper extends BaseMapperPlus<SysOaWarehouseMasterMapper, SysOaWarehouseMaster, SysOaWarehouseMasterVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.oa.service;
|
||||
|
||||
import com.ruoyi.oa.domain.SysOaWarehouseMaster;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库单管理Service接口
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
public interface ISysOaWarehouseMasterService {
|
||||
|
||||
/**
|
||||
* 查询出库单管理
|
||||
*/
|
||||
SysOaWarehouseMasterVo queryById(Long masterId);
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
TableDataInfo<SysOaWarehouseMasterVo> queryPageList(SysOaWarehouseMasterBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
List<SysOaWarehouseMasterVo> queryList(SysOaWarehouseMasterBo bo);
|
||||
|
||||
/**
|
||||
* 新增出库单管理
|
||||
*/
|
||||
Boolean insertByBo(SysOaWarehouseMasterBo bo);
|
||||
|
||||
/**
|
||||
* 修改出库单管理
|
||||
*/
|
||||
Boolean updateByBo(SysOaWarehouseMasterBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除出库单管理信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.helper.LoginHelper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
@@ -45,7 +46,7 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<OaCustomerVo> queryPageList(OaCustomerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
QueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
Page<OaCustomerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
@@ -55,20 +56,18 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
|
||||
*/
|
||||
@Override
|
||||
public List<OaCustomerVo> queryList(OaCustomerBo bo) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
QueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<OaCustomer> buildQueryWrapper(OaCustomerBo bo) {
|
||||
private QueryWrapper<OaCustomer> buildQueryWrapper(OaCustomerBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<OaCustomer> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), OaCustomer::getName, bo.getName());
|
||||
lqw.eq(bo.getFollowUpStatus() != null, OaCustomer::getFollowUpStatus, bo.getFollowUpStatus());
|
||||
lqw.eq(bo.getContactLastTime() != null, OaCustomer::getContactLastTime, bo.getContactLastTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContactLastContent()), OaCustomer::getContactLastContent, bo.getContactLastContent());
|
||||
lqw.eq(bo.getContactNextTime() != null, OaCustomer::getContactNextTime, bo.getContactNextTime());
|
||||
lqw.eq(bo.getDealStatus() != null, OaCustomer::getDealStatus, bo.getDealStatus());
|
||||
lqw.eq(bo.getAreaId() != null, OaCustomer::getAreaId, bo.getAreaId());
|
||||
QueryWrapper<OaCustomer> lqw = Wrappers.query();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), "oc.name", bo.getName());
|
||||
lqw.eq(bo.getAreaId() != null, "oc.area_id", bo.getAreaId());
|
||||
lqw.eq(bo.getIndustryId() != null, "oc.industry_id", bo.getAreaId());
|
||||
lqw.eq(bo.getLevel() != null, "oc.level", bo.getAreaId());
|
||||
lqw.eq("oc.del_flag", 0L);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -116,14 +115,14 @@ public class OaCustomerServiceImpl implements IOaCustomerService {
|
||||
|
||||
@Override
|
||||
public TableDataInfo<OaCustomerVo> queryPageListToUser(OaCustomerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
QueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<OaCustomerVo> queryPageListToSea(OaCustomerBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
QueryWrapper<OaCustomer> lqw = buildQueryWrapper(bo);
|
||||
Page<OaCustomerVo> result = baseMapper.selectVoPageToUser(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class OaSalaryServiceImpl implements IOaSalaryService {
|
||||
|
||||
// 写入真实薪资 为日薪乘以工作日-罚金
|
||||
for (OaSalaryVo record : result.getRecords()) {
|
||||
record.setRealSalary(record.getBaseSalary()+record.getPunishSalary());
|
||||
record.setRealSalary(record.getBaseSalary()+record.getPunishSalary()-record.getInsure());
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class OaSalaryServiceImpl implements IOaSalaryService {
|
||||
|
||||
// 写入真实薪资 为日薪乘以工作日-罚金
|
||||
for (OaSalaryVo record : result.getRecords()) {
|
||||
record.setRealSalary(record.getBaseSalary()*dayNum+record.getPunishSalary());
|
||||
record.setRealSalary(record.getBaseSalary()*dayNum+record.getPunishSalary()-record.getInsure());
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
@@ -154,6 +154,7 @@ public class OaSalaryServiceImpl implements IOaSalaryService {
|
||||
if(Objects.nonNull(user)){
|
||||
OaSalary oaSalary = new OaSalary();
|
||||
oaSalary.setUserId(user.getUserId());
|
||||
oaSalary.setInsure(user.getInsure());
|
||||
oaSalary.setBaseSalary(Double.valueOf(user.getLaborCost()));
|
||||
oaSalary.setPayTime(payTime);
|
||||
baseMapper.insert(oaSalary);
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.ruoyi.oa.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.oa.domain.bo.SysOaWarehouseMasterBo;
|
||||
import com.ruoyi.oa.domain.vo.SysOaWarehouseMasterVo;
|
||||
import com.ruoyi.oa.domain.SysOaWarehouseMaster;
|
||||
import com.ruoyi.oa.mapper.SysOaWarehouseMasterMapper;
|
||||
import com.ruoyi.oa.service.ISysOaWarehouseMasterService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 出库单管理Service业务层处理
|
||||
*
|
||||
* @author hdak
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class SysOaWarehouseMasterServiceImpl implements ISysOaWarehouseMasterService {
|
||||
|
||||
private final SysOaWarehouseMasterMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询出库单管理
|
||||
*/
|
||||
@Override
|
||||
public SysOaWarehouseMasterVo queryById(Long masterId){
|
||||
return baseMapper.selectVoById(masterId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<SysOaWarehouseMasterVo> queryPageList(SysOaWarehouseMasterBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysOaWarehouseMaster> lqw = buildQueryWrapper(bo);
|
||||
Page<SysOaWarehouseMasterVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询出库单管理列表
|
||||
*/
|
||||
@Override
|
||||
public List<SysOaWarehouseMasterVo> queryList(SysOaWarehouseMasterBo bo) {
|
||||
LambdaQueryWrapper<SysOaWarehouseMaster> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<SysOaWarehouseMaster> buildQueryWrapper(SysOaWarehouseMasterBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<SysOaWarehouseMaster> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getType() != null, SysOaWarehouseMaster::getType, bo.getType());
|
||||
lqw.eq(bo.getProjectId() != null, SysOaWarehouseMaster::getProjectId, bo.getProjectId());
|
||||
lqw.eq(bo.getSignTime() != null, SysOaWarehouseMaster::getSignTime, bo.getSignTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSignUser()), SysOaWarehouseMaster::getSignUser, bo.getSignUser());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(SysOaWarehouseMasterBo bo) {
|
||||
SysOaWarehouseMaster add = BeanUtil.toBean(bo, SysOaWarehouseMaster.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMasterId(add.getMasterId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改出库单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(SysOaWarehouseMasterBo bo) {
|
||||
SysOaWarehouseMaster update = BeanUtil.toBean(bo, SysOaWarehouseMaster.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(SysOaWarehouseMaster entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除出库单管理
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -30,9 +30,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="setFollow">
|
||||
update oa_business set follow_up_status = 1 where business_id=#{businessId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusinessById">
|
||||
delete from oa_business
|
||||
<where>business_id=#{businessId}</where>
|
||||
delete from oa_business where
|
||||
business_id=#{businessId}
|
||||
</delete>
|
||||
|
||||
|
||||
@@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join oa_product op on obp.product_id = op.product_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="getBusinessByCustomerId" resultType="com.ruoyi.oa.domain.vo.OaBusinessVo">
|
||||
select * from oa_business
|
||||
<where >
|
||||
|
||||
@@ -34,8 +34,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
|
||||
<select id="selectVoPageToUser" resultType="com.ruoyi.oa.domain.vo.OaCustomerVo">
|
||||
select oc.customer_id, nick_name,name, follow_up_status, contact_last_time, contact_last_content, contact_next_time, owner_user_id, owner_time, deal_status, mobile, telephone, qq, wechat, oc.email, area_id, detail_address, industry_id, level, source, oc.remark,oc.create_by, oc.create_time, oc.update_by, oc.update_time, oc.del_flag from oa_customer oc
|
||||
left join fad_oa.sys_user su on oc.owner_user_id = su.user_id
|
||||
select oc.customer_id,
|
||||
nick_name,
|
||||
name,
|
||||
follow_up_status,
|
||||
contact_last_time,
|
||||
contact_last_content,
|
||||
contact_next_time,
|
||||
owner_user_id,
|
||||
owner_time,
|
||||
deal_status,
|
||||
mobile,
|
||||
telephone,
|
||||
qq,
|
||||
wechat,
|
||||
oc.email,
|
||||
area_id,
|
||||
detail_address,
|
||||
industry_id,
|
||||
level,
|
||||
source,
|
||||
oc.remark,
|
||||
oc.create_by,
|
||||
oc.create_time,
|
||||
oc.update_by,
|
||||
oc.update_time,
|
||||
oc.del_flag
|
||||
from oa_customer oc
|
||||
left join fad_oa.sys_user su on oc.owner_user_id = su.user_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
<result property="punishSalary" column="punish_salary"/>
|
||||
<result property="insure" column="insure"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -40,6 +41,7 @@
|
||||
os.pay_time,
|
||||
su.nick_name,
|
||||
os.base_salary,
|
||||
os.insure,
|
||||
COALESCE(
|
||||
SUM(
|
||||
CASE
|
||||
@@ -97,6 +99,7 @@
|
||||
osi.reason,
|
||||
osi.price,
|
||||
osi.sign_time,
|
||||
os.insure,
|
||||
su.nick_name
|
||||
FROM oa_salary os
|
||||
LEFT JOIN oa_salary_item osi
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
</select>
|
||||
<select id="selectListToCost" resultType="com.ruoyi.oa.domain.vo.SysOaCostAllVo">
|
||||
SELECT
|
||||
sop.project_name,sop.project_num,sop.project_id,
|
||||
sop.project_name,sop.project_num,sop.project_id,sop.funds,
|
||||
|
||||
(
|
||||
SELECT COALESCE(SUM(soc.cost),0)
|
||||
@@ -126,10 +126,11 @@
|
||||
) AS claimCost,
|
||||
|
||||
(
|
||||
SELECT COALESCE(SUM(soow.amount * sow.price),0)
|
||||
FROM sys_oa_out_warehouse soow
|
||||
JOIN sys_oa_warehouse sow ON soow.id = sow.id
|
||||
WHERE soow.project_id = sop.project_id
|
||||
SELECT COALESCE(SUM(sod.price), 0)
|
||||
FROM sys_oa_finance sof
|
||||
JOIN sys_oa_detail sod ON sof.finance_id = sod.finance_id
|
||||
WHERE sof.project_id = sop.project_id
|
||||
AND sof.finance_type = 0
|
||||
) AS materialCost,
|
||||
|
||||
(
|
||||
@@ -151,74 +152,96 @@
|
||||
|
||||
|
||||
<select id="selectProjectDetails" parameterType="Long" resultType="java.util.Map">
|
||||
SELECT
|
||||
JSON_OBJECT(
|
||||
'userCostList', COALESCE((
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'userId', CAST(uc.userId AS CHAR),
|
||||
'nickName', COALESCE(uc.nickName, ''),
|
||||
'laborCost', ROUND(COALESCE(uc.laborCost, 0),1),
|
||||
'attendenceNum', ROUND(COALESCE(uc.attendenceNum, 0),1)
|
||||
)
|
||||
)
|
||||
FROM (
|
||||
SELECT
|
||||
a.user_id AS userId,
|
||||
u.nick_name AS nickName,
|
||||
COALESCE(SUM(ROUND((a.day_length * 9 + a.hour) / 9,1) * u.labor_cost), 0) AS laborCost,
|
||||
COALESCE(ROUND(SUM((a.day_length * 9 + a.hour) / 9),1), 0) AS attendenceNum
|
||||
FROM sys_oa_attendance a
|
||||
INNER JOIN sys_user u ON a.user_id = u.user_id
|
||||
WHERE a.project_id = #{projectId} AND a.del_flag = 0
|
||||
GROUP BY a.user_id
|
||||
) uc
|
||||
), JSON_ARRAY()),
|
||||
SELECT JSON_OBJECT(
|
||||
'userCostList',
|
||||
COALESCE(
|
||||
(
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'userId', CAST(uc.userId AS CHAR),
|
||||
'nickName', COALESCE(uc.nickName, ''),
|
||||
'laborCost', ROUND(COALESCE(uc.laborCost, 0), 1),
|
||||
'attendenceNum', ROUND(COALESCE(uc.attendenceNum, 0), 1)
|
||||
)
|
||||
)
|
||||
FROM (
|
||||
SELECT
|
||||
a.user_id AS userId,
|
||||
u.nick_name AS nickName,
|
||||
COALESCE(
|
||||
SUM(
|
||||
ROUND((a.day_length * 9 + a.hour) / 9, 1) * u.labor_cost
|
||||
),
|
||||
0
|
||||
) AS laborCost,
|
||||
COALESCE(
|
||||
ROUND(
|
||||
SUM((a.day_length * 9 + a.hour) / 9), 1
|
||||
),
|
||||
0
|
||||
) AS attendenceNum
|
||||
FROM sys_oa_attendance a
|
||||
INNER JOIN sys_user u
|
||||
ON a.user_id = u.user_id
|
||||
WHERE a.project_id = #{projectId}
|
||||
AND a.del_flag = 0
|
||||
GROUP BY a.user_id
|
||||
) uc
|
||||
),
|
||||
JSON_ARRAY()
|
||||
),
|
||||
|
||||
'materialList', COALESCE((
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'materialId', CAST(ml.materialId AS CHAR),
|
||||
'name', COALESCE(ml.name, ''),
|
||||
'price', COALESCE(ml.price, 0),
|
||||
'amount', COALESCE(ml.amount, 0)
|
||||
)
|
||||
)
|
||||
FROM (
|
||||
SELECT
|
||||
ow.id AS materialId,
|
||||
COALESCE(w.name, '') AS name,
|
||||
COALESCE(w.price, 0) AS price,
|
||||
COALESCE(ow.amount, 0) AS amount
|
||||
FROM sys_oa_out_warehouse ow
|
||||
INNER JOIN sys_oa_warehouse w ON ow.warehouse_id = w.id
|
||||
WHERE ow.project_id = #{projectId} AND ow.del_flag = 0
|
||||
) ml
|
||||
), JSON_ARRAY()),
|
||||
'materialList',
|
||||
COALESCE(
|
||||
(
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'detailId', CAST(d.detail_id AS CHAR),
|
||||
'detailTitle', COALESCE(d.detail_title, ''),
|
||||
'price', COALESCE(d.price, 0),
|
||||
'financeParties', COALESCE(f.finance_parties, ''),
|
||||
'remark', COALESCE(f.remark, '')
|
||||
)
|
||||
)
|
||||
FROM sys_oa_finance f
|
||||
INNER JOIN sys_oa_detail d
|
||||
ON f.finance_id = d.finance_id
|
||||
WHERE f.project_id = #{projectId}
|
||||
AND f.finance_type = 0
|
||||
),
|
||||
JSON_ARRAY()
|
||||
),
|
||||
|
||||
'claimList', COALESCE((
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'claimId', CAST(cl.claimId AS CHAR),
|
||||
'nickName', COALESCE(cl.nickName, ''),
|
||||
'cost', COALESCE(cl.cost, 0),
|
||||
'remark', COALESCE(cl.remark, '')
|
||||
)
|
||||
)
|
||||
FROM (
|
||||
SELECT
|
||||
c.claim_id AS claimId,
|
||||
COALESCE(u.nick_name, '') AS nickName,
|
||||
COALESCE(c.cost, 0) AS cost,
|
||||
COALESCE(c.remark, '') AS remark
|
||||
FROM sys_oa_claim c
|
||||
INNER JOIN sys_user u ON c.user_id = u.user_id
|
||||
WHERE c.project_id = #{projectId} AND c.del_flag = 0
|
||||
) cl
|
||||
), JSON_ARRAY())
|
||||
) AS data
|
||||
'claimList',
|
||||
COALESCE(
|
||||
(
|
||||
SELECT JSON_ARRAYAGG(
|
||||
JSON_OBJECT(
|
||||
'claimId', CAST(cl.claimId AS CHAR),
|
||||
'nickName', COALESCE(cl.nickName, ''),
|
||||
'cost', COALESCE(cl.cost, 0),
|
||||
'remark', COALESCE(cl.remark, '')
|
||||
)
|
||||
)
|
||||
FROM (
|
||||
SELECT
|
||||
c.claim_id AS claimId,
|
||||
COALESCE(u.nick_name, '') AS nickName,
|
||||
COALESCE(c.cost, 0) AS cost,
|
||||
COALESCE(c.remark, '') AS remark
|
||||
FROM sys_oa_claim c
|
||||
INNER JOIN sys_user u
|
||||
ON c.user_id = u.user_id
|
||||
WHERE c.project_id = #{projectId}
|
||||
AND c.del_flag = 0
|
||||
) cl
|
||||
),
|
||||
JSON_ARRAY()
|
||||
)
|
||||
) AS data
|
||||
FROM sys_oa_project p
|
||||
WHERE p.project_id = #{projectId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.oa.mapper.SysOaWarehouseMasterMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.oa.domain.SysOaWarehouseMaster" id="SysOaWarehouseMasterResult">
|
||||
<result property="masterId" column="master_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="signTime" column="sign_time"/>
|
||||
<result property="signUser" column="sign_user"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -26,6 +26,7 @@
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="idCard" column="id_card"/>
|
||||
<result property="bankCard" column="bank_card"/>
|
||||
<result property="insure" column="insure"/>
|
||||
<result property="laborCost" column="labor_cost"/>
|
||||
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult"/>
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||
@@ -65,6 +66,7 @@
|
||||
select u.user_id,
|
||||
u.dept_id,
|
||||
u.user_name,
|
||||
u.insure,
|
||||
u.nick_name,
|
||||
u.user_type,
|
||||
u.email,
|
||||
@@ -102,7 +104,7 @@
|
||||
</sql>
|
||||
|
||||
<select id="selectPageUserList" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,u.id_card,u.bank_card,u.labor_cost,
|
||||
select u.user_id, u.insure, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,u.id_card,u.bank_card,u.labor_cost,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader,sr.role_id,sr.role_name
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
@@ -112,7 +114,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectUserList" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
select u.user_id, u.insure, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex,
|
||||
u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
@@ -120,7 +122,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectAllocatedList" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.insure, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role sur on u.user_id = sur.user_id
|
||||
@@ -129,7 +131,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectUnallocatedList" resultMap="SysUserResult">
|
||||
select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
select distinct u.user_id, u.insure, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role sur on u.user_id = sur.user_id
|
||||
@@ -163,7 +165,7 @@
|
||||
|
||||
|
||||
<select id="selectListAndNotDel" resultMap="ClearUser">
|
||||
select user_id,user_name,nick_name,labor_cost from sys_user where del_flag ='0'
|
||||
select user_id,user_name, u.insure,nick_name,labor_cost from sys_user where del_flag ='0'
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user