add:页面
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.boge.common.publisher;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
public abstract class BaseEvent extends ApplicationEvent {
|
||||
|
||||
private final long timestamp;
|
||||
|
||||
public BaseEvent(Object source) {
|
||||
super(source);
|
||||
this.timestamp = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.boge.common.publisher;
|
||||
|
||||
import com.boge.modules.orderRecord.record.RecordEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
public abstract class EventConsumer<T extends BaseEvent> {
|
||||
|
||||
@Order(1)
|
||||
@EventListener
|
||||
public abstract void consumerEvents(T t);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.boge.common.publisher;
|
||||
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class EventPublisher {
|
||||
private final ApplicationEventPublisher eventPublisher;
|
||||
|
||||
public EventPublisher(ApplicationEventPublisher eventPublisher) {
|
||||
this.eventPublisher = eventPublisher;
|
||||
}
|
||||
|
||||
// 同步发布(立即执行)
|
||||
public void publishSync(BaseEvent event) {
|
||||
try {
|
||||
eventPublisher.publishEvent(event);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
// 批量发布
|
||||
public void publishBatch(List<BaseEvent> events) {
|
||||
events.forEach(
|
||||
baseEvent -> publishSync(baseEvent)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.boge.common.publisher;
|
||||
|
||||
public enum EventType {
|
||||
CREATE,
|
||||
RUNING,
|
||||
FINISH,
|
||||
Deprecated,
|
||||
;
|
||||
}
|
||||
29
base-fast/src/main/java/com/boge/common/utils/CodeUtil.java
Normal file
29
base-fast/src/main/java/com/boge/common/utils/CodeUtil.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.boge.common.utils;
|
||||
|
||||
import com.boge.modules.sys.coderule.ISysCodeRuleService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码工具类
|
||||
* </p>
|
||||
*
|
||||
* @author lyd
|
||||
* @since 2023-05-03
|
||||
*/
|
||||
@Service
|
||||
public class CodeUtil {
|
||||
|
||||
private static ISysCodeRuleService iSysCodeRuleService;
|
||||
|
||||
// 使用构造函数注入(推荐)
|
||||
public CodeUtil(ISysCodeRuleService sysCodeRuleService) {
|
||||
this.iSysCodeRuleService = sysCodeRuleService;
|
||||
}
|
||||
@SneakyThrows
|
||||
public static String getNewCode(String ruleCode){
|
||||
return iSysCodeRuleService.codeProduce(ruleCode,"1");
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class R extends HashMap<String, Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public R() {
|
||||
put("code", 0);
|
||||
put("code", 200);
|
||||
put("msg", "success");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
package com.boge.modules.contract.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.boge.common.publisher.EventPublisher;
|
||||
import com.boge.common.publisher.EventType;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.CodeUtil;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.client.entity.ClientQuery;
|
||||
import com.boge.modules.contract.dao.ContractDao;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.entity.ContractQuery;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import com.boge.modules.orderRecord.record.RecordEvent;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.enums.PriceApprovalEnum;
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import com.boge.modules.tickets.service.LocalStorageService;
|
||||
import lombok.val;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -28,6 +44,10 @@ import java.util.Map;
|
||||
public class ContractController {
|
||||
@Autowired
|
||||
private ContractService contractService;
|
||||
@Autowired
|
||||
private LocalStorageService localStorageService;
|
||||
@Autowired
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -55,9 +75,15 @@ public class ContractController {
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("flow:contract:save")
|
||||
public R save(@RequestBody ContractEntity contract){
|
||||
contractService.save(contract);
|
||||
|
||||
public R save(@RequestParam("form") String form, @RequestParam(value = "file",required = false) MultipartFile[] file){
|
||||
List<LocalStorage> batch = localStorageService.createBatch(file);
|
||||
ContractEntity entity = JSONObject.parseObject(form, ContractEntity.class);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreateName(ShiroUtils.getUserEntity().getUsername());
|
||||
entity.setAnnex(batch.stream().map(a->String.valueOf(a.getStorageId())).collect(Collectors.joining(",")));
|
||||
entity.setStatus(PriceApprovalEnum.ASSIGN.getCode());
|
||||
entity.setContractCode(CodeUtil.getNewCode("VEHICLE_CODE"));
|
||||
contractService.save(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -66,12 +92,22 @@ public class ContractController {
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("flow:contract:update")
|
||||
public R update(@RequestBody ContractEntity contract){
|
||||
contractService.updateById(contract);
|
||||
|
||||
public R update(@RequestParam("form") String form, @RequestParam(value = "file",required = false) MultipartFile[] file){
|
||||
List<LocalStorage> batch = localStorageService.createBatch(file);
|
||||
ContractEntity entity = JSONObject.parseObject(form, ContractEntity.class);
|
||||
List<String> collect = batch.stream().map(a -> String.valueOf(a.getStorageId())).collect(Collectors.toList());
|
||||
if (StringUtils.isNotEmpty(entity.getAnnex())){
|
||||
String[] split = entity.getAnnex().split(",");
|
||||
collect.addAll(Arrays.asList(split));
|
||||
}
|
||||
entity.setAnnex(collect.stream().collect(Collectors.joining(",")));
|
||||
entity.setUpdateTime(new Date());
|
||||
contractService.updateById(entity);
|
||||
eventPublisher.publishSync(new RecordEvent("销售合同",entity.getContractCode(), (JSONObject)JSONObject.toJSON(entity),"ContractEntity",entity.getAnnex(), EventType.CREATE));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
|
||||
@@ -4,8 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.contract.dto.ContractDto;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Synchronized;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import javax.transaction.Synchronization;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -20,6 +23,6 @@ public interface ContractDao extends BaseMapper<ContractEntity> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ContractDto selectDtlById(Integer id);
|
||||
ContractDto selectDtlById(Integer id);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -25,50 +26,116 @@ public class ContractEntity implements Serializable {
|
||||
@TableId
|
||||
private Integer contractId;
|
||||
/**
|
||||
* 合同类型
|
||||
* 1购销合同2服务合同'
|
||||
*/
|
||||
private Integer contractType;
|
||||
private String contractType;
|
||||
/**
|
||||
* 是否是主合同
|
||||
* 项目类型:agv/集成'
|
||||
*/
|
||||
private Integer isMaster;
|
||||
private String projectType;
|
||||
/**
|
||||
* 合同编号
|
||||
* 是否是主合同'
|
||||
*/
|
||||
private String contractNumber;
|
||||
private Boolean isMaster;
|
||||
/**
|
||||
* 客户id
|
||||
* 主合同id'
|
||||
*/
|
||||
private Long clientId;
|
||||
private Integer parentContract;
|
||||
/**
|
||||
* 物料信息
|
||||
* 合同编号'
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
private String totalPrice;
|
||||
/**
|
||||
* 客户id'
|
||||
*/
|
||||
private String clientId;
|
||||
/**
|
||||
* 物料信息'
|
||||
*/
|
||||
private String materialJson;
|
||||
/**
|
||||
/**
|
||||
* 报价单编码
|
||||
* 是否验收'
|
||||
*/
|
||||
private String fileNo;
|
||||
private String isAcceptance;
|
||||
/**
|
||||
* 是否验收
|
||||
*/
|
||||
private Integer isAcceptance;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建日期
|
||||
* 验收日期'
|
||||
*/
|
||||
private Date acceptanceTime;
|
||||
/**
|
||||
* 备注
|
||||
* 报价单id'
|
||||
*/
|
||||
private Integer priceId;
|
||||
/**
|
||||
* 合同生效日期
|
||||
*/
|
||||
private Date effectiveTime;
|
||||
/**
|
||||
* 创建日期'
|
||||
*/
|
||||
private Date createTime;
|
||||
private String CreateName;
|
||||
/**
|
||||
* 修改日期'
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 质量标准'
|
||||
*/
|
||||
private String qc;
|
||||
/**
|
||||
* 售后说明
|
||||
*/
|
||||
private String afterSales;
|
||||
/**
|
||||
* 交货期'
|
||||
*/
|
||||
private String delivery;
|
||||
/**
|
||||
* 交货地点'
|
||||
*/
|
||||
private String place;
|
||||
/**
|
||||
* 运输说明'
|
||||
*/
|
||||
private String transport;
|
||||
/**
|
||||
* 结算方式'
|
||||
*/
|
||||
private String pay;
|
||||
/**
|
||||
* 付款方式'
|
||||
*/
|
||||
private String payment;
|
||||
/**
|
||||
* 违约说明'
|
||||
*/
|
||||
private String breach;
|
||||
/**
|
||||
* 处理纠纷说明
|
||||
*/
|
||||
private String solveDispute;
|
||||
/**
|
||||
* 补充说明'
|
||||
*/
|
||||
private String supplement;
|
||||
/**
|
||||
* 包装说明
|
||||
*/
|
||||
private String packaging;
|
||||
/**
|
||||
* 附件说明
|
||||
*/
|
||||
private String annex;
|
||||
/**
|
||||
* 审核状态1待审核2审核完毕3.审核驳回'
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 备注'
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 文件id
|
||||
*/
|
||||
private String storageId;
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
package com.boge.modules.flow.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.flow.dto.FlowProcessParam;
|
||||
import com.boge.modules.flow.entity.ActHiProcessinfoEntity;
|
||||
import com.boge.modules.flow.entity.FlwDeModelEntity;
|
||||
import com.boge.modules.flow.entity.FlwHiTaskEntity;
|
||||
import com.boge.modules.flow.service.ActHiProcessinfoService;
|
||||
import com.boge.modules.flow.service.FlwInstanceService;
|
||||
import com.boge.modules.sys.entity.SysUserEntity;
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import com.boge.modules.tickets.service.LocalStorageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flw/instance")
|
||||
@@ -22,9 +32,10 @@ public class FlwInstanceController {
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FlwInstanceService instanceService;
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private LocalStorageService localStorageService;
|
||||
@Autowired
|
||||
private ActHiProcessinfoService actHiProcessinfoService;
|
||||
|
||||
/**
|
||||
* 我的待办
|
||||
@@ -60,12 +71,29 @@ public class FlwInstanceController {
|
||||
/**
|
||||
* 提交审批
|
||||
*/
|
||||
@PostMapping("/completeFlow")
|
||||
public R completeFlow(@RequestBody Map<String, Object> params){
|
||||
@PostMapping("/completeFlow2")
|
||||
public R completeFlow2(@RequestBody Map<String, Object> params){
|
||||
R r = instanceService.completeTaskById(params);
|
||||
return r;
|
||||
}
|
||||
|
||||
@RequestMapping("/completeFlow")
|
||||
public R completeFlow(@RequestParam("form") String form, @RequestParam(value = "file",required = false) MultipartFile[] file){;
|
||||
List<LocalStorage> batch = localStorageService.createBatch(file);
|
||||
List<String> collect = batch.stream().map(a -> String.valueOf(a.getStorageId())).collect(Collectors.toList());
|
||||
FlowProcessParam entity = JSONObject.parseObject(form, FlowProcessParam.class);
|
||||
entity.setAnnex(collect.stream().collect(Collectors.joining(",")));
|
||||
R r = instanceService.completeTaskById(entity);
|
||||
return r;
|
||||
}
|
||||
|
||||
@GetMapping("/flowProcessList")
|
||||
public R flowProcessList(@RequestParam("procInstId") String procInstId){;
|
||||
List<ActHiProcessinfoEntity> list = actHiProcessinfoService.list(new LambdaQueryWrapper<ActHiProcessinfoEntity>()
|
||||
.eq(ActHiProcessinfoEntity::getProcInstId, procInstId));
|
||||
return R.ok().put("processList", list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.boge.modules.flow.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.flow.entity.ActHiProcessinfoEntity;
|
||||
import com.boge.modules.flow.entity.FlwDeModelEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-01-09 13:56:25
|
||||
*/
|
||||
@Mapper
|
||||
public interface ActHiProcessinfoDao extends BaseMapper<ActHiProcessinfoEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.boge.modules.flow.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FlowProcessParam {
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
private String processInstance;
|
||||
/**
|
||||
* 共担Id
|
||||
*/
|
||||
private Integer ticketsId;
|
||||
/**
|
||||
* 结果
|
||||
*/
|
||||
private String result;
|
||||
/**
|
||||
* 指派人
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 审批备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 审批文件
|
||||
*/
|
||||
private String annex;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.boge.modules.flow.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-01-09 13:56:25
|
||||
*/
|
||||
@Data
|
||||
@TableName("act_hi_processinfo")
|
||||
public class ActHiProcessinfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 流程模型id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 流程模型的名称
|
||||
*/
|
||||
private String procInstId;
|
||||
/**
|
||||
* 流程模型的标识符
|
||||
*/
|
||||
private String procName;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String annex;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 最后更新人
|
||||
*/
|
||||
private String createName;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.boge.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.flow.entity.ActHiProcessinfoEntity;
|
||||
import com.boge.modules.flow.entity.FlwDeModelEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-01-09 13:56:25
|
||||
*/
|
||||
public interface ActHiProcessinfoService extends IService<ActHiProcessinfoEntity> {
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.boge.modules.flow.service;
|
||||
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.flow.dto.FlowProcessParam;
|
||||
import com.boge.modules.flow.entity.FlwHiTaskEntity;
|
||||
|
||||
import java.util.List;
|
||||
@@ -13,6 +14,7 @@ public interface FlwInstanceService {
|
||||
R getTodoTaskList(Map<String, Object> params);
|
||||
|
||||
R completeTaskById(Map<String, Object> id);
|
||||
R completeTaskById(FlowProcessParam param);
|
||||
|
||||
|
||||
void unclaimTask(String id);
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.boge.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.utils.FlowConstant;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
import com.boge.modules.flow.dao.ActHiProcessinfoDao;
|
||||
import com.boge.modules.flow.dao.FlwDeModelDao;
|
||||
import com.boge.modules.flow.entity.ActHiProcessinfoEntity;
|
||||
import com.boge.modules.flow.entity.FlwDeModelEntity;
|
||||
import com.boge.modules.flow.factory.FlowServiceFactory;
|
||||
import com.boge.modules.flow.service.ActHiProcessinfoService;
|
||||
import com.boge.modules.flow.service.FlwDeModelService;
|
||||
import com.boge.modules.orderRecord.record.dao.PmOrderRecordDao;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
public class ActHiProcessinfoImpl extends ServiceImpl<ActHiProcessinfoDao, ActHiProcessinfoEntity> implements ActHiProcessinfoService {
|
||||
}
|
||||
@@ -9,10 +9,13 @@ import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.flow.config.CustomProcessDiagramGenerator;
|
||||
import com.boge.modules.flow.dto.FlowProcessParam;
|
||||
import com.boge.modules.flow.entity.ActHiProcessinfoEntity;
|
||||
import com.boge.modules.flow.entity.FlwHiTaskEntity;
|
||||
import com.boge.modules.flow.entity.FlwMyFlowEntity;
|
||||
import com.boge.modules.flow.entity.FlwTaskEntity;
|
||||
import com.boge.modules.flow.factory.FlowServiceNoFactory;
|
||||
import com.boge.modules.flow.service.ActHiProcessinfoService;
|
||||
import com.boge.modules.flow.service.FlwInstanceService;
|
||||
import com.boge.modules.sys.entity.SysUserEntity;
|
||||
import com.boge.modules.sys.service.SysRoleService;
|
||||
@@ -43,6 +46,7 @@ import org.flowable.task.api.history.HistoricTaskInstance;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@@ -60,15 +64,12 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
|
||||
@Autowired
|
||||
private SysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private SysRoleService roleService;
|
||||
@Autowired
|
||||
private SysUserServiceImpl sysUserService;
|
||||
|
||||
@Autowired
|
||||
private TicketsService ticketsService;
|
||||
|
||||
@Autowired
|
||||
private ActHiProcessinfoService actHiProcessinfoService;
|
||||
@Value("${ProcessInstance.defId}")
|
||||
private String defId;
|
||||
@Autowired
|
||||
@@ -340,6 +341,7 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
Integer ticketsId = (Integer) params.get("ticketsId");
|
||||
String result = (String) params.get("result");
|
||||
String opinion = (String) params.get("opinion");
|
||||
String processName = ticketsDao.selectByProcessInstance(processInstance);
|
||||
|
||||
if (StringUtils.isBlank(processInstance)) {
|
||||
return R.error("流程Id不能为空");
|
||||
@@ -366,7 +368,6 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
ticketsEntity.setAssignUserId(TicketUserEnums.MANAGER.getCode());
|
||||
taskService.complete(secondTask.getId(), secondApprovalVars);
|
||||
}
|
||||
|
||||
// 指派处理人
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("指派")) {
|
||||
String userId = String.valueOf(params.get("userId"));
|
||||
@@ -375,14 +376,11 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
ticketsEntity.setAssignUserId(Long.valueOf(userId));
|
||||
taskService.complete(secondTask.getId(), startVars);
|
||||
}
|
||||
|
||||
// 继续流程
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("提交")) {
|
||||
ticketsEntity.setAssignUserId(TicketUserEnums.SPECIALIST.getCode());
|
||||
taskService.complete(secondTask.getId(), secondApprovalVars);
|
||||
}
|
||||
|
||||
String processName = ticketsDao.selectByProcessInstance(processInstance);
|
||||
if (StringUtils.isNotBlank(processName)&& processName.contains("完结")){
|
||||
ticketsEntity.setStatus(TicketsStatusEnums.FINISH.getCode());
|
||||
}
|
||||
@@ -394,6 +392,70 @@ public class FlwInstanceServiceImpl extends FlowServiceNoFactory implements FlwI
|
||||
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
@Override
|
||||
@Transactional
|
||||
public R completeTaskById(FlowProcessParam params) {
|
||||
String processInstance = params.getProcessInstance();
|
||||
Integer ticketsId = params.getTicketsId();
|
||||
String result = params.getResult();
|
||||
String processName = ticketsDao.selectByProcessInstance(processInstance);
|
||||
String username = ShiroUtils.getUserEntity().getUsername();
|
||||
if (StringUtils.isBlank(processInstance)) {
|
||||
return R.error("流程Id不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(processInstance)) {
|
||||
return R.error("流程Id不能为空");
|
||||
}
|
||||
Task secondTask = taskService.createTaskQuery()
|
||||
.processInstanceId(processInstance)
|
||||
.singleResult();
|
||||
Map<String, Object> secondApprovalVars = new HashMap<>();
|
||||
TicketsEntity ticketsEntity = new TicketsEntity();
|
||||
// 完结流程
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("完结")) {
|
||||
secondApprovalVars.put("approvalResult", true);
|
||||
ticketsEntity.setStatus(TicketsStatusEnums.FINISH.getCode());
|
||||
ticketsEntity.setFinishTime(new Date());
|
||||
ticketsEntity.setAssignUserId(TicketUserEnums.SPECIALIST.getCode());
|
||||
taskService.complete(secondTask.getId(), secondApprovalVars);
|
||||
}
|
||||
// 继续流程
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("同意")) {
|
||||
secondApprovalVars.put("approvalResult", false);
|
||||
ticketsEntity.setAssignUserId(TicketUserEnums.MANAGER.getCode());
|
||||
taskService.complete(secondTask.getId(), secondApprovalVars);
|
||||
}
|
||||
// 指派处理人
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("指派")) {
|
||||
String userId = params.getUserId();
|
||||
Map<String, Object> startVars = new HashMap<>();
|
||||
startVars.put("user1",userId);
|
||||
ticketsEntity.setAssignUserId(Long.valueOf(userId));
|
||||
taskService.complete(secondTask.getId(), startVars);
|
||||
}
|
||||
// 继续流程
|
||||
if (Objects.nonNull(secondTask) && StrUtil.isNotEmpty(result) && result.equals("提交")) {
|
||||
ticketsEntity.setAssignUserId(TicketUserEnums.SPECIALIST.getCode());
|
||||
taskService.complete(secondTask.getId(), secondApprovalVars);
|
||||
}
|
||||
if (StringUtils.isNotBlank(processName)&& processName.contains("完结")){
|
||||
ticketsEntity.setStatus(TicketsStatusEnums.FINISH.getCode());
|
||||
}
|
||||
|
||||
//更新工单审批id
|
||||
ticketsEntity.setTicketsId(Long.valueOf(ticketsId));
|
||||
ticketsEntity.setUpdateTime(new Date());
|
||||
ticketsService.updateById(ticketsEntity);
|
||||
ActHiProcessinfoEntity actHiProcessinfoEntity = new ActHiProcessinfoEntity();
|
||||
actHiProcessinfoEntity.setAnnex(params.getAnnex());
|
||||
actHiProcessinfoEntity.setRemark(params.getRemark());
|
||||
actHiProcessinfoEntity.setProcInstId(processInstance);
|
||||
actHiProcessinfoEntity.setProcName(processName);
|
||||
actHiProcessinfoEntity.setCreateTime(new Date());
|
||||
actHiProcessinfoEntity.setCreateName(username);
|
||||
actHiProcessinfoService.save(actHiProcessinfoEntity);
|
||||
return R.ok("操作成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.boge.modules.media.controller;
|
||||
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.service.PriceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("flow/media")
|
||||
public class SysMediaController {
|
||||
@Autowired
|
||||
private PriceService priceService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
PageUtils page = priceService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
*/
|
||||
@RequestMapping("/info/{priceId}")
|
||||
//@RequiresPermissions("flow:contract:info")
|
||||
public R info(@PathVariable("priceId") Integer priceId){
|
||||
PriceEntity contract = priceService.getById(priceId);
|
||||
return R.ok().put("price", contract);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("flow:contract:save")
|
||||
public R save(@RequestBody PriceEntity priceEntity){
|
||||
priceService.save(priceEntity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("flow:contract:update")
|
||||
public R update(@RequestBody PriceEntity priceEntity){
|
||||
priceService.updateById(priceEntity);
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
//@RequiresPermissions("flow:contract:delete")
|
||||
public R delete(@RequestBody Integer[] priceIds){
|
||||
priceService.removeByIds(Arrays.asList(priceIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.boge.modules.media.file.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.media.file.entity.SysMediaEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysMediaDao extends BaseMapper<SysMediaEntity> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.boge.modules.media.file.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_media")
|
||||
public class SysMediaEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 文件名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 格式
|
||||
*/
|
||||
private String format;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
private String path;
|
||||
/**
|
||||
* 报价人
|
||||
*/
|
||||
private Integer size;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createName;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.boge.modules.media.file.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.modules.media.file.entity.SysMediaEntity;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
public interface SysMediaService extends IService<SysMediaEntity> {
|
||||
|
||||
File create(String path, MultipartFile multipartFile);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.boge.modules.media.file.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.Query;
|
||||
import com.boge.modules.media.file.dao.SysMediaDao;
|
||||
import com.boge.modules.media.file.entity.SysMediaEntity;
|
||||
import com.boge.modules.media.file.service.SysMediaService;
|
||||
import com.boge.modules.price.dao.PriceDao;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
public class SysMediaServiceImpl extends ServiceImpl<SysMediaDao, SysMediaEntity> implements SysMediaService {
|
||||
|
||||
|
||||
@Override
|
||||
public File create(String path, MultipartFile multipartFile) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.boge.modules.orderRecord.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import com.boge.modules.orderRecord.record.service.PmOrderRecordService;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.service.PriceService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("flow/orderRecord")
|
||||
public class OrderRecordController {
|
||||
@Autowired
|
||||
private PmOrderRecordService pmOrderRecordService;
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
//@RequiresPermissions("flow:contract:list")
|
||||
public R list(@RequestParam("orderCode") String orderCode){
|
||||
List<PmOrderRecord> list = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(orderCode)){
|
||||
list = pmOrderRecordService.list(new LambdaQueryWrapper<PmOrderRecord>().eq(PmOrderRecord::getOrderCode, orderCode));
|
||||
}
|
||||
return R.ok().put("orderRecord", list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.boge.modules.orderRecord.record;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.boge.common.publisher.BaseEvent;
|
||||
import com.boge.common.publisher.EventType;
|
||||
import lombok.Data;
|
||||
|
||||
public class RecordEvent extends BaseEvent {
|
||||
|
||||
private String orderName;
|
||||
private String orderCode;
|
||||
private String data;
|
||||
private String mapperDao;
|
||||
private String annex;
|
||||
private EventType eventType;
|
||||
|
||||
|
||||
public RecordEvent(String orderName,String orderCode, JSONObject data, String mapperDao, String annex,EventType type) {
|
||||
super(data);
|
||||
this.orderName = orderName;
|
||||
this.orderCode = orderCode;
|
||||
this.data = JSONObject.toJSONString(data);
|
||||
this.mapperDao = mapperDao;
|
||||
this.annex = annex;
|
||||
this.eventType = type;
|
||||
}
|
||||
|
||||
public String getOrderName() {
|
||||
return orderName;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public String getMapperDao() {
|
||||
return mapperDao;
|
||||
}
|
||||
|
||||
public String getAnnex() {
|
||||
return annex;
|
||||
}
|
||||
|
||||
public EventType getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
|
||||
public String getOrderCode() {
|
||||
return orderCode;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.boge.modules.orderRecord.record;
|
||||
|
||||
import com.boge.common.publisher.EventConsumer;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import com.boge.modules.orderRecord.record.service.PmOrderRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class RecordEventConsumer extends EventConsumer<RecordEvent> {
|
||||
@Autowired
|
||||
private PmOrderRecordService pmOrderRecordService;
|
||||
|
||||
@Override
|
||||
public void consumerEvents(RecordEvent recordEvent) {
|
||||
System.out.println("触发消费RecordEvent"+recordEvent.getOrderName());
|
||||
switch (recordEvent.getEventType()){
|
||||
case CREATE:
|
||||
PmOrderRecord record = new PmOrderRecord();
|
||||
record.setOrderName(recordEvent.getOrderName());
|
||||
record.setOrderCode(recordEvent.getOrderCode());
|
||||
record.setMapperDao(recordEvent.getMapperDao());
|
||||
record.setData(recordEvent.getData());
|
||||
record.setAnnex(recordEvent.getAnnex());
|
||||
record.setCreateTime(new Date());
|
||||
record.setOrderName(recordEvent.getOrderName());
|
||||
pmOrderRecordService.save(record);
|
||||
break;
|
||||
case FINISH:
|
||||
break;
|
||||
case RUNING:
|
||||
break;
|
||||
case Deprecated:
|
||||
break;
|
||||
default:
|
||||
System.out.println("未定义事件类型");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.boge.modules.orderRecord.record.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Mapper
|
||||
public interface PmOrderRecordDao extends BaseMapper<PmOrderRecord> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.boge.modules.orderRecord.record.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
@Data
|
||||
@TableName("pm_order_record")
|
||||
public class PmOrderRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 单子类型名称
|
||||
*/
|
||||
private String orderName;
|
||||
private String orderCode;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* 映射对象
|
||||
*/
|
||||
private String mapperDao;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
private String annex;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.boge.modules.orderRecord.record.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author ls
|
||||
* @email dengpbs@163.com
|
||||
* @date 2025-02-26 19:33:35
|
||||
*/
|
||||
public interface PmOrderRecordService extends IService<PmOrderRecord> {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.boge.modules.orderRecord.record.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.modules.orderRecord.record.dao.PmOrderRecordDao;
|
||||
import com.boge.modules.orderRecord.record.entity.PmOrderRecord;
|
||||
import com.boge.modules.orderRecord.record.service.PmOrderRecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
@Service
|
||||
public class PmOrderRecordServiceImpl extends ServiceImpl<PmOrderRecordDao, PmOrderRecord> implements PmOrderRecordService {
|
||||
|
||||
|
||||
}
|
||||
@@ -1,15 +1,31 @@
|
||||
package com.boge.modules.price.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.boge.common.publisher.EventPublisher;
|
||||
import com.boge.common.publisher.EventType;
|
||||
import com.boge.common.utils.CodeUtil;
|
||||
import com.boge.common.utils.PageUtils;
|
||||
import com.boge.common.utils.R;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.orderRecord.record.RecordEvent;
|
||||
import com.boge.modules.orderRecord.record.service.PmOrderRecordService;
|
||||
import com.boge.modules.price.entity.PriceDto;
|
||||
import com.boge.modules.price.entity.PriceEntity;
|
||||
import com.boge.modules.price.enums.PriceApprovalEnum;
|
||||
import com.boge.modules.price.service.PriceService;
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import com.boge.modules.tickets.service.LocalStorageService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,6 +40,10 @@ import java.util.Map;
|
||||
public class PriceController {
|
||||
@Autowired
|
||||
private PriceService priceService;
|
||||
@Autowired
|
||||
private LocalStorageService localStorageService;
|
||||
@Autowired
|
||||
private EventPublisher eventPublisher;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -52,8 +72,15 @@ public class PriceController {
|
||||
*/
|
||||
@RequestMapping("/save")
|
||||
//@RequiresPermissions("flow:contract:save")
|
||||
public R save(@RequestBody PriceEntity priceEntity){
|
||||
priceService.save(priceEntity);
|
||||
public R save(@RequestParam("form") String form, @RequestParam(value = "file",required = false) MultipartFile[] file){
|
||||
List<LocalStorage> batch = localStorageService.createBatch(file);
|
||||
PriceEntity entity = JSONObject.parseObject(form, PriceEntity.class);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreateName(ShiroUtils.getUserEntity().getUsername());
|
||||
entity.setAnnex(batch.stream().map(a->String.valueOf(a.getStorageId())).collect(Collectors.joining(",")));
|
||||
entity.setStatus(PriceApprovalEnum.ASSIGN.getCode());
|
||||
entity.setFileNo(CodeUtil.getNewCode("VEHICLE_CODE"));
|
||||
priceService.save(entity);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -61,10 +88,18 @@ public class PriceController {
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
//@RequiresPermissions("flow:contract:update")
|
||||
public R update(@RequestBody PriceEntity priceEntity){
|
||||
priceService.updateById(priceEntity);
|
||||
|
||||
public R update(@RequestParam("form") String form, @RequestParam(value = "file",required = false) MultipartFile[] file){
|
||||
List<LocalStorage> batch = localStorageService.createBatch(file);
|
||||
PriceEntity entity = JSONObject.parseObject(form, PriceEntity.class);
|
||||
List<String> collect = batch.stream().map(a -> String.valueOf(a.getStorageId())).collect(Collectors.toList());
|
||||
if (StringUtils.isNotEmpty(entity.getAnnex())){
|
||||
String[] split = entity.getAnnex().split(",");
|
||||
collect.addAll(Arrays.asList(split));
|
||||
}
|
||||
entity.setAnnex(collect.stream().collect(Collectors.joining(",")));
|
||||
entity.setUpdateTime(new Date());
|
||||
priceService.updateById(entity);
|
||||
eventPublisher.publishSync(new RecordEvent("报价单",entity.getFileNo(), (JSONObject)JSONObject.toJSON(entity),"PriceEntity",entity.getAnnex(), EventType.CREATE));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -75,7 +110,6 @@ public class PriceController {
|
||||
//@RequiresPermissions("flow:contract:delete")
|
||||
public R delete(@RequestBody Integer[] priceIds){
|
||||
priceService.removeByIds(Arrays.asList(priceIds));
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.boge.modules.price.entity;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import liquibase.pro.packaged.J;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class PriceDto {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Integer priceId;
|
||||
/**
|
||||
* 报价单类型
|
||||
*/
|
||||
private Integer priceType;
|
||||
/**
|
||||
* 报价单编号
|
||||
*/
|
||||
private String fileNo;
|
||||
/**
|
||||
* 报价人
|
||||
*/
|
||||
private String quoter;
|
||||
/**
|
||||
* 发货方信息
|
||||
*/
|
||||
private String fattn;
|
||||
private String fmobile;
|
||||
private String finc;
|
||||
private String fadd;
|
||||
private String ftel;
|
||||
/**
|
||||
* 收货方信息
|
||||
*/
|
||||
private String tattn;
|
||||
private String tmobile;
|
||||
private String tinc;
|
||||
private String tadd;
|
||||
private String ttel;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private String materialJson;
|
||||
|
||||
/**
|
||||
* 总金额
|
||||
*/
|
||||
private String totalPrice;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
private String status;
|
||||
/**
|
||||
* 物料信息
|
||||
*/
|
||||
private JSONArray materData;
|
||||
}
|
||||
@@ -67,6 +67,10 @@ public class PriceEntity implements Serializable {
|
||||
* 创建日期
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createName;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@@ -76,6 +80,30 @@ public class PriceEntity implements Serializable {
|
||||
*/
|
||||
private String remarks;
|
||||
private String status;
|
||||
/**
|
||||
* 附件ids
|
||||
*/
|
||||
private String annex;
|
||||
|
||||
/**
|
||||
* 生效日期
|
||||
*/
|
||||
private Date effective;
|
||||
/**
|
||||
* 交货期说明
|
||||
*/
|
||||
private String delivery;
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String place;
|
||||
/**
|
||||
* 报价有效期
|
||||
*/
|
||||
private String valid;
|
||||
/**
|
||||
* 支付说明
|
||||
*/
|
||||
private String pay;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.boge.modules.price.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PriceApprovalEnum {
|
||||
|
||||
ASSIGN("1", "发起"),
|
||||
TO_BE_DONE("2", "待办"),
|
||||
FINISH("3", "已完成");
|
||||
|
||||
private String code;
|
||||
private String msg;
|
||||
|
||||
public static String getStatus(String code) {
|
||||
for (PriceApprovalEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value.msg;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.boge.modules.sys.coderule;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRuleDetail;
|
||||
import com.boge.modules.sys.coderule.dto.CodeRuleDetailQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则明细表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
public interface ISysCodeRuleDetailService extends IService<SysCodeRuleDetail> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param form 查询条件
|
||||
* @param pageable 工具列
|
||||
* @return IPage<SysCodeRuleDetail>
|
||||
*/
|
||||
IPage<SysCodeRuleDetail> queryAll(CodeRuleDetailQuery form, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param codeRuleDetail 实体类
|
||||
*/
|
||||
void create(SysCodeRuleDetail codeRuleDetail);
|
||||
|
||||
/**
|
||||
* 根据id删除
|
||||
* @param id
|
||||
*/
|
||||
void delete(String id);
|
||||
|
||||
/**
|
||||
* 修改明细
|
||||
* @param json
|
||||
*/
|
||||
void update(SysCodeRuleDetail json);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.boge.modules.sys.coderule;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRule;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
public interface ISysCodeRuleService extends IService<SysCodeRule> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param form
|
||||
* @param pageable
|
||||
* @return
|
||||
*/
|
||||
IPage<SysCodeRule> queryAll(Map form, PageQuery pageable);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param codeRule
|
||||
*/
|
||||
void create(SysCodeRule codeRule);
|
||||
|
||||
/**
|
||||
* 删除编码
|
||||
* @param ids
|
||||
*/
|
||||
void deleteCodeRule(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 修改编码
|
||||
* @param codeRule
|
||||
*/
|
||||
void updateCodeRule(SysCodeRule codeRule);
|
||||
|
||||
|
||||
String codeProduce(String code,String flag);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.boge.modules.sys.coderule.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_code_rule")
|
||||
public class SysCodeRule implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 标识
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 当前值
|
||||
*/
|
||||
private String currentValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String isActive;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String isDelete;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 修改id
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String demo;
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.boge.modules.sys.coderule.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则明细表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_code_rule_detail")
|
||||
public class SysCodeRuleDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 明细标识
|
||||
*/
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 编码规则类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 初始值
|
||||
*/
|
||||
private String initValue;
|
||||
|
||||
/**
|
||||
* 当前值
|
||||
*/
|
||||
private String currentValue;
|
||||
|
||||
/**
|
||||
* 允许最大值
|
||||
*/
|
||||
private String maxValue;
|
||||
|
||||
/**
|
||||
* 步长
|
||||
*/
|
||||
private String step;
|
||||
|
||||
/**
|
||||
* 填充值
|
||||
*/
|
||||
private String fillchar;
|
||||
|
||||
/**
|
||||
* 格式
|
||||
*/
|
||||
private String format;
|
||||
|
||||
/**
|
||||
* 长度
|
||||
*/
|
||||
private Integer length;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private BigDecimal sortNum;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 编码规则标识
|
||||
*/
|
||||
private String codeRuleId;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String isActive;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String isDelete;
|
||||
|
||||
/**
|
||||
* 创建id
|
||||
*/
|
||||
private String createId;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private String createName;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 修改id
|
||||
*/
|
||||
private String updateId;
|
||||
|
||||
/**
|
||||
* 修改者
|
||||
*/
|
||||
private String updateName;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String updateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String dictName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.boge.modules.sys.coderule.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRuleDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则明细表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysCodeRuleDetailMapper extends BaseMapper<SysCodeRuleDetail> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.boge.modules.sys.coderule.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRule;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysCodeRuleMapper extends BaseMapper<SysCodeRule> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.boge.modules.sys.coderule.dto;
|
||||
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRuleDetail;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2022/12/20
|
||||
*/
|
||||
@Data
|
||||
public class CodeRuleDetailQuery extends BaseQuery<SysCodeRuleDetail> {
|
||||
String id;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
this.doP.put("id", QParam.builder().k(new String[]{"code_rule_id"}).type(QueryTEnum.EQ).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.boge.modules.sys.coderule.dto;
|
||||
|
||||
|
||||
import com.boge.common.query.BaseQuery;
|
||||
import com.boge.common.query.QParam;
|
||||
import com.boge.common.query.QueryTEnum;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRule;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description:
|
||||
* @Date: 2022/12/19
|
||||
*/
|
||||
public class CodeRuleQuery extends BaseQuery<SysCodeRule> {
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
this.doP.put("blurry", QParam.builder().k(new String[]{"code", "name"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.boge.modules.sys.coderule.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 编码类型枚举
|
||||
* @Date: 2022/12/19
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CodeRuleTypeEnum {
|
||||
// 固定
|
||||
FIXED("01", "固定"),
|
||||
// 日期"
|
||||
DATE("02", "日期"),
|
||||
// 顺序
|
||||
ORDER("03", "顺序");
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.boge.modules.sys.coderule.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.sys.coderule.ISysCodeRuleDetailService;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRuleDetail;
|
||||
import com.boge.modules.sys.coderule.dao.mapper.SysCodeRuleDetailMapper;
|
||||
import com.boge.modules.sys.coderule.dto.CodeRuleDetailQuery;
|
||||
import com.boge.modules.sys.coderule.enums.CodeRuleTypeEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则明细表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-20
|
||||
*/
|
||||
@Service
|
||||
public class SysCodeRuleDetailServiceImpl extends ServiceImpl<SysCodeRuleDetailMapper, SysCodeRuleDetail> implements ISysCodeRuleDetailService {
|
||||
|
||||
@Override
|
||||
public IPage<SysCodeRuleDetail> queryAll(CodeRuleDetailQuery form, PageQuery page) {
|
||||
LambdaQueryWrapper<SysCodeRuleDetail> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(SysCodeRuleDetail::getCodeRuleId, form.getId())
|
||||
.orderByAsc(SysCodeRuleDetail::getSortNum);
|
||||
IPage<SysCodeRuleDetail> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
this.baseMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SysCodeRuleDetail codeRuleDetail) {
|
||||
String currentUserId = String.valueOf(ShiroUtils.getUserEntity().getCreateUserId());
|
||||
String currentNickName = ShiroUtils.getUserEntity().getUsername();
|
||||
String now = DateUtil.now();
|
||||
codeRuleDetail.setId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeRuleDetail.setCurrentValue(codeRuleDetail.getInitValue());
|
||||
codeRuleDetail.setCreateId(currentUserId);
|
||||
codeRuleDetail.setCreateName(currentNickName);
|
||||
codeRuleDetail.setCreateTime(now);
|
||||
codeRuleDetail.setUpdateId(currentUserId);
|
||||
codeRuleDetail.setUpdateName(currentNickName);
|
||||
codeRuleDetail.setUpdateTime(now);
|
||||
if (codeRuleDetail.getType().equals(CodeRuleTypeEnum.DATE.getType())) {
|
||||
Date date = DateUtil.date();
|
||||
String format = codeRuleDetail.getFormat();
|
||||
String nowDate = DateUtil.format(date, format);
|
||||
codeRuleDetail.setInitValue(nowDate);
|
||||
codeRuleDetail.setCurrentValue(nowDate);
|
||||
}
|
||||
this.baseMapper.insert(codeRuleDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String id) {
|
||||
this.baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(SysCodeRuleDetail json) {
|
||||
this.baseMapper.updateById(json);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
package com.boge.modules.sys.coderule.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.query.PageQuery;
|
||||
import com.boge.common.utils.ShiroUtils;
|
||||
import com.boge.modules.sys.coderule.ISysCodeRuleDetailService;
|
||||
import com.boge.modules.sys.coderule.ISysCodeRuleService;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRule;
|
||||
import com.boge.modules.sys.coderule.dao.SysCodeRuleDetail;
|
||||
import com.boge.modules.sys.coderule.dao.mapper.SysCodeRuleMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 编码规则表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2022-12-19
|
||||
*/
|
||||
@Service
|
||||
public class SysCodeRuleServiceImpl extends ServiceImpl<SysCodeRuleMapper, SysCodeRule> implements ISysCodeRuleService {
|
||||
|
||||
@Autowired
|
||||
private ISysCodeRuleDetailService iSysCodeRuleDetailService;
|
||||
|
||||
@Override
|
||||
public IPage<SysCodeRule> queryAll(Map form, PageQuery pageable) {
|
||||
String blurry = ObjectUtil.isNotEmpty(form.get("blurry"))?form.get("blurry").toString():null;
|
||||
LambdaQueryWrapper<SysCodeRule> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), SysCodeRule::getCode, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry))
|
||||
.like(ObjectUtil.isNotEmpty(blurry), SysCodeRule::getName, blurry);
|
||||
IPage<SysCodeRule> page = new Page<>(pageable.getPage() + 1, pageable.getSize());
|
||||
this.baseMapper.selectPage(page, lam);
|
||||
page.getRecords().forEach(sysCodeRule -> sysCodeRule.setDemo(codeProduce(sysCodeRule.getCode(),"0")));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(SysCodeRule codeRule) {
|
||||
String currentUserId = String.valueOf(ShiroUtils.getUserEntity().getCreateUserId());
|
||||
String currentUsername = ShiroUtils.getUserEntity().getUsername();
|
||||
String now = DateUtil.now();
|
||||
List<SysCodeRule> sysCodeRules = this.baseMapper.selectList(new LambdaQueryWrapper<SysCodeRule>().eq(SysCodeRule::getCode, codeRule.getCode()));
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new RuntimeException("参数不存在");
|
||||
codeRule.setId(IdUtil.getSnowflake(1,1).nextIdStr());
|
||||
codeRule.setCreateId(currentUserId);
|
||||
codeRule.setCreateName(currentUsername);
|
||||
codeRule.setCreateTime(now);
|
||||
codeRule.setUpdateId(currentUserId);
|
||||
codeRule.setUpdateName(currentUsername);
|
||||
codeRule.setUpdateTime(now);
|
||||
this.baseMapper.insert(codeRule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCodeRule(Set<String> ids) {
|
||||
ids.forEach(id -> {
|
||||
this.baseMapper.deleteById(id);
|
||||
iSysCodeRuleDetailService.remove(new LambdaQueryWrapper<SysCodeRuleDetail>().eq(SysCodeRuleDetail::getCodeRuleId, id));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCodeRule(SysCodeRule codeRule) {
|
||||
List<SysCodeRule> sysCodeRules = this.baseMapper.selectList(new LambdaQueryWrapper<SysCodeRule>()
|
||||
.eq(SysCodeRule::getCode, codeRule.getCode())
|
||||
.ne(SysCodeRule::getId, codeRule.getId()));
|
||||
if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new RuntimeException("参数不存在");
|
||||
String currentUserId = String.valueOf(ShiroUtils.getUserEntity().getCreateUserId());
|
||||
String currentUsername = ShiroUtils.getUserEntity().getUsername();
|
||||
String now = DateUtil.now();
|
||||
codeRule.setUpdateId(currentUserId);
|
||||
codeRule.setUpdateName(currentUsername);
|
||||
codeRule.setUpdateTime(now);
|
||||
this.baseMapper.updateById(codeRule);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public String codeProduce(String code,String flag) {
|
||||
SysCodeRule one = this.getOne(new LambdaQueryWrapper<SysCodeRule>()
|
||||
.eq(SysCodeRule::getCode, code).select(SysCodeRule::getId));
|
||||
List<SysCodeRuleDetail> dtl = iSysCodeRuleDetailService.list(new LambdaQueryWrapper<SysCodeRuleDetail>()
|
||||
.eq(SysCodeRuleDetail::getCodeRuleId, one.getId()).last("order by sort_num FOR UPDATE"));
|
||||
String demo = "";
|
||||
boolean is_same = true;
|
||||
for (SysCodeRuleDetail detail : dtl) {
|
||||
String value = "";
|
||||
//固定直接取值
|
||||
if (detail.getType().equals("01")) {
|
||||
value = detail.getInitValue();
|
||||
}
|
||||
//日期判断数据库的值与当前值是否相同来决定顺序的值
|
||||
if (detail.getType().equals("02")) {
|
||||
String current_value = detail.getCurrentValue();
|
||||
Date date = DateUtil.date();
|
||||
String format = detail.getFormat();
|
||||
String now_date = DateUtil.format(date, format);
|
||||
if (!now_date.equals(current_value)) {
|
||||
is_same = false;
|
||||
}
|
||||
if (flag.equals("1")) {
|
||||
detail.setInitValue(now_date);
|
||||
detail.setCurrentValue(now_date);
|
||||
}
|
||||
value = now_date;
|
||||
}
|
||||
//顺序的值:如果日期一样就+步长,等于最大值就归为初始值;日期不一样就归为初始值
|
||||
if (detail.getType().equals("03")) {
|
||||
String num_value = "";
|
||||
int step = Integer.parseInt(detail.getStep());
|
||||
Long max_value = Long.valueOf(detail.getMaxValue());
|
||||
if (!is_same || (Long.valueOf(detail.getCurrentValue()) + step > max_value)) {
|
||||
num_value = detail.getInitValue();
|
||||
} else {
|
||||
num_value = (detail.getCurrentValue() + step) + "";
|
||||
}
|
||||
int size = num_value.length();
|
||||
int length = detail.getLength();
|
||||
String fillchar = detail.getFillchar();
|
||||
for (int m = 0; m < (length - size); m++) {
|
||||
value += fillchar;
|
||||
}
|
||||
value += num_value;
|
||||
if (flag.equals("1")) {
|
||||
if (!is_same) {
|
||||
int init_value = Integer.parseInt(detail.getInitValue());
|
||||
if (StrUtil.isEmpty((init_value + ""))) {
|
||||
throw new RuntimeException("请完善编码数值的初始值!");
|
||||
}
|
||||
detail.setCurrentValue(init_value + "");
|
||||
} else {
|
||||
int num_curr = Integer.parseInt(detail.getCurrentValue());
|
||||
if (num_curr >= max_value) {
|
||||
num_curr = Integer.parseInt(detail.getInitValue());
|
||||
detail.setCurrentValue(num_curr + "");
|
||||
} else {
|
||||
detail.setCurrentValue(num_curr + step + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
demo += value;
|
||||
if (flag.equals("1")) {
|
||||
iSysCodeRuleDetailService.updateById(detail);
|
||||
}
|
||||
}
|
||||
return demo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -10,8 +10,13 @@ import com.boge.modules.tickets.service.LocalStorageService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -33,15 +38,19 @@ public class LocalStorageController {
|
||||
|
||||
@ApiOperation("查询文件")
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(@RequestParam Integer contractId) {
|
||||
return new ResponseEntity(this.localStorageService.queryAll(contractId), HttpStatus.OK);
|
||||
public ResponseEntity<Object> query(@RequestParam String annex) {
|
||||
List<LocalStorage> list = new ArrayList<>();
|
||||
if (StringUtils.isNotEmpty(annex)){
|
||||
String[] split = annex.split(",");
|
||||
list = localStorageService.listByIds(Arrays.asList(split));
|
||||
}
|
||||
return new ResponseEntity(list, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping({"/download"})
|
||||
public void download(@RequestParam Integer contractId ,HttpServletResponse response) throws IOException {
|
||||
|
||||
this.localStorageService.download(this.localStorageService.queryAll(contractId), response);
|
||||
public void download(@RequestParam Long storageId , HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
this.localStorageService.downloadFile(this.localStorageService.getById(storageId),request, response);
|
||||
}
|
||||
|
||||
@ApiOperation("上传文件")
|
||||
@@ -68,7 +77,7 @@ public class LocalStorageController {
|
||||
@DeleteMapping
|
||||
@ApiOperation("多选删除")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
this.localStorageService.deleteAll(ids);
|
||||
localStorageService.removeByIds(Arrays.asList(ids));
|
||||
return new ResponseEntity(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,81 +1,42 @@
|
||||
package com.boge.modules.tickets.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
import org.hibernate.annotations.UpdateTimestamp;
|
||||
import org.springframework.data.annotation.CreatedBy;
|
||||
import org.springframework.data.annotation.LastModifiedBy;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@Entity
|
||||
@Data
|
||||
@Table(
|
||||
name = "local_storage"
|
||||
)
|
||||
@TableName("local_storage")
|
||||
public class LocalStorage implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(
|
||||
name = "storage_id"
|
||||
)
|
||||
@GeneratedValue(
|
||||
strategy = GenerationType.IDENTITY
|
||||
)
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long storageId;
|
||||
@ApiModelProperty("真实文件名")
|
||||
private String realName;
|
||||
@ApiModelProperty("文件名")
|
||||
private String name;
|
||||
@ApiModelProperty("后缀")
|
||||
private String suffix;
|
||||
@ApiModelProperty("路径")
|
||||
private String path;
|
||||
@ApiModelProperty("类型")
|
||||
private String type;
|
||||
@ApiModelProperty("大小")
|
||||
private String size;
|
||||
@CreatedBy
|
||||
@Column(
|
||||
name = "create_by",
|
||||
updatable = false
|
||||
)
|
||||
@ApiModelProperty(
|
||||
value = "创建人",
|
||||
hidden = true
|
||||
)
|
||||
|
||||
private String createBy;
|
||||
@LastModifiedBy
|
||||
@Column(
|
||||
name = "update_by"
|
||||
)
|
||||
@ApiModelProperty(
|
||||
value = "更新人",
|
||||
hidden = true
|
||||
)
|
||||
|
||||
private String updateBy;
|
||||
@CreationTimestamp
|
||||
@Column(
|
||||
name = "create_time",
|
||||
updatable = false
|
||||
)
|
||||
@ApiModelProperty(
|
||||
value = "创建时间",
|
||||
hidden = true
|
||||
)
|
||||
private Timestamp createTime;
|
||||
@UpdateTimestamp
|
||||
@Column(
|
||||
name = "update_time"
|
||||
)
|
||||
@ApiModelProperty(
|
||||
value = "更新时间",
|
||||
hidden = true
|
||||
)
|
||||
private Timestamp updateTime;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.boge.modules.tickets.repository;
|
||||
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface LocalStorageRepository extends JpaRepository<LocalStorage, Long>, JpaSpecificationExecutor<LocalStorage> {
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.boge.modules.tickets.repository;
|
||||
|
||||
|
||||
import com.boge.modules.tickets.entity.TicketsEntity;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface TickesRepository extends ElasticsearchRepository<TicketsEntity, String> {
|
||||
|
||||
}
|
||||
@@ -1,21 +1,24 @@
|
||||
package com.boge.modules.tickets.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import com.boge.modules.tickets.entity.TicketsEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
public interface LocalStorageService {
|
||||
public interface LocalStorageService extends IService<LocalStorage> {
|
||||
|
||||
List<LocalStorage> queryAll(Integer contractId);
|
||||
|
||||
|
||||
LocalStorage create(String name, MultipartFile file);
|
||||
List<LocalStorage> createBatch(MultipartFile[] file);
|
||||
|
||||
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void download(List<LocalStorage> localStorageDtos, HttpServletResponse response) throws IOException;
|
||||
void downloadFile(LocalStorage localStorage, HttpServletRequest request, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import cn.hutool.core.util.StrUtil;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.boge.common.exception.RRException;
|
||||
import com.boge.common.utils.FileProperties;
|
||||
import com.boge.common.utils.FileUtil;
|
||||
@@ -14,78 +16,65 @@ import com.boge.modules.contract.entity.ContractEntity;
|
||||
import com.boge.modules.contract.service.ContractService;
|
||||
import com.boge.modules.tickets.dao.LocalStorageMapper;
|
||||
import com.boge.modules.tickets.entity.LocalStorage;
|
||||
import com.boge.modules.tickets.repository.LocalStorageRepository;
|
||||
|
||||
import com.boge.modules.tickets.service.LocalStorageService;
|
||||
import net.bytebuddy.implementation.bytecode.Throw;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@Service
|
||||
public class LocalStorageServiceImpl implements LocalStorageService {
|
||||
private final LocalStorageRepository localStorageRepository;
|
||||
private final LocalStorageMapper localStorageMapper;
|
||||
private final FileProperties properties;
|
||||
public class LocalStorageServiceImpl extends ServiceImpl<LocalStorageMapper, LocalStorage> implements LocalStorageService {
|
||||
|
||||
@Autowired
|
||||
private ContractService contractService;
|
||||
@Autowired
|
||||
private FileProperties properties;
|
||||
|
||||
public List<LocalStorage> queryAll(Integer contractId) {
|
||||
ContractEntity contract = contractService.getById(contractId);
|
||||
if (ObjectUtil.isNull(contract)) {
|
||||
throw new RRException("合同为空");
|
||||
}
|
||||
if (StrUtil.isEmpty(contract.getStorageId())){
|
||||
if (StrUtil.isEmpty(contract.getAnnex())){
|
||||
return null;
|
||||
}
|
||||
String[] split = contract.getStorageId().split(",");
|
||||
return localStorageMapper.selectList(new QueryWrapper<LocalStorage>().in("storage_id", Arrays.asList(split)));
|
||||
String[] split = contract.getAnnex().split(",");
|
||||
return this.baseMapper.selectList(new QueryWrapper<LocalStorage>().in("storage_id", Arrays.asList(split)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Transactional(
|
||||
rollbackFor = {Exception.class}
|
||||
)
|
||||
public LocalStorage create(String name, MultipartFile multipartFile) {
|
||||
FileUtil.checkSize(this.properties.getMaxSize(), multipartFile.getSize());
|
||||
String suffix = FileUtil.getExtensionName(multipartFile.getOriginalFilename());
|
||||
String type = FileUtil.getFileType(suffix);
|
||||
File file = FileUtil.upload(multipartFile, this.properties.getPath().getPath() + type + File.separator);
|
||||
if (ObjectUtil.isNull(file)) {
|
||||
throw new RRException("上传失败");
|
||||
} else {
|
||||
try {
|
||||
name = StrUtil.isEmpty(name) ? FileUtil.getFileNameNoEx(multipartFile.getOriginalFilename()) : name;
|
||||
LocalStorage localStorage = new LocalStorage(file.getName(), name, suffix, file.getPath(), type, FileUtil.getSize(multipartFile.getSize()));
|
||||
return (LocalStorage)this.localStorageRepository.save(localStorage);
|
||||
} catch (Exception var7) {
|
||||
Exception e = var7;
|
||||
FileUtil.del(file);
|
||||
throw new RRException(e.toString());
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LocalStorage> createBatch(MultipartFile[] multipartFile) {
|
||||
List<LocalStorage> result = new ArrayList<>();
|
||||
if (multipartFile!=null){
|
||||
for (MultipartFile item : multipartFile) {
|
||||
FileUtil.checkSize(this.properties.getMaxSize(), item.getSize());
|
||||
String filename = item.getOriginalFilename();
|
||||
String suffix = FileUtil.getExtensionName(filename);
|
||||
String type = FileUtil.getFileType(suffix);
|
||||
File file = FileUtil.upload(item, this.properties.getPath().getPath() + type + File.separator);
|
||||
LocalStorage localStorage = new LocalStorage(file.getName(), filename, suffix, file.getPath(), type, FileUtil.getSize(item.getSize()));
|
||||
result.add(localStorage);
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(result)){
|
||||
this.saveBatch(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Transactional(
|
||||
rollbackFor = {Exception.class}
|
||||
)
|
||||
public void deleteAll(Long[] ids) {
|
||||
Long[] var2 = ids;
|
||||
int var3 = ids.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
Long id = var2[var4];
|
||||
LocalStorage storage = (LocalStorage)this.localStorageRepository.findById(id).orElseGet(LocalStorage::new);
|
||||
FileUtil.del(storage.getPath());
|
||||
this.localStorageRepository.delete(storage);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void download(List<LocalStorage> queryAll, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList();
|
||||
@@ -102,13 +91,14 @@ public class LocalStorageServiceImpl implements LocalStorageService {
|
||||
map.put("创建日期", localStorageDTO.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
public LocalStorageServiceImpl(final LocalStorageRepository localStorageRepository, final LocalStorageMapper localStorageMapper, final FileProperties properties) {
|
||||
this.localStorageRepository = localStorageRepository;
|
||||
this.localStorageMapper = localStorageMapper;
|
||||
this.properties = properties;
|
||||
@Override
|
||||
public void downloadFile(LocalStorage localStorage, HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
String path = localStorage.getPath();
|
||||
File file = new File(path);
|
||||
FileUtil.downloadFile(request, response,file,false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
druid:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/flowable?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
url: jdbc:mysql://localhost:3306/basefast?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
initial-size: 10
|
||||
|
||||
@@ -75,8 +75,8 @@ flowable:
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
path: ~/file/
|
||||
avatar: ~/avatar/
|
||||
path: /Users/mima0000/Desktop/file/
|
||||
avatar: /Users/mima0000/Desktop/avatar/
|
||||
linux:
|
||||
path: /home/eladmin/file/
|
||||
avatar: /home/eladmin/avatar/
|
||||
|
||||
@@ -6,39 +6,78 @@
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.boge.modules.contract.entity.ContractEntity" id="contractMap">
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="contractType" column="contract_type"/>
|
||||
<result property="projectType" column="project_type"/>
|
||||
<result property="isMaster" column="is_master"/>
|
||||
<result property="contractNumber" column="contract_number"/>
|
||||
<result property="contractCode" column="contract_Code"/>
|
||||
<result property="parentContract" column="parent_contract"/>
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="materialJson" column="material_json"/>
|
||||
<result property="isAcceptance" column="is_acceptance"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="totalPrice" column="total_price"/>
|
||||
<result property="acceptanceTime" column="acceptance_time"/>
|
||||
<result property="effectiveTime" column="effective_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createName" column="create_name"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="annex" column="annex"/>
|
||||
<result property="qc" column="qc"/>
|
||||
<result property="afterSales" column="after_sales"/>
|
||||
<result property="delivery" column="delivery"/>
|
||||
<result property="place" column="place"/>
|
||||
<result property="transport" column="transport"/>
|
||||
<result property="pay" column="pay"/>
|
||||
<result property="payment" column="payment"/>
|
||||
<result property="breach" column="breach"/>
|
||||
<result property="packaging" column="packaging"/>
|
||||
<result property="solveDispute" column="solve_dispute"/>
|
||||
<result property="supplement" column="supplement"/>
|
||||
<result property="priceId" column="price_id"/>
|
||||
</resultMap>
|
||||
<resultMap type="com.boge.modules.contract.dto.ContractDto" id="contractDtoMap">
|
||||
<result property="contractId" column="contract_id"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="contractType" column="contract_type"/>
|
||||
<result property="projectType" column="project_type"/>
|
||||
<result property="isMaster" column="is_master"/>
|
||||
<result property="contractNumber" column="contract_number"/>
|
||||
<result property="contractCode" column="contract_Code"/>
|
||||
<result property="parentContract" column="parent_contract"/>
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="materialJson" column="material_json"/>
|
||||
<result property="isAcceptance" column="is_acceptance"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="totalPrice" column="total_price"/>
|
||||
<result property="acceptanceTime" column="acceptance_time"/>
|
||||
<result property="effectiveTime" column="effective_time"/>
|
||||
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createName" column="create_name"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="storageId" column="storage_id"/>
|
||||
<result property="fileNo" column="file_no"/>
|
||||
<result property="annex" column="annex"/>
|
||||
<result property="qc" column="qc"/>
|
||||
<result property="afterSales" column="after_sales"/>
|
||||
<result property="delivery" column="delivery"/>
|
||||
<result property="place" column="place"/>
|
||||
<result property="transport" column="transport"/>
|
||||
<result property="pay" column="pay"/>
|
||||
<result property="payment" column="payment"/>
|
||||
<result property="breach" column="breach"/>
|
||||
<result property="packaging" column="packaging"/>
|
||||
<result property="solveDispute" column="solve_dispute"/>
|
||||
<result property="supplement" column="supplement"/>
|
||||
<result property="priceId" column="price_id"/>
|
||||
<!-- ClientEntity关联对象 -->
|
||||
<association property="client" javaType="com.boge.modules.client.entity.ClientEntity">
|
||||
<result property="clientId" column="client_id"/>
|
||||
<result property="clientName" column="client_name"/>
|
||||
<result property="juridicalPerson" column="juridical_person"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="fax" column="address"/>
|
||||
<result property="tel" column="address"/>
|
||||
<result property="bank" column="address"/>
|
||||
<result property="card" column="address"/>
|
||||
<result property="fax" column="fax"/>
|
||||
<result property="tel" column="tel"/>
|
||||
<result property="bank" column="bank"/>
|
||||
<result property="card" column="card"/>
|
||||
<result property="industry" column="industry"/>
|
||||
<result property="isOn" column="is_on"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
|
||||
Reference in New Issue
Block a user