
40 changed files with 2206 additions and 9 deletions
@ -0,0 +1,92 @@ |
|||
package com.yxt.anrui.oa.api; |
|||
|
|||
import com.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyDetailVo; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyDto; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyService; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyVo; |
|||
import com.yxt.anrui.oa.biz.oaform.flowable.CompleteDto; |
|||
import com.yxt.anrui.oa.biz.oaform.flowable.NodeQuery; |
|||
import com.yxt.anrui.oa.biz.oaform.flowable.TaskDto; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.cloud.openfeign.SpringQueryMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.validation.Valid; |
|||
|
|||
@Api(tags = "办公用品领用申请") |
|||
@RestController |
|||
@RequestMapping("v1/AdOfficeSuppliesApply") |
|||
public class AdOfficeSuppliesApplyRest { |
|||
|
|||
@Autowired |
|||
private AdOfficeSuppliesApplyService adOfficeSuppliesApplyService; |
|||
|
|||
@ApiOperation("初始化(新增或修改)") |
|||
@GetMapping({"/getInit", "/getInit/{sid}"}) |
|||
public ResultBean<AdOfficeSuppliesApplyVo> getInit( |
|||
@PathVariable(value = "sid", required = false) String sid, |
|||
@RequestParam(value = "userSid", required = false) String userSid, |
|||
@RequestParam(value = "orgPath", required = false) String orgPath) { |
|||
ResultBean<AdOfficeSuppliesApplyVo> rb = ResultBean.fireFail(); |
|||
if (sid == null || sid.isEmpty()) { |
|||
// 执行新增初始化
|
|||
if (userSid == null || orgPath == null) { |
|||
return rb.setMsg("userSid和orgPath不能为空"); |
|||
} |
|||
return adOfficeSuppliesApplyService.getSaveInit(userSid, orgPath); |
|||
} else { |
|||
// 执行修改初始化
|
|||
return adOfficeSuppliesApplyService.getUpdateInit(sid); |
|||
} |
|||
} |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody AdOfficeSuppliesApplyDto dto) { |
|||
return adOfficeSuppliesApplyService.saveOrUpdateDto(dto); |
|||
} |
|||
|
|||
@ApiOperation("详情") |
|||
@GetMapping("/details/{sid}") |
|||
ResultBean<AdOfficeSuppliesApplyDetailVo> details(@PathVariable("sid") String sid |
|||
, @RequestParam(value = "application", required = false) String application) { |
|||
return adOfficeSuppliesApplyService.details(sid,application); |
|||
} |
|||
|
|||
@ApiOperation("根据sid批量删除") |
|||
@DeleteMapping("/delBySids") |
|||
public ResultBean delBySids(@RequestBody String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
adOfficeSuppliesApplyService.delAll(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
@ApiOperation("提交审批流程") |
|||
@PostMapping("/submit") |
|||
public ResultBean submit(@RequestBody AdOfficeSuppliesApplyDto dto) { |
|||
return adOfficeSuppliesApplyService.submit(dto); |
|||
} |
|||
|
|||
@ApiOperation(value = "办理(同意)") |
|||
@PutMapping("/complete") |
|||
public ResultBean complete(@Valid @RequestBody CompleteDto dto) { |
|||
return adOfficeSuppliesApplyService.complete(dto); |
|||
} |
|||
|
|||
@ApiOperation(value = "驳回任务") |
|||
@PutMapping(value = "/reject") |
|||
public ResultBean reject(@Valid @RequestBody TaskDto dto) { |
|||
return adOfficeSuppliesApplyService.reject(dto); |
|||
} |
|||
|
|||
@ApiOperation("获取流程操作标题") |
|||
@GetMapping("/getFlowOperateTitle") |
|||
@ResponseBody |
|||
ResultBean<String> getFlowOperateTitle(@SpringQueryMap NodeQuery query) { |
|||
return adOfficeSuppliesApplyService.getFlowOperateTitle(query); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,54 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
@ApiModel(value = "集团用酒领用申请", description = "集团用酒领用申请") |
|||
@TableName("ad_beverage_acceptance_apply") |
|||
public class AdBeverageAcceptanceApply extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("基础表单sid") |
|||
private String formSid; // 基础表单sid
|
|||
@ApiModelProperty("关联审批sid列表,英文逗号分隔") |
|||
private String linkFormSids; // 关联审批sid列表,英文逗号分隔
|
|||
@ApiModelProperty("用途分类key") |
|||
private String useTypeKey; // 用途分类key
|
|||
@ApiModelProperty("用途分类value") |
|||
private String useTypeValue; // 用途分类value
|
|||
@ApiModelProperty("费用承担部门sid") |
|||
private String feesDeptSid; // 费用承担部门sid
|
|||
@ApiModelProperty("费用承担部门") |
|||
private String feesDept; // 费用承担部门
|
|||
@ApiModelProperty("具体用途") |
|||
private String specificUses; // 具体用途
|
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.anrui.oa.biz.oaform.OaFormCommonVo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2025/1/21 |
|||
**/ |
|||
@Data |
|||
public class AdBeverageAcceptanceApplyDetailVo extends OaFormCommonVo { |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
@ApiModelProperty("用途分类key") |
|||
private String useTypeKey; // 用途分类key
|
|||
@ApiModelProperty("用途分类value") |
|||
private String useTypeValue; // 用途分类value
|
|||
@ApiModelProperty("费用承担部门sid") |
|||
private String feesDeptSid; // 费用承担部门sid
|
|||
@ApiModelProperty("费用承担部门") |
|||
private String feesDept; // 费用承担部门
|
|||
@ApiModelProperty("具体用途") |
|||
private String specificUses; // 具体用途
|
|||
@ApiModelProperty("费用承担部门obj") |
|||
private FormCommon feesDeptObj; // 费用承担部门obj
|
|||
@ApiModelProperty("用途分类obj") |
|||
private FormCommon useTypeObj; // 用途分类obj
|
|||
@ApiModelProperty("图片") |
|||
private List<String> files = new ArrayList<>(); |
|||
@ApiModelProperty("附件") |
|||
private List<String> appes = new ArrayList<>(); |
|||
|
|||
private List<FormCommon> list = new ArrayList<>(); //酒品明细
|
|||
} |
@ -0,0 +1,59 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.anrui.oa.biz.oaform.OaFormDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: oa(驻外人员认定申请) <br/> |
|||
* File: AdExpatriatesApplyDto.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesapply.AdExpatriatesApplyDto <br/> |
|||
* Description: 驻外人员认定申请 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-16 15:22:53 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定申请 数据传输对象", description = "驻外人员认定申请 数据传输对象") |
|||
public class AdBeverageAcceptanceApplyDto extends OaFormDto { |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
|
|||
private List<FormCommon> list = new ArrayList<>(); |
|||
} |
@ -0,0 +1,37 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface AdBeverageAcceptanceApplyMapper extends BaseMapper<AdBeverageAcceptanceApply> { |
|||
|
|||
int selectBySid(String join); |
|||
|
|||
AdBeverageAcceptanceApplyDetailVo details(String sid); |
|||
} |
@ -0,0 +1,39 @@ |
|||
<?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.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="selectBySid" resultType="int"> |
|||
SELECT COUNT(*) |
|||
FROM ad_office_supplies_apply ae |
|||
left join oa_form ofm on ae.formSid = ofm.sid |
|||
WHERE ofm.nodeState != '待提交' |
|||
and find_in_set(oa.sid, #{list}) |
|||
</select> |
|||
|
|||
<select id="details" resultMap="detailMap"> |
|||
select remarks, sid |
|||
from ad_office_supplies_apply |
|||
where sid = #{sid} |
|||
</select> |
|||
|
|||
<resultMap id="detailMap" type="com.yxt.anrui.oa.biz.adexpatriatesapply.AdExpatriatesApplyDetailVo"> |
|||
<result column="remarks" property="remarks"/> |
|||
<collection property="list" ofType="com.yxt.anrui.oa.biz.adexpatriatesdetail.AdExpatriatesListDetailVo" |
|||
select="selectList" column="sid"> |
|||
</collection> |
|||
</resultMap> |
|||
|
|||
<select id="selectList" resultType="com.yxt.anrui.oa.biz.adexpatriatesdetail.AdExpatriatesListDetailVo"> |
|||
select sid, |
|||
expatriatesName expatriatesValue, |
|||
expatriatesDeptName deptValue, |
|||
expatriatesPostName jobValue, |
|||
expatriatesHomeAddress, |
|||
expatriatesWorkAddress, |
|||
expatriatesDate |
|||
from ad_expatriates_detail |
|||
where mainSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,343 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailService; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailVo; |
|||
import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; |
|||
import com.yxt.anrui.oa.biz.oaform.*; |
|||
import com.yxt.anrui.oa.biz.oaform.flowable.*; |
|||
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
|||
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
|||
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
|
|||
@Service |
|||
public class AdBeverageAcceptanceApplyService extends MybatisBaseService<AdBeverageAcceptanceApplyMapper, AdBeverageAcceptanceApply> { |
|||
|
|||
@Autowired |
|||
private OaAppendixService oaAppendixService; |
|||
@Autowired |
|||
private OaFormService oaFormService; |
|||
@Autowired |
|||
private AdOfficeSuppliesDetailService adOfficeSuppliesDetailService; |
|||
@Autowired |
|||
private SysOrganizationFeign sysOrganizationFeign; |
|||
|
|||
public ResultBean<AdBeverageAcceptanceApplyVo> getSaveInit(String userSid, String orgPath) { |
|||
ResultBean<AdBeverageAcceptanceApplyVo> rb = ResultBean.fireFail(); |
|||
AdBeverageAcceptanceApplyVo adOfficeSuppliesApplyVo = new AdBeverageAcceptanceApplyVo(); |
|||
adOfficeSuppliesApplyVo.setCreateBySid(userSid); |
|||
adOfficeSuppliesApplyVo.setOrgSidPath(orgPath); |
|||
return rb.success().setData(adOfficeSuppliesApplyVo); |
|||
} |
|||
|
|||
public ResultBean<AdBeverageAcceptanceApplyVo> getUpdateInit(String sid) { |
|||
ResultBean<AdBeverageAcceptanceApplyVo> rb = ResultBean.fireFail(); |
|||
AdBeverageAcceptanceApplyVo adOfficeSuppliesApplyVo = new AdBeverageAcceptanceApplyVo(); |
|||
AdBeverageAcceptanceApply adOfficeSuppliesApply = fetchBySid(sid); |
|||
if (adOfficeSuppliesApply == null) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
OaForm oaForm = oaFormService.fetchBySid(sid); |
|||
adOfficeSuppliesApplyVo.setTaskId(oaForm.getTaskId()); |
|||
adOfficeSuppliesApplyVo.setProcInsId(oaForm.getProcInstId()); |
|||
//根据部门sid获取orgPath并赋值
|
|||
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(oaForm.getDeptSid()).getData(); |
|||
String orgSidPath = organizationVo.getOrgSidPath(); |
|||
adOfficeSuppliesApplyVo.setOrgSidPath(orgSidPath); |
|||
adOfficeSuppliesApplyVo.setCreateBySid(oaForm.getCreateBySid()); |
|||
BeanUtil.copyProperties(adOfficeSuppliesApply, adOfficeSuppliesApplyVo); |
|||
List<AdOfficeSuppliesDetailVo> list = adOfficeSuppliesDetailService.getUpdateInit(sid); |
|||
list.removeAll(Collections.singleton(null)); |
|||
List<FormCommon> officeObj = new ArrayList<>(); |
|||
if (!list.isEmpty()) { |
|||
for (AdOfficeSuppliesDetailVo d : list) { |
|||
FormCommon formCommon = new FormCommon(); |
|||
Map<String, Object> extra = new HashMap<>(); |
|||
formCommon.setId(d.getInventorySid()); |
|||
formCommon.setDictValue(d.getGoodsSpuName()); |
|||
if (StringUtils.isNotBlank(d.getCount())) { |
|||
extra.put("count",d.getCount()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuOwnSpec())) { |
|||
extra.put("goodsSkuOwnSpec",d.getGoodsSkuOwnSpec()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuSid())) { |
|||
extra.put("goodsSkuSid",d.getGoodsSkuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSpuSid())) { |
|||
extra.put("goodsSpuSid",d.getGoodsSpuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getUnit())) { |
|||
extra.put("unit",d.getUnit()); |
|||
} |
|||
formCommon.setExtra(extra); |
|||
officeObj.add(formCommon); |
|||
} |
|||
} |
|||
adOfficeSuppliesApplyVo.setList(officeObj); |
|||
adOfficeSuppliesApplyVo.setSid(sid); |
|||
return rb.success().setData(adOfficeSuppliesApplyVo); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdateDto(AdBeverageAcceptanceApplyDto dto) { |
|||
ResultBean<String> rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
List<FormCommon> list = dto.getList(); |
|||
if (StringUtils.isBlank(sid)) { |
|||
// 新建操作
|
|||
AdBeverageAcceptanceApply entity = new AdBeverageAcceptanceApply(); |
|||
BeanUtil.copyProperties(dto, entity, "sid"); |
|||
|
|||
dto.setBillNo("BGYPLY"); |
|||
dto.setSid(entity.getSid()); |
|||
ResultBean<String> resultBean = oaFormService.saveOaForm(dto); |
|||
|
|||
if (!resultBean.getSuccess()) { |
|||
return rb; |
|||
} |
|||
|
|||
entity.setFormSid(resultBean.getData()); |
|||
baseMapper.insert(entity); |
|||
sid = entity.getSid(); |
|||
} else { |
|||
// 更新操作
|
|||
AdBeverageAcceptanceApply entity = fetchBySid(sid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
adOfficeSuppliesDetailService.saveDetails(list, sid); |
|||
return rb.success().setData(sid); |
|||
} |
|||
|
|||
|
|||
public ResultBean delAll(String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
//查询该sid中是否有流程不是待提交的
|
|||
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|||
if (count > 0) { |
|||
return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); |
|||
} |
|||
delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean<AdBeverageAcceptanceApplyDetailVo> details(String sid, String application) { |
|||
ResultBean<AdBeverageAcceptanceApplyDetailVo> rb = ResultBean.fireFail(); |
|||
AdBeverageAcceptanceApplyDetailVo adOfficeSuppliesApplyDetailVo = baseMapper.details(sid); |
|||
if (adOfficeSuppliesApplyDetailVo == null) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
//基础字段赋值
|
|||
BeanUtil.copyProperties(oaFormService.getDetails(sid), adOfficeSuppliesApplyDetailVo); |
|||
List<FormCommon> obj = new ArrayList<>(); |
|||
List<AdOfficeSuppliesDetailVo> detailVos = adOfficeSuppliesDetailService.getUpdateInit(sid); |
|||
if (!detailVos.isEmpty()) { |
|||
for (AdOfficeSuppliesDetailVo d : detailVos) { |
|||
FormCommon formCommon = new FormCommon(); |
|||
Map<String, Object> extra = new HashMap<>(); |
|||
formCommon.setId(d.getInventorySid()); |
|||
formCommon.setDictValue(d.getGoodsSpuName()); |
|||
if (StringUtils.isNotBlank(d.getCount())) { |
|||
extra.put("count",d.getCount()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuOwnSpec())) { |
|||
extra.put("goodsSkuOwnSpec",d.getGoodsSkuOwnSpec()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuSid())) { |
|||
extra.put("goodsSkuSid",d.getGoodsSkuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSpuSid())) { |
|||
extra.put("goodsSpuSid",d.getGoodsSpuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getUnit())) { |
|||
extra.put("unit",d.getUnit()); |
|||
} |
|||
formCommon.setExtra(extra); |
|||
obj.add(formCommon); |
|||
} |
|||
} |
|||
adOfficeSuppliesApplyDetailVo.setList(obj); |
|||
return rb.success().setData(adOfficeSuppliesApplyDetailVo); |
|||
} |
|||
|
|||
/** |
|||
* 提交 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean submit(AdBeverageAcceptanceApplyDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ResultBean<String> stringResultBean = saveOrUpdateDto(dto); |
|||
if (!stringResultBean.getSuccess()) { |
|||
return rb.setMsg(stringResultBean.getData()); |
|||
} |
|||
String businessSid = stringResultBean.getData(); |
|||
|
|||
SubmitDto submitDto = new SubmitDto(); |
|||
submitDto.setUserSid(dto.getCreateBySid()); |
|||
submitDto.setBusinessSid(businessSid); |
|||
|
|||
Map<String, Object> formVariables = new HashMap<>(); |
|||
formVariables = getMap(formVariables, businessSid); |
|||
submitDto.setFormVariables(formVariables); |
|||
submitDto.setProcDefId(ProcDefEnum.BGYPLYAPPLY.getProDefId()); |
|||
submitDto.setNextTaskId(dto.getTaskId()); |
|||
submitDto.setRule(OaFormRuleEnum.DIRECTLY_UNDER.getRule()); |
|||
return oaFormService.submit(submitDto); |
|||
} |
|||
|
|||
/** |
|||
* 办理(同意) |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean complete(CompleteDto dto) { |
|||
Map<String, Object> formVariables = dto.getFormVariables(); |
|||
formVariables = getMap(formVariables, dto.getBusinessSid()); |
|||
dto.setFormVariables(formVariables); |
|||
BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); |
|||
BeanUtil.copyProperties(dto, businessVariablesDto); |
|||
return oaFormService.complete(businessVariablesDto); |
|||
} |
|||
|
|||
/** |
|||
* 驳回 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean reject(TaskDto dto) { |
|||
Map<String, Object> formVariables = dto.getFormVariables(); |
|||
formVariables = getMap(formVariables, dto.getBusinessSid()); |
|||
dto.setFormVariables(formVariables); |
|||
return oaFormService.reject(dto); |
|||
} |
|||
|
|||
public ResultBean<String> getFlowOperateTitle(NodeQuery query) { |
|||
// 默认失败返回
|
|||
ResultBean<String> rb = ResultBean.fireFail(); |
|||
|
|||
// 获取next值和formVariables
|
|||
int next = query.getNext(); |
|||
|
|||
// 获取并更新formVariables
|
|||
Map<String, Object> formVariables = getMap(query.getFormVariables(), query.getBusinessSid()); |
|||
query.setFormVariables(formVariables); |
|||
|
|||
// 校验next参数是否有效(只允许0或1)
|
|||
if (next != 0 && next != 1) { |
|||
return rb.setMsg("参数错误:next"); // 如果next不是0或1,返回错误信息
|
|||
} |
|||
|
|||
// 获取节点名称
|
|||
String data = getNodeName(query, next); |
|||
|
|||
// 如果data为null,表示未获取到有效的节点信息
|
|||
if (data == null) { |
|||
return rb.setMsg("没有获取到节点信息"); // 返回错误消息
|
|||
} |
|||
|
|||
// 返回成功的结果和获取到的节点名称
|
|||
return rb.success().setData(data); |
|||
} |
|||
|
|||
/** |
|||
* 网关参数组成 |
|||
* |
|||
* @param formVariables |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
public Map<String, Object> getMap(Map<String, Object> formVariables, String sid) { |
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
appMap.put("sid", sid); |
|||
/*appMap.put("editUrl", "approval/#/pages/EditOnboradingApplyActivity?sid=" + sid); |
|||
appMap.put("detailUrl", "approval/#/pages/DetailOnboradingApplyActivity?sid=" + sid); |
|||
appMap.put("flowOperateUrl", "oa/v1/HrHireApply/getFlowOperateTitle"); |
|||
appMap.put("agreeUrl", "oa/v1/HrHireApply/complete"); |
|||
appMap.put("stopUrl", "oa/v1/oaform/breakProcess"); |
|||
appMap.put("rejectUrl", "oa/v1/HrHireApply/reject"); |
|||
appMap.put("recallUrl", "oa/v1/oaform/revokeProcess"); |
|||
appMap.put("signUrl", "oa/v1/oaform/delegate"); |
|||
appMap.put("transferUrl", "oa/v1/oaform/assignTask");*/ |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_EDIT.getType(), OaFormUrlEnum.HRHIREAPPLY_EDIT.getUrl() + "?sid=" + sid); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_DETAIL.getType(), OaFormUrlEnum.HRHIREAPPLY_DETAIL.getUrl() + "?sid=" + sid); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.STOPURL.getType(), OaFormUrlEnum.STOPURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getType(), OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.RECALLURL.getType(), OaFormUrlEnum.RECALLURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.SIGNURL.getType(), OaFormUrlEnum.SIGNURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.TRANSFERURL.getType(), OaFormUrlEnum.TRANSFERURL.getUrl()); |
|||
formVariables.put("app", appMap); |
|||
//根据组织查询是否是分公司
|
|||
OaForm oaForm = oaFormService.fetchBySid(sid); |
|||
AdBeverageAcceptanceApply adOfficeSuppliesApply = fetchBySid(sid); |
|||
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(oaForm.getUseOrgSid()).getData(); |
|||
//是否是分公司
|
|||
formVariables.put("isTrue", sysOrganization.getIsDept() == 0); |
|||
return formVariables; |
|||
} |
|||
|
|||
/** |
|||
* 根据next的值获取前一个节点或下一个节点的名称。 |
|||
* |
|||
* @param query 包含查询所需参数的NodeQuery对象 |
|||
* @param next 参数,0表示上一环节,1表示下一环节 |
|||
* @return 节点名称,如果失败则返回null |
|||
*/ |
|||
private String getNodeName(NodeQuery query, int next) { |
|||
// 根据next值选择相应的服务方法获取节点信息
|
|||
ResultBean<List<NodeVo>> resultBean = (next == 0) |
|||
? oaFormService.getPreviousNodesForReject(query) // 获取上一环节的节点
|
|||
: oaFormService.getNextNodesForSubmit(query); // 获取下一环节的节点
|
|||
// 如果服务调用成功
|
|||
if (resultBean.getSuccess()) { |
|||
// 清除结果列表中的null值,避免空节点
|
|||
resultBean.getData().removeAll(Collections.singleton(null)); |
|||
// 如果结果列表非空,返回第一个节点的名称
|
|||
if (!resultBean.getData().isEmpty()) { |
|||
return resultBean.getData().get(0).getName(); |
|||
} |
|||
} else { |
|||
// 如果服务调用失败,返回null
|
|||
return null; |
|||
} |
|||
// 如果结果为空,返回null
|
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptanceapply; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class AdBeverageAcceptanceApplyVo { |
|||
|
|||
private String sid; |
|||
/* private String userSid; |
|||
private String orgPath;*/ |
|||
private String orgSidPath; |
|||
private String createBySid; |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
private List<FormCommon> list = new ArrayList<>(); |
|||
|
|||
private String taskId; |
|||
@ApiModelProperty("流程实例id") |
|||
private String procInsId; |
|||
|
|||
// private String testPage;
|
|||
} |
@ -0,0 +1,77 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetail.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetail <br/> |
|||
* Description: 驻外人员认定列表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "集团用酒领用申请列表", description = "集团用酒领用申请列表") |
|||
@TableName("ad_beverage_acceptance_detail") |
|||
public class AdBeverageAcceptanceDetail extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("申请sid") |
|||
private String mainSid; // 申请sid
|
|||
@ApiModelProperty("物品基础信息Sid") |
|||
private String goodsSpuSid; // 物品基础信息Sid
|
|||
@ApiModelProperty("商品名称") |
|||
private String goodsSpuName; // 商品名称
|
|||
@ApiModelProperty("物品Skusid") |
|||
private String goodsSkuSid; // 物品Skusid
|
|||
@ApiModelProperty("规格型号") |
|||
private String goodsSkuOwnSpec; // 规格型号
|
|||
@ApiModelProperty("计量单位") |
|||
private String unit; // 计量单位
|
|||
@ApiModelProperty("数量") |
|||
private BigDecimal count; // 库存数量
|
|||
@ApiModelProperty("库存sid") |
|||
private String inventorySid; // 库存sid
|
|||
@ApiModelProperty("单价") |
|||
private BigDecimal price; // 单价
|
|||
@ApiModelProperty("合计金额") |
|||
private BigDecimal priceTotal; // 合计金额
|
|||
|
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetailDto.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetailDto <br/> |
|||
* Description: 驻外人员认定列表 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定列表 数据传输对象", description = "驻外人员认定列表 数据传输对象") |
|||
public class AdBeverageAcceptanceDetailDto implements Dto { |
|||
|
|||
@ApiModelProperty("驻外人员") |
|||
private FormCommon expatriatesObj; |
|||
private String expatriatesKey; |
|||
private String expatriatesValue; |
|||
@ApiModelProperty("驻外人员部门") |
|||
private FormCommon deptObj; |
|||
private String deptKey; |
|||
private String deptValue; |
|||
@ApiModelProperty("驻外人员职位") |
|||
private FormCommon jobObj; |
|||
private String jobKey; |
|||
private String jobValue; |
|||
@ApiModelProperty("驻外人员家庭常住地址") |
|||
private String expatriatesHomeAddress; |
|||
@ApiModelProperty("驻外人员工作地址") |
|||
private String expatriatesWorkAddress; |
|||
@ApiModelProperty("驻外人员开始驻外时间") |
|||
private String expatriatesDate; |
|||
} |
@ -0,0 +1,66 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetailVo.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetailVo <br/> |
|||
* Description: 驻外人员认定列表 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定列表 视图数据对象", description = "驻外人员认定列表 视图数据对象") |
|||
public class AdBeverageAcceptanceDetailListDetailVo implements Vo { |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("驻外人员") |
|||
private String expatriatesValue; |
|||
@ApiModelProperty("驻外人员部门") |
|||
private String deptValue; |
|||
@ApiModelProperty("驻外人员职位") |
|||
private String jobValue; |
|||
@ApiModelProperty("驻外人员家庭常住地址") |
|||
private String expatriatesHomeAddress; |
|||
@ApiModelProperty("驻外人员工作地址") |
|||
private String expatriatesWorkAddress; |
|||
@ApiModelProperty("驻外人员开始驻外时间") |
|||
private String expatriatesDate; |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface AdBeverageAcceptanceDetailMapper extends BaseMapper<AdBeverageAcceptanceDetail> { |
|||
|
|||
@Select("select * from ad_office_supplies_detail where mainSid = #{mainSid}") |
|||
List<AdBeverageAcceptanceDetail> selectByMainSid(String mainSid); |
|||
|
|||
List<AdBeverageAcceptanceDetailVo> getUpdateInit(String sid); |
|||
} |
@ -0,0 +1,9 @@ |
|||
<?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.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailMapper"> |
|||
<select id="getUpdateInit" resultType="com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailVo"> |
|||
select * |
|||
from ad_office_supplies_detail |
|||
where mainSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,87 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class AdBeverageAcceptanceDetailService extends MybatisBaseService<AdBeverageAcceptanceDetailMapper, AdBeverageAcceptanceDetail> { |
|||
|
|||
public void saveDetails(List<FormCommon> list, String sid) { |
|||
//根据sid查询明细并删除
|
|||
List<AdBeverageAcceptanceDetail> list2 = baseMapper.selectByMainSid(sid); |
|||
list2.removeAll(Collections.singleton(null)); |
|||
if (!list2.isEmpty()) { |
|||
list2.stream().forEach(v -> { |
|||
deleteBySid(v.getSid()); |
|||
}); |
|||
} |
|||
list.removeAll(Collections.singleton(null)); |
|||
if (!list.isEmpty()) { |
|||
list.stream().forEach(f -> { |
|||
AdBeverageAcceptanceDetail detail = new AdBeverageAcceptanceDetail(); |
|||
detail.setMainSid(sid); |
|||
detail.setInventorySid(f.getId()); |
|||
detail.setGoodsSpuName(f.getDictValue()); |
|||
if (null != f.getExtra()) { |
|||
Map<String, Object> e = f.getExtra(); |
|||
for (Map.Entry <String,Object> entry : e.entrySet()) { |
|||
if (StringUtils.isNotBlank((String)entry.getValue())) { |
|||
if (entry.getKey().equals("count")) { |
|||
detail.setCount(new BigDecimal((String)entry.getValue())); |
|||
} |
|||
if (entry.getKey().equals("goodsSkuOwnSpec")) { |
|||
detail.setGoodsSkuOwnSpec((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("goodsSkuSid")) { |
|||
detail.setGoodsSkuSid((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("goodsSpuSid")) { |
|||
detail.setGoodsSpuSid((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("unit")) { |
|||
detail.setUnit((String)entry.getValue()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
baseMapper.insert(detail); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
public List<AdBeverageAcceptanceDetailVo> getUpdateInit(String sid) { |
|||
return baseMapper.getUpdateInit(sid); |
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adbeverageacceptancedetail; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetailVo.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetailVo <br/> |
|||
* Description: 驻外人员认定列表 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定列表 视图数据对象", description = "驻外人员认定列表 视图数据对象") |
|||
public class AdBeverageAcceptanceDetailVo implements Vo { |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("物品基础信息Sid") |
|||
private String goodsSpuSid; // 物品基础信息Sid
|
|||
@ApiModelProperty("商品名称") |
|||
private String goodsSpuName; // 商品名称
|
|||
@ApiModelProperty("物品Skusid") |
|||
private String goodsSkuSid; // 物品Skusid
|
|||
@ApiModelProperty("规格型号") |
|||
private String goodsSkuOwnSpec; // 规格型号
|
|||
@ApiModelProperty("计量单位") |
|||
private String unit; // 计量单位
|
|||
@ApiModelProperty("库存数量") |
|||
private String count; // 库存数量
|
|||
@ApiModelProperty("库存sid") |
|||
private String inventorySid; // 库存sid
|
|||
} |
@ -0,0 +1,44 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
@ApiModel(value = "办公用品领用", description = "办公用品领用") |
|||
@TableName("ad_office_supplies_apply") |
|||
public class AdOfficeSuppliesApply extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("基础表单sid") |
|||
private String formSid; // 基础表单sid
|
|||
|
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.anrui.oa.biz.oaform.OaFormCommonVo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2025/1/21 |
|||
**/ |
|||
@Data |
|||
public class AdOfficeSuppliesApplyDetailVo extends OaFormCommonVo { |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
|
|||
private List<FormCommon> list = new ArrayList<>(); |
|||
} |
@ -0,0 +1,59 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.anrui.oa.biz.oaform.OaFormDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* Project: oa(驻外人员认定申请) <br/> |
|||
* File: AdExpatriatesApplyDto.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesapply.AdExpatriatesApplyDto <br/> |
|||
* Description: 驻外人员认定申请 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-16 15:22:53 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定申请 数据传输对象", description = "驻外人员认定申请 数据传输对象") |
|||
public class AdOfficeSuppliesApplyDto extends OaFormDto { |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
|
|||
private List<FormCommon> list = new ArrayList<>(); |
|||
} |
@ -0,0 +1,37 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
@Mapper |
|||
public interface AdOfficeSuppliesApplyMapper extends BaseMapper<AdOfficeSuppliesApply> { |
|||
|
|||
int selectBySid(String join); |
|||
|
|||
AdOfficeSuppliesApplyDetailVo details(String sid); |
|||
} |
@ -0,0 +1,39 @@ |
|||
<?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.yxt.anrui.oa.biz.adofficesuppliesapply.AdOfficeSuppliesApplyMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="selectBySid" resultType="int"> |
|||
SELECT COUNT(*) |
|||
FROM ad_office_supplies_apply ae |
|||
left join oa_form ofm on ae.formSid = ofm.sid |
|||
WHERE ofm.nodeState != '待提交' |
|||
and find_in_set(oa.sid, #{list}) |
|||
</select> |
|||
|
|||
<select id="details" resultMap="detailMap"> |
|||
select remarks, sid |
|||
from ad_office_supplies_apply |
|||
where sid = #{sid} |
|||
</select> |
|||
|
|||
<resultMap id="detailMap" type="com.yxt.anrui.oa.biz.adexpatriatesapply.AdExpatriatesApplyDetailVo"> |
|||
<result column="remarks" property="remarks"/> |
|||
<collection property="list" ofType="com.yxt.anrui.oa.biz.adexpatriatesdetail.AdExpatriatesListDetailVo" |
|||
select="selectList" column="sid"> |
|||
</collection> |
|||
</resultMap> |
|||
|
|||
<select id="selectList" resultType="com.yxt.anrui.oa.biz.adexpatriatesdetail.AdExpatriatesListDetailVo"> |
|||
select sid, |
|||
expatriatesName expatriatesValue, |
|||
expatriatesDeptName deptValue, |
|||
expatriatesPostName jobValue, |
|||
expatriatesHomeAddress, |
|||
expatriatesWorkAddress, |
|||
expatriatesDate |
|||
from ad_expatriates_detail |
|||
where mainSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,343 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailService; |
|||
import com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailVo; |
|||
import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; |
|||
import com.yxt.anrui.oa.biz.oaform.*; |
|||
import com.yxt.anrui.oa.biz.oaform.flowable.*; |
|||
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
|||
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
|||
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
|
|||
@Service |
|||
public class AdOfficeSuppliesApplyService extends MybatisBaseService<AdOfficeSuppliesApplyMapper, AdOfficeSuppliesApply> { |
|||
|
|||
@Autowired |
|||
private OaAppendixService oaAppendixService; |
|||
@Autowired |
|||
private OaFormService oaFormService; |
|||
@Autowired |
|||
private AdOfficeSuppliesDetailService adOfficeSuppliesDetailService; |
|||
@Autowired |
|||
private SysOrganizationFeign sysOrganizationFeign; |
|||
|
|||
public ResultBean<AdOfficeSuppliesApplyVo> getSaveInit(String userSid, String orgPath) { |
|||
ResultBean<AdOfficeSuppliesApplyVo> rb = ResultBean.fireFail(); |
|||
AdOfficeSuppliesApplyVo adOfficeSuppliesApplyVo = new AdOfficeSuppliesApplyVo(); |
|||
adOfficeSuppliesApplyVo.setCreateBySid(userSid); |
|||
adOfficeSuppliesApplyVo.setOrgSidPath(orgPath); |
|||
return rb.success().setData(adOfficeSuppliesApplyVo); |
|||
} |
|||
|
|||
public ResultBean<AdOfficeSuppliesApplyVo> getUpdateInit(String sid) { |
|||
ResultBean<AdOfficeSuppliesApplyVo> rb = ResultBean.fireFail(); |
|||
AdOfficeSuppliesApplyVo adOfficeSuppliesApplyVo = new AdOfficeSuppliesApplyVo(); |
|||
AdOfficeSuppliesApply adOfficeSuppliesApply = fetchBySid(sid); |
|||
if (adOfficeSuppliesApply == null) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
OaForm oaForm = oaFormService.fetchBySid(sid); |
|||
adOfficeSuppliesApplyVo.setTaskId(oaForm.getTaskId()); |
|||
adOfficeSuppliesApplyVo.setProcInsId(oaForm.getProcInstId()); |
|||
//根据部门sid获取orgPath并赋值
|
|||
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(oaForm.getDeptSid()).getData(); |
|||
String orgSidPath = organizationVo.getOrgSidPath(); |
|||
adOfficeSuppliesApplyVo.setOrgSidPath(orgSidPath); |
|||
adOfficeSuppliesApplyVo.setCreateBySid(oaForm.getCreateBySid()); |
|||
BeanUtil.copyProperties(adOfficeSuppliesApply, adOfficeSuppliesApplyVo); |
|||
List<AdOfficeSuppliesDetailVo> list = adOfficeSuppliesDetailService.getUpdateInit(sid); |
|||
list.removeAll(Collections.singleton(null)); |
|||
List<FormCommon> officeObj = new ArrayList<>(); |
|||
if (!list.isEmpty()) { |
|||
for (AdOfficeSuppliesDetailVo d : list) { |
|||
FormCommon formCommon = new FormCommon(); |
|||
Map<String, Object> extra = new HashMap<>(); |
|||
formCommon.setId(d.getInventorySid()); |
|||
formCommon.setDictValue(d.getGoodsSpuName()); |
|||
if (StringUtils.isNotBlank(d.getCount())) { |
|||
extra.put("count",d.getCount()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuOwnSpec())) { |
|||
extra.put("goodsSkuOwnSpec",d.getGoodsSkuOwnSpec()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuSid())) { |
|||
extra.put("goodsSkuSid",d.getGoodsSkuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSpuSid())) { |
|||
extra.put("goodsSpuSid",d.getGoodsSpuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getUnit())) { |
|||
extra.put("unit",d.getUnit()); |
|||
} |
|||
formCommon.setExtra(extra); |
|||
officeObj.add(formCommon); |
|||
} |
|||
} |
|||
adOfficeSuppliesApplyVo.setList(officeObj); |
|||
adOfficeSuppliesApplyVo.setSid(sid); |
|||
return rb.success().setData(adOfficeSuppliesApplyVo); |
|||
} |
|||
|
|||
public ResultBean<String> saveOrUpdateDto(AdOfficeSuppliesApplyDto dto) { |
|||
ResultBean<String> rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
List<FormCommon> list = dto.getList(); |
|||
if (StringUtils.isBlank(sid)) { |
|||
// 新建操作
|
|||
AdOfficeSuppliesApply entity = new AdOfficeSuppliesApply(); |
|||
BeanUtil.copyProperties(dto, entity, "sid"); |
|||
|
|||
dto.setBillNo("BGYPLY"); |
|||
dto.setSid(entity.getSid()); |
|||
ResultBean<String> resultBean = oaFormService.saveOaForm(dto); |
|||
|
|||
if (!resultBean.getSuccess()) { |
|||
return rb; |
|||
} |
|||
|
|||
entity.setFormSid(resultBean.getData()); |
|||
baseMapper.insert(entity); |
|||
sid = entity.getSid(); |
|||
} else { |
|||
// 更新操作
|
|||
AdOfficeSuppliesApply entity = fetchBySid(sid); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.updateById(entity); |
|||
} |
|||
adOfficeSuppliesDetailService.saveDetails(list, sid); |
|||
return rb.success().setData(sid); |
|||
} |
|||
|
|||
|
|||
public ResultBean delAll(String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
//查询该sid中是否有流程不是待提交的
|
|||
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|||
if (count > 0) { |
|||
return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); |
|||
} |
|||
delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean<AdOfficeSuppliesApplyDetailVo> details(String sid, String application) { |
|||
ResultBean<AdOfficeSuppliesApplyDetailVo> rb = ResultBean.fireFail(); |
|||
AdOfficeSuppliesApplyDetailVo adOfficeSuppliesApplyDetailVo = baseMapper.details(sid); |
|||
if (adOfficeSuppliesApplyDetailVo == null) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
//基础字段赋值
|
|||
BeanUtil.copyProperties(oaFormService.getDetails(sid), adOfficeSuppliesApplyDetailVo); |
|||
List<FormCommon> obj = new ArrayList<>(); |
|||
List<AdOfficeSuppliesDetailVo> detailVos = adOfficeSuppliesDetailService.getUpdateInit(sid); |
|||
if (!detailVos.isEmpty()) { |
|||
for (AdOfficeSuppliesDetailVo d : detailVos) { |
|||
FormCommon formCommon = new FormCommon(); |
|||
Map<String, Object> extra = new HashMap<>(); |
|||
formCommon.setId(d.getInventorySid()); |
|||
formCommon.setDictValue(d.getGoodsSpuName()); |
|||
if (StringUtils.isNotBlank(d.getCount())) { |
|||
extra.put("count",d.getCount()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuOwnSpec())) { |
|||
extra.put("goodsSkuOwnSpec",d.getGoodsSkuOwnSpec()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSkuSid())) { |
|||
extra.put("goodsSkuSid",d.getGoodsSkuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getGoodsSpuSid())) { |
|||
extra.put("goodsSpuSid",d.getGoodsSpuSid()); |
|||
} |
|||
if (StringUtils.isNotBlank(d.getUnit())) { |
|||
extra.put("unit",d.getUnit()); |
|||
} |
|||
formCommon.setExtra(extra); |
|||
obj.add(formCommon); |
|||
} |
|||
} |
|||
adOfficeSuppliesApplyDetailVo.setList(obj); |
|||
return rb.success().setData(adOfficeSuppliesApplyDetailVo); |
|||
} |
|||
|
|||
/** |
|||
* 提交 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean submit(AdOfficeSuppliesApplyDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ResultBean<String> stringResultBean = saveOrUpdateDto(dto); |
|||
if (!stringResultBean.getSuccess()) { |
|||
return rb.setMsg(stringResultBean.getData()); |
|||
} |
|||
String businessSid = stringResultBean.getData(); |
|||
|
|||
SubmitDto submitDto = new SubmitDto(); |
|||
submitDto.setUserSid(dto.getCreateBySid()); |
|||
submitDto.setBusinessSid(businessSid); |
|||
|
|||
Map<String, Object> formVariables = new HashMap<>(); |
|||
formVariables = getMap(formVariables, businessSid); |
|||
submitDto.setFormVariables(formVariables); |
|||
submitDto.setProcDefId(ProcDefEnum.BGYPLYAPPLY.getProDefId()); |
|||
submitDto.setNextTaskId(dto.getTaskId()); |
|||
submitDto.setRule(OaFormRuleEnum.DIRECTLY_UNDER.getRule()); |
|||
return oaFormService.submit(submitDto); |
|||
} |
|||
|
|||
/** |
|||
* 办理(同意) |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean complete(CompleteDto dto) { |
|||
Map<String, Object> formVariables = dto.getFormVariables(); |
|||
formVariables = getMap(formVariables, dto.getBusinessSid()); |
|||
dto.setFormVariables(formVariables); |
|||
BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); |
|||
BeanUtil.copyProperties(dto, businessVariablesDto); |
|||
return oaFormService.complete(businessVariablesDto); |
|||
} |
|||
|
|||
/** |
|||
* 驳回 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean reject(TaskDto dto) { |
|||
Map<String, Object> formVariables = dto.getFormVariables(); |
|||
formVariables = getMap(formVariables, dto.getBusinessSid()); |
|||
dto.setFormVariables(formVariables); |
|||
return oaFormService.reject(dto); |
|||
} |
|||
|
|||
public ResultBean<String> getFlowOperateTitle(NodeQuery query) { |
|||
// 默认失败返回
|
|||
ResultBean<String> rb = ResultBean.fireFail(); |
|||
|
|||
// 获取next值和formVariables
|
|||
int next = query.getNext(); |
|||
|
|||
// 获取并更新formVariables
|
|||
Map<String, Object> formVariables = getMap(query.getFormVariables(), query.getBusinessSid()); |
|||
query.setFormVariables(formVariables); |
|||
|
|||
// 校验next参数是否有效(只允许0或1)
|
|||
if (next != 0 && next != 1) { |
|||
return rb.setMsg("参数错误:next"); // 如果next不是0或1,返回错误信息
|
|||
} |
|||
|
|||
// 获取节点名称
|
|||
String data = getNodeName(query, next); |
|||
|
|||
// 如果data为null,表示未获取到有效的节点信息
|
|||
if (data == null) { |
|||
return rb.setMsg("没有获取到节点信息"); // 返回错误消息
|
|||
} |
|||
|
|||
// 返回成功的结果和获取到的节点名称
|
|||
return rb.success().setData(data); |
|||
} |
|||
|
|||
/** |
|||
* 网关参数组成 |
|||
* |
|||
* @param formVariables |
|||
* @param sid |
|||
* @return |
|||
*/ |
|||
public Map<String, Object> getMap(Map<String, Object> formVariables, String sid) { |
|||
Map<String, Object> appMap = new HashMap<>(); |
|||
appMap.put("sid", sid); |
|||
/*appMap.put("editUrl", "approval/#/pages/EditOnboradingApplyActivity?sid=" + sid); |
|||
appMap.put("detailUrl", "approval/#/pages/DetailOnboradingApplyActivity?sid=" + sid); |
|||
appMap.put("flowOperateUrl", "oa/v1/HrHireApply/getFlowOperateTitle"); |
|||
appMap.put("agreeUrl", "oa/v1/HrHireApply/complete"); |
|||
appMap.put("stopUrl", "oa/v1/oaform/breakProcess"); |
|||
appMap.put("rejectUrl", "oa/v1/HrHireApply/reject"); |
|||
appMap.put("recallUrl", "oa/v1/oaform/revokeProcess"); |
|||
appMap.put("signUrl", "oa/v1/oaform/delegate"); |
|||
appMap.put("transferUrl", "oa/v1/oaform/assignTask");*/ |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_EDIT.getType(), OaFormUrlEnum.HRHIREAPPLY_EDIT.getUrl() + "?sid=" + sid); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_DETAIL.getType(), OaFormUrlEnum.HRHIREAPPLY_DETAIL.getUrl() + "?sid=" + sid); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.STOPURL.getType(), OaFormUrlEnum.STOPURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getType(), OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.RECALLURL.getType(), OaFormUrlEnum.RECALLURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.SIGNURL.getType(), OaFormUrlEnum.SIGNURL.getUrl()); |
|||
appMap.put(OaFormUrlEnum.TRANSFERURL.getType(), OaFormUrlEnum.TRANSFERURL.getUrl()); |
|||
formVariables.put("app", appMap); |
|||
//根据组织查询是否是分公司
|
|||
OaForm oaForm = oaFormService.fetchBySid(sid); |
|||
AdOfficeSuppliesApply adOfficeSuppliesApply = fetchBySid(sid); |
|||
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(oaForm.getUseOrgSid()).getData(); |
|||
//是否是分公司
|
|||
formVariables.put("isTrue", sysOrganization.getIsDept() == 0); |
|||
return formVariables; |
|||
} |
|||
|
|||
/** |
|||
* 根据next的值获取前一个节点或下一个节点的名称。 |
|||
* |
|||
* @param query 包含查询所需参数的NodeQuery对象 |
|||
* @param next 参数,0表示上一环节,1表示下一环节 |
|||
* @return 节点名称,如果失败则返回null |
|||
*/ |
|||
private String getNodeName(NodeQuery query, int next) { |
|||
// 根据next值选择相应的服务方法获取节点信息
|
|||
ResultBean<List<NodeVo>> resultBean = (next == 0) |
|||
? oaFormService.getPreviousNodesForReject(query) // 获取上一环节的节点
|
|||
: oaFormService.getNextNodesForSubmit(query); // 获取下一环节的节点
|
|||
// 如果服务调用成功
|
|||
if (resultBean.getSuccess()) { |
|||
// 清除结果列表中的null值,避免空节点
|
|||
resultBean.getData().removeAll(Collections.singleton(null)); |
|||
// 如果结果列表非空,返回第一个节点的名称
|
|||
if (!resultBean.getData().isEmpty()) { |
|||
return resultBean.getData().get(0).getName(); |
|||
} |
|||
} else { |
|||
// 如果服务调用失败,返回null
|
|||
return null; |
|||
} |
|||
// 如果结果为空,返回null
|
|||
return null; |
|||
} |
|||
} |
@ -0,0 +1,53 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesapply; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
public class AdOfficeSuppliesApplyVo { |
|||
|
|||
private String sid; |
|||
/* private String userSid; |
|||
private String orgPath;*/ |
|||
private String orgSidPath; |
|||
private String createBySid; |
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remarks; |
|||
private List<FormCommon> list = new ArrayList<>(); |
|||
|
|||
private String taskId; |
|||
@ApiModelProperty("流程实例id") |
|||
private String procInsId; |
|||
|
|||
// private String testPage;
|
|||
} |
@ -0,0 +1,73 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesdetail; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetail.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetail <br/> |
|||
* Description: 驻外人员认定列表. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "办公用品领用列表", description = "办公用品领用列表") |
|||
@TableName("ad_office_supplies_detail") |
|||
public class AdOfficeSuppliesDetail extends BaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty("申请sid") |
|||
private String mainSid; // 申请sid
|
|||
@ApiModelProperty("物品基础信息Sid") |
|||
private String goodsSpuSid; // 物品基础信息Sid
|
|||
@ApiModelProperty("商品名称") |
|||
private String goodsSpuName; // 商品名称
|
|||
@ApiModelProperty("物品Skusid") |
|||
private String goodsSkuSid; // 物品Skusid
|
|||
@ApiModelProperty("规格型号") |
|||
private String goodsSkuOwnSpec; // 规格型号
|
|||
@ApiModelProperty("计量单位") |
|||
private String unit; // 计量单位
|
|||
@ApiModelProperty("数量") |
|||
private BigDecimal count; // 库存数量
|
|||
@ApiModelProperty("库存sid") |
|||
private String inventorySid; // 库存sid
|
|||
|
|||
|
|||
} |
@ -0,0 +1,70 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesdetail; |
|||
|
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetailDto.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetailDto <br/> |
|||
* Description: 驻外人员认定列表 数据传输对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定列表 数据传输对象", description = "驻外人员认定列表 数据传输对象") |
|||
public class AdOfficeSuppliesDetailDto implements Dto { |
|||
|
|||
@ApiModelProperty("驻外人员") |
|||
private FormCommon expatriatesObj; |
|||
private String expatriatesKey; |
|||
private String expatriatesValue; |
|||
@ApiModelProperty("驻外人员部门") |
|||
private FormCommon deptObj; |
|||
private String deptKey; |
|||
private String deptValue; |
|||
@ApiModelProperty("驻外人员职位") |
|||
private FormCommon jobObj; |
|||
private String jobKey; |
|||
private String jobValue; |
|||
@ApiModelProperty("驻外人员家庭常住地址") |
|||
private String expatriatesHomeAddress; |
|||
@ApiModelProperty("驻外人员工作地址") |
|||
private String expatriatesWorkAddress; |
|||
@ApiModelProperty("驻外人员开始驻外时间") |
|||
private String expatriatesDate; |
|||
} |
@ -0,0 +1,41 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesdetail; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface AdOfficeSuppliesDetailMapper extends BaseMapper<AdOfficeSuppliesDetail> { |
|||
|
|||
@Select("select * from ad_office_supplies_detail where mainSid = #{mainSid}") |
|||
List<AdOfficeSuppliesDetail> selectByMainSid(String mainSid); |
|||
|
|||
List<AdOfficeSuppliesDetailVo> getUpdateInit(String sid); |
|||
} |
@ -0,0 +1,9 @@ |
|||
<?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.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailMapper"> |
|||
<select id="getUpdateInit" resultType="com.yxt.anrui.oa.biz.adofficesuppliesdetail.AdOfficeSuppliesDetailVo"> |
|||
select * |
|||
from ad_office_supplies_detail |
|||
where mainSid = #{sid} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,87 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesdetail; |
|||
|
|||
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class AdOfficeSuppliesDetailService extends MybatisBaseService<AdOfficeSuppliesDetailMapper, AdOfficeSuppliesDetail> { |
|||
|
|||
public void saveDetails(List<FormCommon> list, String sid) { |
|||
//根据sid查询明细并删除
|
|||
List<AdOfficeSuppliesDetail> list2 = baseMapper.selectByMainSid(sid); |
|||
list2.removeAll(Collections.singleton(null)); |
|||
if (!list2.isEmpty()) { |
|||
list2.stream().forEach(v -> { |
|||
deleteBySid(v.getSid()); |
|||
}); |
|||
} |
|||
list.removeAll(Collections.singleton(null)); |
|||
if (!list.isEmpty()) { |
|||
list.stream().forEach(f -> { |
|||
AdOfficeSuppliesDetail detail = new AdOfficeSuppliesDetail(); |
|||
detail.setMainSid(sid); |
|||
detail.setInventorySid(f.getId()); |
|||
detail.setGoodsSpuName(f.getDictValue()); |
|||
if (null != f.getExtra()) { |
|||
Map<String, Object> e = f.getExtra(); |
|||
for (Map.Entry <String,Object> entry : e.entrySet()) { |
|||
if (StringUtils.isNotBlank((String)entry.getValue())) { |
|||
if (entry.getKey().equals("count")) { |
|||
detail.setCount(new BigDecimal((String)entry.getValue())); |
|||
} |
|||
if (entry.getKey().equals("goodsSkuOwnSpec")) { |
|||
detail.setGoodsSkuOwnSpec((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("goodsSkuSid")) { |
|||
detail.setGoodsSkuSid((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("goodsSpuSid")) { |
|||
detail.setGoodsSpuSid((String)entry.getValue()); |
|||
} |
|||
if (entry.getKey().equals("unit")) { |
|||
detail.setUnit((String)entry.getValue()); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
baseMapper.insert(detail); |
|||
}); |
|||
} |
|||
} |
|||
|
|||
public List<AdOfficeSuppliesDetailVo> getUpdateInit(String sid) { |
|||
return baseMapper.getUpdateInit(sid); |
|||
} |
|||
} |
@ -0,0 +1,67 @@ |
|||
/********************************************************* |
|||
********************************************************* |
|||
******************** ******************* |
|||
************* ************ |
|||
******* _oo0oo_ ******* |
|||
*** o8888888o *** |
|||
* 88" . "88 * |
|||
* (| -_- |) * |
|||
* 0\ = /0 * |
|||
* ___/`---'\___ * |
|||
* .' \\| |// '. *
|
|||
* / \\||| : |||// \ *
|
|||
* / _||||| -:- |||||- \ * |
|||
* | | \\\ - /// | | *
|
|||
* | \_| ''\---/'' |_/ | * |
|||
* \ .-\__ '-' ___/-. / * |
|||
* ___'. .' /--.--\ `. .'___ * |
|||
* ."" '< `.___\_<|>_/___.' >' "". * |
|||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|||
* `=---=' * |
|||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|||
*********************************************************/ |
|||
package com.yxt.anrui.oa.biz.adofficesuppliesdetail; |
|||
|
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* Project: yxt-oa(认定人员) <br/> |
|||
* File: AdExpatriatesDetailVo.java <br/> |
|||
* Class: com.yxt.anrui.oa.api.adexpatriatesdetail.AdExpatriatesDetailVo <br/> |
|||
* Description: 驻外人员认定列表 视图数据对象. <br/> |
|||
* Copyright: Copyright (c) 2011 <br/> |
|||
* Company: https://gitee.com/liuzp315 <br/>
|
|||
* Makedate: 2025-01-20 15:35:08 <br/> |
|||
* |
|||
* @author liupopo |
|||
* @version 1.0 |
|||
* @since 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel(value = "驻外人员认定列表 视图数据对象", description = "驻外人员认定列表 视图数据对象") |
|||
public class AdOfficeSuppliesDetailVo implements Vo { |
|||
|
|||
private String sid; |
|||
|
|||
@ApiModelProperty("物品基础信息Sid") |
|||
private String goodsSpuSid; // 物品基础信息Sid
|
|||
@ApiModelProperty("商品名称") |
|||
private String goodsSpuName; // 商品名称
|
|||
@ApiModelProperty("物品Skusid") |
|||
private String goodsSkuSid; // 物品Skusid
|
|||
@ApiModelProperty("规格型号") |
|||
private String goodsSkuOwnSpec; // 规格型号
|
|||
@ApiModelProperty("计量单位") |
|||
private String unit; // 计量单位
|
|||
@ApiModelProperty("库存数量") |
|||
private String count; // 库存数量
|
|||
@ApiModelProperty("库存sid") |
|||
private String inventorySid; // 库存sid
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.wms.biz.inventory.wmsinventory; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2025/1/16 |
|||
**/ |
|||
@Data |
|||
public class FormCommon { |
|||
|
|||
private String id; |
|||
private String dictValue; |
|||
|
|||
private Map<String, Object> extra; |
|||
|
|||
// 静态方法,直接通过方法创建对象并赋值
|
|||
public static FormCommon of(String id, String dictValue) { |
|||
FormCommon formCommon = new FormCommon(); |
|||
formCommon.setId(id); |
|||
formCommon.setDictValue(dictValue); |
|||
return formCommon; |
|||
} |
|||
} |
Loading…
Reference in new issue