Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin2/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtylerzhou committed Oct 20, 2024
2 parents 5a5e92e + c6ac74b commit 85adda8
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public void setConditionsResps(BpmnNodeConditionsConfBaseVo bpmnNodeConditionsCo
vo.setId(String.valueOf(i));
String name= "";
switch (i){
case 0:name="台式机";
case 1:name="台式机";
break;
case 1:name="笔记本";
case 2:name="笔记本";
break;
case 2:name="一体机";
case 3:name="一体机";
}
vo.setName(name);
vos.add(vo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,17 @@ public class OutSideBpmConditionsTemplateController {
public Result listPage(PageDto page, OutSideBpmConditionsTemplateVo vo) {
return Result.newSuccessResult(outSideBpmConditionsTemplateService.listPage(page, vo));
}

/**
* query template conf list by businessPartyMarkId and applicationId
*
* @param businessPartyId
* @param applicationId
* @return
*/
@GetMapping("/templateConf/selectListByPartMarkIdAndAppId/{businessPartyId}/{applicationId}")
public Result selectListByPartMarkIdAndAppId(@PathVariable("businessPartyId") Long businessPartyId,@PathVariable("applicationId") Integer applicationId) {
return Result.newSuccessResult(outSideBpmConditionsTemplateService.selectListByPartMark(businessPartyId, applicationId));
}
/**
* query a specified template conf's detail info
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.openoa.base.exception.JiMuBizException;
import org.openoa.base.util.PageUtils;
import org.openoa.base.util.SecurityUtils;
import org.openoa.base.util.StrUtils;
import org.openoa.base.vo.BaseIdTranStruVo;
import org.openoa.engine.vo.*;
import org.openoa.base.vo.ResultAndPage;
Expand Down Expand Up @@ -227,34 +228,33 @@ private List<BpmProcessAppApplicationVo> processAppDate(List<BpmProcessAppApplic
* add or modify applications that are icon applications
*/
public boolean addBpmProcessAppApplication(BpmProcessAppApplicationVo vo) {
if (vo.getProcessTypes()!=null) {
String[] passFilList = new String[]{"serialVersionUID", "isAll"};
BpmProcessAppApplication forVo = new BpmProcessAppApplication();
String route = StringEscapeUtils.unescapeHtml3(vo.getRoute());
vo.setRoute(route);
BeanUtils.copyProperties(vo, forVo, passFilList);
if (vo.getId()!=null) {
forVo.setEffectiveSource(vo.getEffectiveSource());
this.updateById(forVo);
} else {
forVo.setCreateTime(new Date());
forVo.setEffectiveSource(vo.getEffectiveSource());

// to check whether there is duplicate data
QueryWrapper<BpmProcessAppApplication> wrapper = new QueryWrapper<BpmProcessAppApplication>().eq("process_name", vo.getTitle()).eq("is_del", 0);
if (this.count(wrapper) > 0) {
throw new JiMuBizException( "该选项名称已存在");
}
this.save(forVo);
String[] passFilList = new String[]{"serialVersionUID", "isAll"};
BpmProcessAppApplication forVo = new BpmProcessAppApplication();
String route = StringEscapeUtils.unescapeHtml3(vo.getRoute());
vo.setRoute(route);
BeanUtils.copyProperties(vo, forVo, passFilList);
if (vo.getId() != null) {
forVo.setEffectiveSource(vo.getEffectiveSource());
this.updateById(forVo);
} else {
forVo.setCreateTime(new Date());
forVo.setEffectiveSource(vo.getEffectiveSource());
forVo.setProcessKey(vo.getBusinessCode() + "_" + StrUtils.getFirstLetters(vo.getTitle()));
// to check whether there is duplicate data
QueryWrapper<BpmProcessAppApplication> wrapper = new QueryWrapper<BpmProcessAppApplication>().eq("process_name", vo.getTitle()).eq("is_del", 0);
if (this.count(wrapper) > 0) {
throw new JiMuBizException("该选项名称已存在");
}
Serializable id = Optional.ofNullable(Optional.ofNullable(forVo).orElseGet(() -> {
return new BpmProcessAppApplication();
}).getId()).orElse((int) 0L);
bpmProcessApplicationTypeService.editProcessApplicationType(BpmProcessApplicationTypeVo.builder()
.applicationId(((Integer) id).longValue())
.processTypes(vo.getProcessTypes())
.build());
this.save(forVo);
}
// Serializable id = Optional.ofNullable(Optional.ofNullable(forVo).orElseGet(() -> {
// return new BpmProcessAppApplication();
// }).getId()).orElse((int) 0L);
// bpmProcessApplicationTypeService.editProcessApplicationType(BpmProcessApplicationTypeVo.builder()
// .applicationId(((Integer) id).longValue())
// .processTypes(vo.getProcessTypes())
// .build());

return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,31 +220,29 @@ public List<OutSideBpmConditionsTemplateVo> selectListByPartMark(String business
/**
* query condition template list by business party mark and application id
*
* @param businessPartyMark
* @param businessPartyMarkId
* @param applicationId
* @return
*/
public List<OutSideBpmConditionsTemplateVo> selectListByPartMark(String businessPartyMark, Integer applicationId) {

OutSideBpmBusinessParty outSideBpmBusinessParty = outSideBpmBusinessPartyService.getBaseMapper().selectOne(new QueryWrapper<OutSideBpmBusinessParty>()
.eq("business_party_mark", businessPartyMark));
public List<OutSideBpmConditionsTemplateVo> selectListByPartMark(Long businessPartyMarkId, Integer applicationId) {

if (outSideBpmBusinessParty!=null) {
List<OutSideBpmConditionsTemplate> outSideBpmConditionsTemplates = this.list(new QueryWrapper<OutSideBpmConditionsTemplate>()
.eq("is_del", 0)
.eq("business_party_id", outSideBpmBusinessParty.getId())
.eq("application_id", applicationId));
List<OutSideBpmConditionsTemplate> outSideBpmConditionsTemplates = this.list(new QueryWrapper<OutSideBpmConditionsTemplate>()
.eq("is_del", 0)
.eq("business_party_id",businessPartyMarkId)
.eq("application_id", applicationId));

if (!CollectionUtils.isEmpty(outSideBpmConditionsTemplates)) {
return outSideBpmConditionsTemplates
.stream()
.map(o -> OutSideBpmConditionsTemplateVo
.builder()
.id(o.getId())
.templateMark(o.getTemplateMark())
.templateName(o.getTemplateName())
.build())
.collect(Collectors.toList());
}
if (!CollectionUtils.isEmpty(outSideBpmConditionsTemplates)) {
return outSideBpmConditionsTemplates
.stream()
.map(o -> OutSideBpmConditionsTemplateVo
.builder()
.id(o.getId())
.templateMark(o.getTemplateMark())
.templateName(o.getTemplateName())
.remark(o.getRemark())
.createTime(o.getCreateTime())
.build())
.collect(Collectors.toList());
}
return Collections.EMPTY_LIST;
}
Expand Down Expand Up @@ -288,9 +286,9 @@ public OutSideBpmConditionsTemplateVo detail(Integer id) {
*/
public void edit(OutSideBpmConditionsTemplateVo vo) {

if (vo.getBusinessPartyId()==null) {
throw new JiMuBizException("业务方为空无法新建");
}
// if (vo.getBusinessPartyId()==null) {
// throw new JiMuBizException("业务方为空无法新建");
// }

if (StringUtil.isEmpty(vo.getApplicationFormCode())) {
throw new JiMuBizException("关联应用未选择,编辑失败");
Expand All @@ -303,11 +301,16 @@ public void edit(OutSideBpmConditionsTemplateVo vo) {
throw new JiMuBizException("");
}

OutSideBpmBusinessParty outSideBpmBusinessModel = Optional.ofNullable(outSideBpmBusinessPartyService.getBaseMapper().selectOne(new QueryWrapper<OutSideBpmBusinessParty>()
.eq("business_party_mark", application.getBusinessCode()))).orElse(new OutSideBpmBusinessParty());

if (outSideBpmBusinessModel.getId()==null) {
throw new JiMuBizException("业务方为空无法新建");
}
//check whether the template mark is repeated
QueryWrapper<OutSideBpmConditionsTemplate> wrapperTemplateMark = new QueryWrapper<OutSideBpmConditionsTemplate>()
.eq("is_del", 0)
.eq("business_party_id", vo.getBusinessPartyId())
.eq("business_party_id", outSideBpmBusinessModel.getId())
.eq("template_mark", vo.getTemplateMark())
.eq("application_id", application.getId());
if (vo.getId()!=null) {
Expand All @@ -321,7 +324,7 @@ public void edit(OutSideBpmConditionsTemplateVo vo) {
//check whether the template name is repeated,although the name can be repeated,but it may cause confusion,so make it not repeatable
QueryWrapper<OutSideBpmConditionsTemplate> wrapperTemplateName = new QueryWrapper<OutSideBpmConditionsTemplate>()
.eq("is_del", 0)
.eq("business_party_id", vo.getBusinessPartyId())
.eq("business_party_id", outSideBpmBusinessModel.getId())
.eq("template_name", vo.getTemplateName())
.eq("application_id", application.getId());
if (vo.getId()!=null) {
Expand All @@ -345,6 +348,8 @@ public void edit(OutSideBpmConditionsTemplateVo vo) {

outSideBpmConditionsTemplate = new OutSideBpmConditionsTemplate();
BeanUtils.copyProperties(vo, outSideBpmConditionsTemplate);
outSideBpmConditionsTemplate.setIsDel(0);
outSideBpmConditionsTemplate.setBusinessPartyId(outSideBpmBusinessModel.getId());
outSideBpmConditionsTemplate.setApplicationId(application.getId());
outSideBpmConditionsTemplate.setCreateUserId(SecurityUtils.getLogInEmpIdSafe());
outSideBpmConditionsTemplate.setCreateUser(SecurityUtils.getLogInEmpName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
public class BpmProcessAppApplicationVo implements Serializable {

private Integer id;
private Long businessPartyId;
/**
* business code,mainly for third party business,the central system's business code generally set to empty
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
<select id="newListPage" resultType="org.openoa.engine.vo.BpmProcessAppApplicationVo">
select
s.id as id,
p.name as businessName,
p.id as businessPartyId,
s.process_name as title,
s.business_code as businessCode,
s.apply_type as applyType,
Expand All @@ -77,6 +79,7 @@
s.create_user_id as createUserId,
s.create_time as createTime
from bpm_process_app_application s
left join t_out_side_bpm_business_party p on s.business_code = p.business_party_mark
where s.is_del=0
<!-- <if test="title!=null and title!=''">-->
<!-- and s.process_name like CONCAT('%', #{title},'%')-->
Expand All @@ -87,6 +90,7 @@
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
order by s.create_time desc
</select>

<!--list processICon by category-->
Expand Down

0 comments on commit 85adda8

Please sign in to comment.