This commit is contained in:
hongchao 2025-03-07 08:40:02 +08:00
commit 38421b6367
58 changed files with 1343 additions and 163 deletions

View File

@ -144,6 +144,7 @@ public class StoreLogAspect {
bmStorageLog.setManageType(String.valueOf(leaseOutDetails.getManageType())); bmStorageLog.setManageType(String.valueOf(leaseOutDetails.getManageType()));
bmStorageLog.setTypeModelName(leaseOutDetails.getTypeName()); bmStorageLog.setTypeModelName(leaseOutDetails.getTypeName());
bmStorageLog.setPreStoreNum(leaseOutDetails.getPreStoreNum()); bmStorageLog.setPreStoreNum(leaseOutDetails.getPreStoreNum());
bmStorageLog.setAgreementId(leaseOutDetails.getAgreementId());
//数量类型设备 //数量类型设备
if (leaseOutDetails.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) { if (leaseOutDetails.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) {
bmStorageLog.setOutNum(leaseOutDetails.getInputNum()); bmStorageLog.setOutNum(leaseOutDetails.getInputNum());

View File

@ -88,6 +88,11 @@ public class MaterialConstants {
/** 配件领料单号的开头字母 */ /** 配件领料单号的开头字母 */
public static final String PART_LEASE_TASK_TYPE_LEASE = "LP"; public static final String PART_LEASE_TASK_TYPE_LEASE = "LP";
/**
* 领用发布
*/
public static final String LEASE_PUBLISH = "LF";
/** /**
* 内部单位协议 * 内部单位协议
*/ */

View File

@ -265,4 +265,29 @@ public class LeaseApplyInfo extends BaseEntity{
@ApiModelProperty(value = "公司名称") @ApiModelProperty(value = "公司名称")
private String companyName; private String companyName;
@ApiModelProperty(value = "本流程节点id")
private Integer nodeId;
@ApiModelProperty(value = "下个流程节点id")
private Integer nextNodeId;
@ApiModelProperty(value = "流程配置值")
private String configValue;
@ApiModelProperty(value = "所属记录")
private Integer recordId;
@ApiModelProperty(value = "设备编码")
private String maCode;
@ApiModelProperty(value = "设备id")
private Long maId;
@ApiModelProperty(value = "流程节点签名方式 0:或签 1:会签")
private Integer nodeSignType;
@ApiModelProperty(value = "发布批次")
private String publishTask;
} }

View File

@ -99,4 +99,10 @@ public class LeaseOutDetails extends BaseEntity {
/** 类型名称 */ /** 类型名称 */
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "发布批次")
private String publishTask;
@ApiModelProperty(value = "协议id")
private Long agreementId;
} }

View File

@ -13,7 +13,7 @@ public enum LeaseTaskStatusEnum {
LEASE_TASK_ZERO(0, "待审核"), LEASE_TASK_ZERO(0, "待审核"),
LEASE_TASK_SUBMIT(5, "待提交"), LEASE_TASK_SUBMIT(5, "待提交"),
LEASE_TASK_TO_PUBLISHED(1, "待发布"), LEASE_TASK_TO_PUBLISHED(1, "待发布"),
LEASE_TASK_TO_AUDIT(2, "待审核"), LEASE_TASK_TO_AUDIT(2, "已终结"),
LEASE_TASK_IN_PROGRESS(3, "出库进行中"), LEASE_TASK_IN_PROGRESS(3, "出库进行中"),
LEASE_TASK_FINISHED(4, "出库已完成"); LEASE_TASK_FINISHED(4, "出库已完成");
private final Integer status; private final Integer status;

View File

@ -98,4 +98,13 @@ public class OutRecordInfo {
@ApiModelProperty(value = "装备管理方式") @ApiModelProperty(value = "装备管理方式")
private String manageType; private String manageType;
@ApiModelProperty(value = "三级ID")
private Integer thirdTypeId;
@ApiModelProperty(value = "二级ID")
private Integer secondTypeId;
@ApiModelProperty(value = "一级ID")
private Integer firstTypeId;
} }

View File

@ -73,8 +73,9 @@ public class LeaseApplyInfoController extends BaseController {
//@RequiresPermissions("lease:info:query") //@RequiresPermissions("lease:info:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@NotNull(message = "领料任务ID不能为空") @PathVariable("id") Long id, public AjaxResult getInfo(@NotNull(message = "领料任务ID不能为空") @PathVariable("id") Long id,
@RequestParam(value = "keyWord", required = false) String keyWord) { @RequestParam(value = "keyWord", required = false) String keyWord,
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord)); @RequestParam(value = "publishTask", required = false) String publishTask) {
return success(leaseApplyInfoService.selectLeaseApplyInfoById(id, keyWord, publishTask));
} }
/** /**
@ -121,7 +122,7 @@ public class LeaseApplyInfoController extends BaseController {
@PostMapping("/exportInfo") @PostMapping("/exportInfo")
public void exportInfo(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) { public void exportInfo(HttpServletResponse response, LeaseApplyInfo leaseApplyInfo) {
LeaseApplyRequestVo leaseApplyRequestVo = leaseApplyInfoService.getInfo(leaseApplyInfo.getId()); LeaseApplyRequestVo leaseApplyRequestVo = leaseApplyInfoService.getInfo(leaseApplyInfo.getId());
leaseApplyInfoService.exportInfo(leaseApplyRequestVo, response); leaseApplyInfoService.exportInfo(leaseApplyInfo, leaseApplyRequestVo, response);
} }
@ApiOperation(value = "导出领料任务详情") @ApiOperation(value = "导出领料任务详情")

View File

@ -144,6 +144,17 @@ public class LeaseTaskController extends BaseController {
return success(service.getDetailsById(leaseApplyInfo)); return success(service.getDetailsById(leaseApplyInfo));
} }
/**
* 发布数据保存
* @param leaseApplyRequestVo
* @return
*/
@ApiOperation(value = "发布数据保存")
@PostMapping("/addPublish")
public AjaxResult addPublish(@RequestBody LeaseApplyRequestVo leaseApplyRequestVo) {
return service.addPublish(leaseApplyRequestVo);
}
/** /**
* 导出领料发布列表 * 导出领料发布列表
* @param response * @param response

View File

@ -49,6 +49,9 @@ public class LeaseApplyDetails extends BaseEntity {
@ApiModelProperty(value = "规格型号id") @ApiModelProperty(value = "规格型号id")
private Long typeId; private Long typeId;
@ApiModelProperty(value = "规格型号id")
private Long newTypeId;
@ApiModelProperty(value = "三级id") @ApiModelProperty(value = "三级id")
private Long thirdTypeId; private Long thirdTypeId;
@ -82,6 +85,9 @@ public class LeaseApplyDetails extends BaseEntity {
@ApiModelProperty(value = "待发布数量") @ApiModelProperty(value = "待发布数量")
private BigDecimal pendingNum; private BigDecimal pendingNum;
@ApiModelProperty(value = "本次发布数量")
private BigDecimal num;
/** 预领料数 */ /** 预领料数 */
@Excel(name = "预领数量") @Excel(name = "预领数量")
@ApiModelProperty(value = "预领料数") @ApiModelProperty(value = "预领料数")
@ -128,6 +134,24 @@ public class LeaseApplyDetails extends BaseEntity {
@ApiModelProperty(value = "编码类型集合") @ApiModelProperty(value = "编码类型集合")
private List<MaCodeVo> maCodeVoList; private List<MaCodeVo> maCodeVoList;
@ApiModelProperty(value = "往来单位id")
private Long unitId;
@ApiModelProperty(value = "工程id")
private Long projectId;
@ApiModelProperty(value = "领料人")
private String leasePerson;
@ApiModelProperty(value = "联系方式")
private String phone;
@ApiModelProperty(value = "任务当月序号 例如:1 插入及查询时请携带任务类型")
private Integer monthOrder;
@ApiModelProperty(value = "发布批次")
private String publishTask;
public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) { public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
this.id = id; this.id = id;
this.parentId = parentId; this.parentId = parentId;

View File

@ -21,6 +21,9 @@ public class LeaseOutVo {
@ApiModelProperty("任务id") @ApiModelProperty("任务id")
private Long taskId; private Long taskId;
@ApiModelProperty("机具id")
private Long maId;
@ApiModelProperty("机具名称") @ApiModelProperty("机具名称")
private String typeName; private String typeName;

View File

@ -126,4 +126,20 @@ public interface LeaseApplyDetailsMapper {
* @return * @return
*/ */
int updateBackDetailsOutNum(LeaseOutDetails leaseOutDetails); int updateBackDetailsOutNum(LeaseOutDetails leaseOutDetails);
/**
* 根据机具id查询领料任务详细
* @param maId
* @return
*/
List<LeaseOutVo> selectByMaId(@Param("maId") Long maId);
/**
* 根据领料任务id查询领料任务详细
* @param keyWord
* @param publishTask
* @return
*/
List<LeaseApplyDetails> getDetailsPublish(@Param("keyWord") String keyWord, @Param("publishTask") String publishTask);
} }

View File

@ -73,4 +73,11 @@ public interface LeaseApplyInfoMapper {
/** 设置发料单位 防止代码冲突 **/ /** 设置发料单位 防止代码冲突 **/
String getSendUnit(LeaseApplyInfo leaseApplyInfo); String getSendUnit(LeaseApplyInfo leaseApplyInfo);
/**
* 查询领用出库数据
* @param leaseApplyInfo
* @return
*/
List<LeaseApplyInfo> selectPublishList(LeaseApplyInfo leaseApplyInfo);
} }

View File

@ -112,4 +112,33 @@ public interface LeaseTaskMapper {
* @return * @return
*/ */
List<LeaseApplyDetails> selectPublishDetails(LeaseApplyInfo leaseApplyInfo); List<LeaseApplyDetails> selectPublishDetails(LeaseApplyInfo leaseApplyInfo);
/**
* 根据taskId查询领用申请详情
* @param parentId
* @return
*/
List<LeaseApplyDetails> selectLeaseApplyDetailsById(Long parentId);
/**
* 领用申请发布详情保存
* @param applyDetails
* @return
*/
int addPublish(LeaseApplyDetails applyDetails);
/**
* 领用申请发布详情修改
* @param applyDetails
* @return
*/
int updatePublish(LeaseApplyDetails applyDetails);
/**
* 根据当前年月查询最大序号
* @param year
* @param month
* @return
*/
int getMonthMaxOrderByDate(@Param("year") String year, @Param("month") String month);
} }

View File

@ -24,9 +24,10 @@ public interface ILeaseApplyInfoService {
* *
* @param id 领料任务主键 * @param id 领料任务主键
* @param keyword keyword 关键字 * @param keyword keyword 关键字
* @param publishTask 发布批次
* @return 领料任务 * @return 领料任务
*/ */
LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword); LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword, String publishTask);
/** /**
* 查询领料任务列表 * 查询领料任务列表
@ -110,10 +111,11 @@ public interface ILeaseApplyInfoService {
/** /**
* 导出领料出库详细 * 导出领料出库详细
* @param leaseApplyInfo
* @param leaseApplyRequestVo * @param leaseApplyRequestVo
* @param response * @param response
*/ */
void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response); void exportInfo(LeaseApplyInfo leaseApplyInfo, LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response);
/** /**
* 根据id查询内部领料任务详情 * 根据id查询内部领料任务详情

View File

@ -107,5 +107,12 @@ public interface ILeaseTaskService {
* @return * @return
*/ */
LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo); LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo);
/**
* 发布数据保存
* @param leaseApplyRequestVo
* @return
*/
AjaxResult addPublish(LeaseApplyRequestVo leaseApplyRequestVo);
} }

View File

@ -80,7 +80,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
* @return 领料任务 * @return 领料任务
*/ */
@Override @Override
public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword) { public LeaseApplyRequestVo selectLeaseApplyInfoById(Long id, String keyword, String publishTask) {
try { try {
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo(); LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
leaseApplyInfo.setId(id); leaseApplyInfo.setId(id);
@ -125,6 +125,23 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
}); });
// 走单独的领用详情查询
if (StringUtils.isNotBlank(publishTask)) {
LeaseApplyRequestVo info = new LeaseApplyRequestVo();
// 根据领用批次查询领用详情
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getDetailsPublish(keyword,publishTask);
if (!CollectionUtils.isEmpty(details)) {
for (LeaseApplyDetails detail : details) {
if (detail.getOutNum().compareTo(detail.getAlNum()) == 0) {
detail.setStatus("2");
} else {
detail.setStatus("1");
}
}
info.setLeaseApplyDetailsList(details);
}
return info;
}
return leaseApplyRequestVo; return leaseApplyRequestVo;
} catch (Exception e) { } catch (Exception e) {
@ -145,16 +162,38 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) { public List<LeaseApplyInfo> selectLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
leaseApplyInfo.setUserId(SecurityUtils.getUserId()); leaseApplyInfo.setUserId(SecurityUtils.getUserId());
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(list)) { // 如果statusList包含345则为领料出库查询需查询领用出库数据进行拼接
if (leaseApplyInfo.getStatusList() != null && leaseApplyInfo.getStatusList().contains(3)
&& leaseApplyInfo.getStatusList().contains(4) && leaseApplyInfo.getStatusList().contains(5)) {
// 查询领用出库数据
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
for (LeaseApplyInfo applyInfo : leaseApplyOutList) {
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatusName());
} else {
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatusName());
}
}
list.addAll(leaseApplyOutList);
}
}
// 使用 Stream API 进行降序排序
List<LeaseApplyInfo> sortedList = list.stream()
.sorted(Comparator.comparing(LeaseApplyInfo::getCreateTime).reversed())
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(sortedList)) {
String keyWord = leaseApplyInfo.getKeyWord(); String keyWord = leaseApplyInfo.getKeyWord();
// 如果关键字不为空进行过滤 // 如果关键字不为空进行过滤
if (!StringUtils.isBlank(keyWord)) { if (!StringUtils.isBlank(keyWord)) {
list = list.stream() sortedList = sortedList.stream()
.filter(item -> containsKeyword(item, keyWord)) .filter(item -> containsKeyword(item, keyWord))
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
} }
return list; return sortedList;
} }
/** /**
@ -183,6 +222,59 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
*/ */
@Override @Override
public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) { public AjaxResult insertLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
/*int result = 0;
if (null == leaseApplyRequestVo.getLeaseApplyInfo()) {
return AjaxResult.error("请先填写领料任务信息");
}
if (CollectionUtil.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
return AjaxResult.error("请先添加领料任务物资明细");
}
leaseApplyRequestVo.getLeaseApplyInfo().setCreateTime(DateUtils.getNowDate());
leaseApplyRequestVo.getLeaseApplyInfo().setCreateBy(SecurityUtils.getUsername());
try {
// 获取 LeaseApplyDetails 列表
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyRequestVo.getLeaseApplyDetailsList();
for (LeaseApplyDetails applyDetails : leaseApplyDetailsList) {
if (applyDetails.getCompanyId() == null) {
throw new RuntimeException("未知所属公司领料任务,无法操作!");
}
}
// companyId 进行分组
Map<Long, List<LeaseApplyDetails>> groupedByCompanyId = leaseApplyDetailsList.stream()
.collect(Collectors.groupingBy(LeaseApplyDetails::getCompanyId));
for (Map.Entry<Long, List<LeaseApplyDetails>> entry : groupedByCompanyId.entrySet()) {
Long key = entry.getKey();
List<LeaseApplyDetails> details = entry.getValue();
TmTaskTypeEnum splitType = null;
String taskTypeLabel = null;
// 机具领料任务
if (key == 101) {
splitType = TmTaskTypeEnum.TM_TASK_JJ_LEASE;
taskTypeLabel = MaterialConstants.JJ_LEASE_TASK_TYPE_LABEL;
// 安全工器具领料任务
} else if (key == 102) {
splitType = TmTaskTypeEnum.TM_TASK_SAFE_LEASE;
taskTypeLabel = MaterialConstants.AQ_LEASE_TASK_TYPE_LABEL;
// 宏源领料任务
} else if (key == 309) {
splitType = TmTaskTypeEnum.TM_TASK_HY_LEASE;
taskTypeLabel = MaterialConstants.HY_LEASE_TASK_TYPE_LABEL;
} else {
throw new RuntimeException("未知所属公司领料任务,无法操作!");
}
result += processLeaseTask(leaseApplyRequestVo, splitType, taskTypeLabel);
if (result > 0) {
return insertPurchaseCheckDetails(details, leaseApplyRequestVo.getLeaseApplyInfo().getId());
} else {
return AjaxResult.error("新增任务失败,lease_apply_info表插入0条");
}
}
} catch (DataAccessException e) {
throw new RuntimeException("数据库操作失败:" + e.getMessage());
} catch (Exception e) {
throw new RuntimeException("新增任务失败:" + e.getMessage());
}
return AjaxResult.error("新增任务失败");*/
if (null == leaseApplyRequestVo.getLeaseApplyInfo()) { if (null == leaseApplyRequestVo.getLeaseApplyInfo()) {
return AjaxResult.error("请先填写领料任务信息"); return AjaxResult.error("请先填写领料任务信息");
} }
@ -236,6 +328,54 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
} }
/**
* 处理任务
* @param leaseApplyRequestVo
* @param splitType
* @param taskTypeLabel
* @return
*/
/*private int processLeaseTask(LeaseApplyRequestVo leaseApplyRequestVo, TmTaskTypeEnum splitType, String taskTypeLabel) {
int thisMonthMaxOrder = tmTaskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(),
TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId());
String taskCode = genderTaskCode(thisMonthMaxOrder, taskTypeLabel);
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_LEASE.getTaskTypeId(),
LeaseTaskStatusEnum.LEASE_TASK_TO_PUBLISHED.getStatus(),
leaseApplyRequestVo.getLeaseApplyInfo().getCompanyId(), thisMonthMaxOrder + 1, taskCode);
tmTask.setCreateTime(DateUtils.getNowDate());
tmTask.setCreateBy(SecurityUtils.getUsername());
tmTask.setSplitType(splitType.getTaskTypeId());
tmTaskMapper.insertTmTask(tmTask);
TmTaskAgreement tmTaskAgreement = new TmTaskAgreement(tmTask.getTaskId(), leaseApplyRequestVo.getLeaseApplyInfo().getAgreementId());
tmTaskAgreement.setCreateTime(DateUtils.getNowDate());
tmTaskAgreement.setCreateBy(SecurityUtils.getUsername());
tmTaskAgreementMapper.insertTmTaskAgreement(tmTaskAgreement);
leaseApplyRequestVo.getLeaseApplyInfo().setTaskId(tmTask.getTaskId());
leaseApplyRequestVo.getLeaseApplyInfo().setCode(taskCode);
// 设置审批人为默认的董班长 --防止代码冲突
Long peopleId = leaseApplyInfoMapper.getDirectAuditBy();
leaseApplyRequestVo.getLeaseApplyInfo().setDirectAuditBy(peopleId);
int count = leaseApplyInfoMapper.insertLeaseApplyInfo(leaseApplyRequestVo.getLeaseApplyInfo());
if (!CollectionUtils.isEmpty(leaseApplyRequestVo.getLeaseApplyInfo().getBmFileInfos())) {
leaseApplyRequestVo.getLeaseApplyInfo().getBmFileInfos().forEach(bmFileInfo -> {
bmFileInfo.setTaskType(2);
bmFileInfo.setTaskId(tmTask.getTaskId());
bmFileInfo.setModelId(leaseApplyRequestVo.getLeaseApplyInfo().getId());
bmFileInfo.setFileType(5L);
bmFileInfo.setCreateBy(SecurityUtils.getUsername());
bmFileInfo.setCreateTime(DateUtils.getNowDate());
bmFileInfoMapper.insertBmFileInfo(bmFileInfo);
});
}
return count;
}*/
/** /**
* 发布任务 * 发布任务
* *
@ -301,6 +441,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
} }
/**
* 插入领料任务详情数据
* @param leaseApplyDetailsList
* @param parentId
* @return
*/
private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long parentId) { private AjaxResult insertPurchaseCheckDetails(List<LeaseApplyDetails> leaseApplyDetailsList, Long parentId) {
if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) { if (!CollectionUtils.isEmpty(leaseApplyDetailsList)) {
for (LeaseApplyDetails details : leaseApplyDetailsList) { for (LeaseApplyDetails details : leaseApplyDetailsList) {
@ -325,6 +471,13 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
* @param thisMonthMaxOrder 当月最大单号 * @param thisMonthMaxOrder 当月最大单号
* @return 任务对象 * @return 任务对象
*/ */
/*private static String genderTaskCode(Integer thisMonthMaxOrder, String taskType) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String result = format.replace("-", "");
return taskType + result + String.format("-%03d", thisMonthMaxOrder + 1);
}*/
private static String genderTaskCode(Integer thisMonthMaxOrder) { private static String genderTaskCode(Integer thisMonthMaxOrder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate(); Date nowDate = DateUtils.getNowDate();
@ -340,6 +493,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
* @return 结果 * @return 结果
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class)
public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) { public boolean updateLeaseApplyInfo(LeaseApplyRequestVo leaseApplyRequestVo) {
try { try {
// 提取到局部变量中减少重复代码 // 提取到局部变量中减少重复代码
@ -385,6 +539,54 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} catch (Exception e) { } catch (Exception e) {
throw new ServiceException("未知异常: " + e.getMessage()); throw new ServiceException("未知异常: " + e.getMessage());
} }
/*try {
int result = 0;
// 提取到局部变量中减少重复代码
LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo();
if (leaseApplyInfo != null && leaseApplyInfo.getId() != null) {
// 去除创建一个新的数组对象直接复用
Long[] ids = {leaseApplyInfo.getId()};
result = leaseApplyInfoMapper.deleteLeaseApplyInfoByIds(ids);
if (result == 0) {
throw new RuntimeException("删除主要任务失败");
}
if (CollectionUtil.isNotEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
// 业务逻辑代码
result = leaseApplyDetailsMapper.deleteLeaseApplyDetailsByParentIds(ids);
if (result == 0) {
throw new RuntimeException("删除详情任务失败");
}
}
// 查询是否存在文件
BmFileInfo fileInfo = new BmFileInfo();
fileInfo.setTaskId(leaseApplyInfo.getTaskId());
fileInfo.setModelId(leaseApplyInfo.getId());
fileInfo.setTaskType(2);
fileInfo.setFileType(5L);
List<BmFileInfo> bmFileInfos = bmFileInfoMapper.selectBmFileInfoList(fileInfo);
// 删除原有数据
if (!CollectionUtils.isEmpty(bmFileInfos)) {
result = bmFileInfoMapper.deleteBmFileInfoByBizInfo(fileInfo);
if (result == 0) {
throw new RuntimeException("删除文件失败");
}
}
// 重新走新增逻辑
AjaxResult ajaxResult = insertLeaseApplyInfo(leaseApplyRequestVo);
if (!ajaxResult.isSuccess()) {
System.err.println(ajaxResult.get("msg"));
throw new RuntimeException("修改新增数据异常");
}
return true;
}
return false;
} catch (DataAccessException dae) {
throw new ServiceException("数据访问异常: " + dae.getMessage());
} catch (IllegalArgumentException iae) {
throw new ServiceException("非法参数异常: " + iae.getMessage());
} catch (Exception e) {
throw new ServiceException("未知异常: " + e.getMessage());
}*/
} }
/** /**
@ -502,7 +704,7 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
} }
@Override @Override
public void exportInfo(LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response) { public void exportInfo(LeaseApplyInfo leaseApplyInfo, LeaseApplyRequestVo leaseApplyRequestVo, HttpServletResponse response) {
try { try {
String fileName = "施工机具设备出库检验记录表"; String fileName = "施工机具设备出库检验记录表";
String projectName = ""; String projectName = "";
@ -512,6 +714,12 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
projectName ="领用工程:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseProject(); projectName ="领用工程:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseProject();
unit ="使用单位:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseUnit(); unit ="使用单位:" + leaseApplyRequestVo.getLeaseApplyInfo().getLeaseUnit();
list = leaseApplyRequestVo.getLeaseOutVoList(); list = leaseApplyRequestVo.getLeaseOutVoList();
if (leaseApplyInfo.getMaId() != null) {
// 过滤出list中和leaseApplyInfo.getMaId()相等的元素
list = list.stream()
.filter(item -> item.getMaId().equals(leaseApplyInfo.getMaId()))
.collect(Collectors.toList());
}
} }
expOutExcel(response,list,fileName,projectName,unit); expOutExcel(response,list,fileName,projectName,unit);
} catch (Exception e) { } catch (Exception e) {

View File

@ -347,6 +347,26 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
private int updateTaskStatus(LeaseOutDetails record) { private int updateTaskStatus(LeaseOutDetails record) {
int res = 0; int res = 0;
// 领用任务单独判断
if (StringUtils.isNotBlank(record.getPublishTask())) {
// 根据领用批次查询领用详情
boolean isFinished = true;
List<LeaseApplyDetails> details = leaseApplyDetailsMapper.getDetailsPublish(null, record.getPublishTask());
if (!CollectionUtils.isEmpty(details)) {
for (LeaseApplyDetails bean : details) {
if (bean.getAlNum().compareTo(bean.getPreNum()) != 0) {
isFinished = false;
break;
}
}
}
if (isFinished) {
String taskId = leaseApplyInfoMapper.getTaskId(record.getParentId());
// 领用任务状态改为已完成
res = tmTaskMapper.updateTaskStatus(taskId, LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
}
return res;
}
// 进行状态判断 // 进行状态判断
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId()); List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyDetailsMapper.getByParentId(record.getParentId());
int i = 0; int i = 0;
@ -422,8 +442,13 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
BigDecimal outNum = record.getOutNum(); BigDecimal outNum = record.getOutNum();
sltAgreementInfo.setNum(num.add(outNum)); sltAgreementInfo.setNum(num.add(outNum));
res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo); res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo);
record.setAgreementId(sltAgreementInfo.getAgreementId());
} else { } else {
String agreementId = tmTaskAgreementMapper.getAgreementId(taskId); String agreementId = " ";
agreementId = tmTaskAgreementMapper.getAgreementId(taskId);
if (StringUtils.isBlank(agreementId)) {
agreementId = tmTaskAgreementMapper.selectAgreementId(record.getPublishTask());
}
String protocol = bmAgreementInfoMapper.getProtocol(agreementId); String protocol = bmAgreementInfoMapper.getProtocol(agreementId);
Type maType = typeMapper.getMaType(record.getTypeId()); Type maType = typeMapper.getMaType(record.getTypeId());
if (StringUtils.isEmpty(protocol)) { if (StringUtils.isEmpty(protocol)) {
@ -438,6 +463,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
} }
} }
res = sltAgreementInfoMapper.insSltInfo(record, agreementId, maType); res = sltAgreementInfoMapper.insSltInfo(record, agreementId, maType);
record.setAgreementId(Long.valueOf(agreementId));
} }
return res; return res;
} }

View File

@ -28,10 +28,11 @@ import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.domain.TmTaskAgreement; import com.bonus.material.task.domain.TmTaskAgreement;
import com.bonus.material.task.mapper.TmTaskAgreementMapper; import com.bonus.material.task.mapper.TmTaskAgreementMapper;
import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.task.mapper.TmTaskMapper;
import com.bonus.material.work.domain.SysWorkflowNode;
import com.bonus.material.work.domain.SysWorkflowRecord; import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.domain.SysWorkflowType;
import com.bonus.material.work.mapper.SysWorkflowRecordMapper; import com.bonus.material.work.mapper.*;
import com.bonus.material.work.mapper.SysWorkflowTypeMapper;
import com.bonus.material.work.service.SysWorkflowRecordService; import com.bonus.material.work.service.SysWorkflowRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
@ -73,6 +74,17 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
@Resource @Resource
private SysWorkflowRecordService sysWorkflowRecordService; private SysWorkflowRecordService sysWorkflowRecordService;
@Resource
private SysWorkflowConfigMapper sysWorkflowConfigMapper;
@Resource
private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper;
@Resource
private SysWorkflowNodeMapper sysWorkflowNodeMapper;
/** /**
* 新增领用任务 * 新增领用任务
* *
@ -368,15 +380,71 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
public List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) { public List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
leaseApplyInfo.setUserId(userId == 0 ? null : userId); leaseApplyInfo.setUserId(userId == 0 ? null : userId);
log.info("用户id为{}",userId);
List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo); List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo);
if (!CollectionUtils.isEmpty(list)) { try {
String keyWord = leaseApplyInfo.getKeyWord(); if (!CollectionUtils.isEmpty(list)) {
// 如果关键字不为空进行过滤 String keyWord = leaseApplyInfo.getKeyWord();
if (!StringUtils.isBlank(keyWord)) { // 如果关键字不为空进行过滤
list = list.stream() if (!StringUtils.isBlank(keyWord)) {
.filter(item -> containsKeyword(item, keyWord)) list = list.stream()
.collect(Collectors.toList()); .filter(item -> containsKeyword(item, keyWord))
.collect(Collectors.toList());
}
} }
for (LeaseApplyInfo leaseApplyInfoNew : list) {
//获取当前节点并根据当前节点获取审核人审核的角色信息
if (leaseApplyInfoNew.getNodeId()!=null){
log.info("当前节点为{}",leaseApplyInfoNew.getNodeId());
SysWorkflowRecordHistory sysWorkflowRecordHistory = sysWorkflowRecordHistoryMapper.getWorkflowRecordHistoryByRecordId(leaseApplyInfoNew.getRecordId());
leaseApplyInfoNew.setNodeId(sysWorkflowRecordHistory.getNodeId());
//设置当前节点
if (1==leaseApplyInfoNew.getNodeSignType() && sysWorkflowRecordHistory.getNodeSort()==1){
leaseApplyInfoNew.setNodeId(sysWorkflowRecordHistory.getNextNodeId());
}
String configValue = sysWorkflowConfigMapper.selectConfigValueByNodeId(leaseApplyInfoNew.getNodeId());
SysWorkflowNode sysWorkflowNode = sysWorkflowNodeMapper.selectSysWorkflowNodeById(leaseApplyInfoNew.getNodeId());
leaseApplyInfoNew.setConfigValue(configValue);
//判断当前节点是否审核
sysWorkflowRecordHistory.setRecordId(leaseApplyInfoNew.getRecordId());
sysWorkflowRecordHistory.setNodeId(leaseApplyInfoNew.getNodeId());
List<SysWorkflowRecordHistory> SysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory);
//判断是或签还是会签0:或签 1:会签
if (0==sysWorkflowNode.getNodeSignType()){
//当前节点已经审核需要修改节点值
if (SysWorkflowRecordHistoryList.get(0)!=null){
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(SysWorkflowRecordHistoryList.get(0).getNextNodeId());
leaseApplyInfoNew.setNodeId(SysWorkflowRecordHistoryList.get(0).getNextNodeId());
leaseApplyInfoNew.setConfigValue(configValueNew);
}
}else {
String[] ConfigValue = configValue.split(",");
List<String> filteredList = Arrays.stream(ConfigValue).collect(Collectors.toList());
for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : SysWorkflowRecordHistoryList) {
if (sysWorkflowRecordHistoryNew!=null){
// 过滤数组元素
filteredList = filteredList.stream()
.filter(value ->value != null && !value.equals(sysWorkflowRecordHistoryNew.getCreateBy()))
.collect(Collectors.toList());
leaseApplyInfoNew.setConfigValue(filteredList.toString());
}
}
//判断是否这个节点的所有人都审核
if (filteredList.size()==0){
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(SysWorkflowRecordHistoryList.get(0).getNextNodeId());
leaseApplyInfoNew.setNodeId(SysWorkflowRecordHistoryList.get(0).getNextNodeId());
leaseApplyInfoNew.setConfigValue(configValueNew);
}else {
if (SysWorkflowRecordHistoryList.size()>0){
leaseApplyInfoNew.setNodeId(leaseApplyInfoNew.getNodeId());
leaseApplyInfoNew.setConfigValue(filteredList.toString());
}
}
}
}
}
}catch (Exception e){
log.info("查询失败",e.getMessage());
} }
return list; return list;
} }
@ -576,10 +644,8 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
@Override @Override
public LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo) { public LeaseApplyRequestVo getDetailsById(LeaseApplyInfo leaseApplyInfo) {
try { try {
/*LeaseApplyInfo applyInfo = new LeaseApplyInfo();
leaseApplyInfo.setId(leaseApplyInfo.getId());
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
applyInfo.setUserId(userId);*/ leaseApplyInfo.setUserId(userId);
Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(mapper.selectLeaseApplyInfoById(leaseApplyInfo)); Optional<LeaseApplyInfo> optionalInfo = Optional.ofNullable(mapper.selectLeaseApplyInfoById(leaseApplyInfo));
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo(); LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
@ -596,4 +662,80 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
throw new RuntimeException("Failed to select lease apply info", e); throw new RuntimeException("Failed to select lease apply info", e);
} }
} }
/**
* 发布数据保存
* @param leaseApplyRequestVo
* @return
*/
@Override
public AjaxResult addPublish(LeaseApplyRequestVo leaseApplyRequestVo) {
if (leaseApplyRequestVo == null || leaseApplyRequestVo.getLeaseApplyInfo() == null
|| CollectionUtils.isEmpty(leaseApplyRequestVo.getLeaseApplyDetailsList())) {
return AjaxResult.error("参数不能为空");
}
try {
int result = 0;
LeaseApplyInfo leaseApplyInfo = leaseApplyRequestVo.getLeaseApplyInfo();
List<LeaseApplyDetails> leaseApplyDetailsList = leaseApplyRequestVo.getLeaseApplyDetailsList();
Long parentId = leaseApplyDetailsList.get(0).getParentId();
int thisMonthMaxOrder = mapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth());
for (LeaseApplyDetails applyDetails : leaseApplyDetailsList) {
// 根据parentId及typeId更新lease_apply_details表的发布数量
result = mapper.updatePublish(applyDetails);
if (result == 0) {
return AjaxResult.error("发布失败,请联系管理员");
}
applyDetails.setUnitId(leaseApplyInfo.getUnitId());
applyDetails.setProjectId(leaseApplyInfo.getProjectId());
applyDetails.setLeasePerson(leaseApplyInfo.getLeasePerson() != null ? leaseApplyInfo.getLeasePerson() : "");
applyDetails.setPhone(leaseApplyInfo.getPhone() != null ? leaseApplyInfo.getPhone() : "");
applyDetails.setCreateBy(SecurityUtils.getUserId().toString());
applyDetails.setCreateTime(DateUtils.getNowDate());
applyDetails.setMonthOrder(thisMonthMaxOrder + 1);
String publishTask = genderPublishTask(thisMonthMaxOrder);
applyDetails.setPublishTask(publishTask);
result = mapper.addPublish(applyDetails);
if (result == 0) {
return AjaxResult.error("发布失败,请联系管理员");
}
}
List<LeaseApplyDetails> leaseApplyDetails = mapper.selectLeaseApplyDetailsById(parentId);
boolean allMatch = true;
if (!CollectionUtils.isEmpty(leaseApplyDetails)) {
for (LeaseApplyDetails leaseApplyDetail : leaseApplyDetails) {
if (leaseApplyDetail.getPreNum().compareTo(leaseApplyDetail.getPublishNum()) != 0) {
allMatch = false;
break;
}
}
}
if (allMatch) {
TmTask tmTask = new TmTask();
tmTask.setTaskId(leaseApplyInfo.getTaskId());
tmTask.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
result = tmTaskMapper.updateTmTask(tmTask);
if (result == 0) {
return AjaxResult.error("发布失败,请联系管理员");
}
}
return AjaxResult.success("发布成功");
} catch (Exception e) {
log.error(e.getMessage());
return AjaxResult.error("发布失败,请联系管理员");
}
}
/**
* 生成发布批次任务
* @param thisMonthMaxOrder
* @return
*/
private String genderPublishTask(int thisMonthMaxOrder) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String result = format.replace("-", "");
return MaterialConstants.LEASE_PUBLISH + result + String.format("-%03d", thisMonthMaxOrder + 1);
}
} }

View File

@ -157,4 +157,31 @@ public class MachineController extends BaseController {
return error("系统错误, " + e.getMessage()); return error("系统错误, " + e.getMessage());
} }
} }
/**
* 电子标签编码查询
* @param machine
* @return
*/
@ApiOperation(value = "电子标签编码查询")
@GetMapping("/getByMaCode")
public AjaxResult getByMaCode(Machine machine) {
try {
return success(machineService.getByMaCode(machine));
} catch (Exception e) {
return error("系统错误, " + e.getMessage());
}
}
/**
* 根据标签信息查询出库单
* @param leaseApplyInfo
* @return
*/
@ApiOperation(value = "获取领料出库单详细信息")
//@RequiresPermissions("lease:info:query")
@GetMapping(value = "/getInfoByMaId")
public AjaxResult getInfoByMaId(LeaseApplyInfo leaseApplyInfo) {
return success(machineService.getInfoByMaId(leaseApplyInfo));
}
} }

View File

@ -120,6 +120,17 @@ public class TypeController extends BaseController {
} }
} }
/**
* 查询一级列表
* @param maTypeVo
* @return
*/
@ApiOperation(value = "查询一级列表")
@GetMapping("/getListLevel")
public AjaxResult getListLevel(MaTypeVo maTypeVo) {
return typeService.getListLevel(maTypeVo);
}
/** /**
* 根据物资仓库ID查询施工类型 * 根据物资仓库ID查询施工类型
*/ */

View File

@ -2,6 +2,7 @@ package com.bonus.material.ma.domain;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
@ -158,4 +159,18 @@ public class DirectApplyInfo extends BaseEntity {
private String flowId; private String flowId;
@ApiModelProperty(value = "本流程节点id")
private Integer nodeId;
@ApiModelProperty(value = "下个流程节点id")
private Integer nextNodeId;
@ApiModelProperty(value = "流程配置值")
private String configValue;
@ApiModelProperty(value = "所属记录")
private Integer recordId;
@ApiModelProperty(value = "流程节点签名方式 0:或签 1:会签")
private Integer nodeSignType;
} }

View File

@ -23,6 +23,9 @@ public class Machine extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 主键id */
private Long id;
/** 机具ID */ /** 机具ID */
private Long maId; private Long maId;
@ -179,6 +182,6 @@ public class Machine extends BaseEntity
@ApiModelProperty("检测报告地址") @ApiModelProperty("检测报告地址")
private String exUrl; private String exUrl;
@ApiModelProperty("是否为机具") @ApiModelProperty("是否为机具 (0 代表机具)")
private Integer isJj; private Integer isJj;
} }

View File

@ -2,6 +2,7 @@ package com.bonus.material.ma.mapper;
import java.util.List; import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.domain.lease.LeaseOutDetails; import com.bonus.common.biz.domain.lease.LeaseOutDetails;
import com.bonus.material.ma.domain.Machine; import com.bonus.material.ma.domain.Machine;
import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.Type;
@ -112,4 +113,25 @@ public interface MachineMapper
* @return * @return
*/ */
List<Machine> getElectronicLabel(Machine machine); List<Machine> getElectronicLabel(Machine machine);
/**
* 根据标签信息查询出库单
* @param leaseApplyInfo
* @return
*/
Long selectMaId(LeaseApplyInfo leaseApplyInfo);
/**
* 查询机具信息
* @param dto
* @return
*/
Machine selectHouse(Machine dto);
/**
* 电子标签编码查询
* @param machine
* @return
*/
List<Machine> getByMaCode(Machine machine);
} }

View File

@ -189,4 +189,11 @@ public interface TypeMapper {
* @return * @return
*/ */
List<Type> selectMaTypeThreeLists(Long agreementId); List<Type> selectMaTypeThreeLists(Long agreementId);
/**
* 查询一级列表
* @param maTypeVo
* @return
*/
List<MaTypeVo> getListLevel(MaTypeVo maTypeVo);
} }

View File

@ -2,7 +2,9 @@ package com.bonus.material.ma.service;
import java.util.List; import java.util.List;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.material.ma.domain.Machine; import com.bonus.material.ma.domain.Machine;
import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.ma.domain.vo.MachineVo;
@ -83,4 +85,18 @@ public interface IMachineService
* @return * @return
*/ */
List<Machine> getElectronicLabel(Machine machine); List<Machine> getElectronicLabel(Machine machine);
/**
* 根据标签信息查询出库单
* @param leaseApplyInfo
* @return
*/
LeaseApplyRequestVo getInfoByMaId(LeaseApplyInfo leaseApplyInfo);
/**
* 电子标签编码查询
* @param machine
* @return
*/
List<Machine> getByMaCode(Machine machine);
} }

View File

@ -130,4 +130,11 @@ public interface ITypeService {
* @return * @return
*/ */
List<Type> getEquipmentThreeTypes(Long typeId, Long agreementId); List<Type> getEquipmentThreeTypes(Long typeId, Long agreementId);
/**
* 查询一级列表
* @param maTypeVo
* @return
*/
AjaxResult getListLevel(MaTypeVo maTypeVo);
} }

View File

@ -14,6 +14,7 @@ import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory; import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper; import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper;
import com.bonus.material.work.mapper.SysWorkflowRecordMapper; import com.bonus.material.work.mapper.SysWorkflowRecordMapper;
import com.bonus.material.work.service.SysWorkflowRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -44,6 +45,9 @@ public class DirectRotationImpl implements DirectRotationService {
@Resource(name = "workSiteDirectManageService") @Resource(name = "workSiteDirectManageService")
private WorkSiteDirectManageService workSiteDirectManageService; private WorkSiteDirectManageService workSiteDirectManageService;
@Resource
private SysWorkflowRecordService sysWorkflowRecordService;
@Override @Override
public List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo) { public List<SltAgreementInfo> getUseringData(SltAgreementInfo sltAgreementInfo) {
return mapper.getUseringData(sltAgreementInfo); return mapper.getUseringData(sltAgreementInfo);
@ -103,7 +107,8 @@ public class DirectRotationImpl implements DirectRotationService {
} else { } else {
return AjaxResult.error("保存失败"); return AjaxResult.error("保存失败");
} }
initAuditDir(id,code); sysWorkflowRecordService.addSysWorkflowRecord(id,code,TM_TASK_DIRECT.getTaskTypeId());
//initAuditDir(id,code);
return AjaxResult.success("保存成功"); return AjaxResult.success("保存成功");
@ -116,7 +121,7 @@ public class DirectRotationImpl implements DirectRotationService {
wf.setTaskId(id); wf.setTaskId(id);
wf.setTaskType(TM_TASK_DIRECT.getTaskTypeId()); wf.setTaskType(TM_TASK_DIRECT.getTaskTypeId());
wf.setTaskCode(code); wf.setTaskCode(code);
wf.setWorkflowId(16); wf.setWorkflowId(15);
wfMapper.addSysWorkflowRecord(wf); wfMapper.addSysWorkflowRecord(wf);
//2 生成直转审核人 //2 生成直转审核人
SysWorkflowRecordHistory his = new SysWorkflowRecordHistory(); SysWorkflowRecordHistory his = new SysWorkflowRecordHistory();
@ -128,6 +133,7 @@ public class DirectRotationImpl implements DirectRotationService {
his.setCreateBy(SecurityUtils.getUsername()); his.setCreateBy(SecurityUtils.getUsername());
his.setCreateTime(new Date()); his.setCreateTime(new Date());
hisMapper.addSysWorkflowRecordHistory(his) ; hisMapper.addSysWorkflowRecordHistory(his) ;
} }

View File

@ -3,11 +3,17 @@ package com.bonus.material.ma.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.biz.enums.HttpCodeEnum; import com.bonus.common.biz.enums.HttpCodeEnum;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.utils.StringUtils;
import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.material.lease.domain.vo.LeaseOutVo;
import com.bonus.material.lease.mapper.LeaseApplyDetailsMapper;
import com.bonus.material.lease.mapper.LeaseApplyInfoMapper;
import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.ma.domain.vo.MachineVo;
import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.material.purchase.config.RemoteConfig;
@ -40,6 +46,12 @@ public class MachineServiceImpl implements IMachineService
@Resource @Resource
private ScrapApplyDetailsMapper scrapApplyDetailsMapper; private ScrapApplyDetailsMapper scrapApplyDetailsMapper;
@Resource
private LeaseApplyInfoMapper leaseApplyInfoMapper;
@Resource
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
/** /**
* 查询机具设备管理 * 查询机具设备管理
* *
@ -183,8 +195,72 @@ public class MachineServiceImpl implements IMachineService
return AjaxResult.success(typeList); return AjaxResult.success(typeList);
} }
/**
* 查询电子标签信息
* @param machine
* @return
*/
@Override @Override
public List<Machine> getElectronicLabel(Machine machine) { public List<Machine> getElectronicLabel(Machine machine) {
return machineMapper.getElectronicLabel(machine); List<Machine> list = machineMapper.getElectronicLabel(machine);
if (CollectionUtils.isNotEmpty(list)) {
for (Machine dto : list) {
// 根据typeId查询信息
Machine info = machineMapper.selectHouse(dto);
if (info != null) {
if ("机具库".equals(info.getOwnHouse())) {
dto.setIsJj(0);
} else {
dto.setIsJj(1);
}
}
// 获取领料单详情
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(dto.getMaId());
if (CollectionUtils.isNotEmpty(details)) {
Long id = details.get(0).getId();
dto.setId(id);
}
}
}
return list;
}
/**
* 根据标签信息查询出库单
* @param leaseApplyInfo
* @return
*/
@Override
public LeaseApplyRequestVo getInfoByMaId(LeaseApplyInfo leaseApplyInfo) {
try {
LeaseApplyRequestVo leaseApplyRequestVo = new LeaseApplyRequestVo();
// 根据maCode查询maId
Long maId = machineMapper.selectMaId(leaseApplyInfo);
// 获取领料单详情
List<LeaseOutVo> details = leaseApplyDetailsMapper.selectByMaId(maId);
if (CollectionUtils.isNotEmpty(details)) {
leaseApplyRequestVo.setLeaseOutVoList(details);
Long id = details.get(0).getId();
leaseApplyInfo.setId(id);
}
LeaseApplyInfo optionalInfo = leaseApplyInfoMapper.selectLeaseApplyInfoById(leaseApplyInfo);
if (optionalInfo != null) {
leaseApplyRequestVo.setLeaseApplyInfo(optionalInfo);
}
return leaseApplyRequestVo;
} catch (Exception e) {
// 记录异常日志
throw new RuntimeException("Failed to select lease apply info", e);
}
}
/**
* 电子标签编码查询
* @param machine
* @return
*/
@Override
public List<Machine> getByMaCode(Machine machine) {
return machineMapper.getByMaCode(machine);
} }
} }

View File

@ -183,6 +183,17 @@ public class TypeServiceImpl implements ITypeService {
return list; return list;
} }
/**
* 查询一级列表
* @param maTypeVo
* @return
*/
@Override
public AjaxResult getListLevel(MaTypeVo maTypeVo) {
List<MaTypeVo> maTypeVos = typeMapper.getListLevel(maTypeVo);
return AjaxResult.success(maTypeVos);
}
@Override @Override
public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) { public List<MaTypeSelectVo> selectMaTypeListByHouseId(Long houseId) {

View File

@ -1,28 +1,50 @@
package com.bonus.material.record.service.impl; package com.bonus.material.record.service.impl;
import com.bonus.common.biz.domain.BmFileInfo; import com.bonus.common.biz.domain.BmFileInfo;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.security.utils.SecurityUtils; import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.record.mapper.DerateRecordQueryMapper; import com.bonus.material.record.mapper.DerateRecordQueryMapper;
import com.bonus.material.record.mapper.SltRecordQueryMapper; import com.bonus.material.record.mapper.SltRecordQueryMapper;
import com.bonus.material.record.service.IDerateReocrdQueryService; import com.bonus.material.record.service.IDerateReocrdQueryService;
import com.bonus.material.record.service.ISltReocrdQueryService; import com.bonus.material.record.service.ISltReocrdQueryService;
import com.bonus.material.settlement.domain.SltAgreementInfo; import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.settlement.domain.SltAgreementReduce; import com.bonus.material.settlement.domain.SltAgreementReduce;
import com.bonus.material.work.domain.SysWorkflowNode;
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.mapper.SysWorkflowConfigMapper;
import com.bonus.material.work.mapper.SysWorkflowNodeMapper;
import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @description 减免记录查询 * @description 减免记录查询
* @author hay * @author hay
* @date 2025/2/19 10:47 * @date 2025/2/19 10:47
*/ */
@Slf4j
@Service @Service
public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService { public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService {
@Resource @Resource
private DerateRecordQueryMapper mapper; private DerateRecordQueryMapper mapper;
@Resource
private SysWorkflowNodeMapper sysWorkflowNodeMapper;
@Resource
private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper;
@Resource
private SysWorkflowConfigMapper sysWorkflowConfigMapper;
@Override @Override
public List<SltAgreementReduce> getList(SltAgreementInfo bean) { public List<SltAgreementReduce> getList(SltAgreementInfo bean) {
return mapper.getList(bean); return mapper.getList(bean);
@ -32,7 +54,62 @@ public class DerateRecordQueryServiceImpl implements IDerateReocrdQueryService {
public List<SltAgreementReduce> getAuditList(SltAgreementInfo bean) { public List<SltAgreementReduce> getAuditList(SltAgreementInfo bean) {
Long userId = SecurityUtils.getUserId(); Long userId = SecurityUtils.getUserId();
bean.setUserId(userId); bean.setUserId(userId);
return mapper.getAuditList(bean); List<SltAgreementReduce> sltAgreementReduceList = mapper.getAuditList(bean);
try {
for (SltAgreementReduce sltAgreementReduceNew : sltAgreementReduceList) {
log.info("当前节点为{}",sltAgreementReduceNew.getNodeId());
SysWorkflowRecordHistory sysWorkflowRecordHistory = sysWorkflowRecordHistoryMapper.getWorkflowRecordHistoryByRecordId(sltAgreementReduceNew.getRecordId());
sltAgreementReduceNew.setNodeId(sysWorkflowRecordHistory.getNodeId());
//设置当前节点
if (1==sltAgreementReduceNew.getNodeSignType() && sysWorkflowRecordHistory.getNodeSort()==1){
sltAgreementReduceNew.setNodeId(sysWorkflowRecordHistory.getNextNodeId());
}
String configValue = sysWorkflowConfigMapper.selectConfigValueByNodeId(sltAgreementReduceNew.getNodeId());
SysWorkflowNode sysWorkflowNode = sysWorkflowNodeMapper.selectSysWorkflowNodeById(sltAgreementReduceNew.getNodeId());
sltAgreementReduceNew.setConfigValue(configValue);
//判断当前节点是否审核
sysWorkflowRecordHistory.setRecordId(sltAgreementReduceNew.getRecordId());
sysWorkflowRecordHistory.setNodeId(sltAgreementReduceNew.getNodeId());
List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory);
//判断是或签还是会签0:或签 1:会签
if (0==sysWorkflowNode.getNodeSignType()){
//当前节点已经审核需要修改节点值
if (sysWorkflowRecordHistoryList.get(0)!=null){
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
sltAgreementReduceNew.setNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
sltAgreementReduceNew.setConfigValue(configValueNew);
}
}else {
String[] ConfigValue = configValue.split(",");
List<String> filteredList = Arrays.stream(ConfigValue).collect(Collectors.toList());
for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : sysWorkflowRecordHistoryList) {
if (sysWorkflowRecordHistoryNew != null) {
// 过滤数组元素
filteredList = filteredList.stream()
.filter(value -> value != null && !value.equals(sysWorkflowRecordHistoryNew.getCreateBy()))
.collect(Collectors.toList());
sltAgreementReduceNew.setConfigValue(filteredList.toString());
}
}
//判断是否这个节点的所有人都审核
if (filteredList.size() == 0) {
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
sltAgreementReduceNew.setNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
sltAgreementReduceNew.setConfigValue(configValueNew);
} else {
if (sysWorkflowRecordHistoryList.size() > 0) {
sltAgreementReduceNew.setNodeId(sltAgreementReduceNew.getNodeId());
sltAgreementReduceNew.setConfigValue(filteredList.toString());
}
}
}
}
}catch (Exception e){
log.info("查询结果出错{}",e.getMessage());
throw new ServiceException("查询结果出错");
}
return sltAgreementReduceList;
} }
@Override @Override

View File

@ -228,8 +228,7 @@ public class SltAgreementInfo extends BaseEntity {
private BigDecimal scrapCost; private BigDecimal scrapCost;
private BigDecimal loseCost; private BigDecimal loseCost;
private BigDecimal reductionCost; private BigDecimal reductionCost;
//结算费用 //结算费用
private BigDecimal totalCostAll; private BigDecimal totalCostAll;
} }

View File

@ -134,4 +134,19 @@ public class SltAgreementReduce extends BaseEntity {
private Integer proId; private Integer proId;
private String projectName; private String projectName;
@ApiModelProperty(value = "本流程节点id")
private Integer nodeId;
@ApiModelProperty(value = "下个流程节点id")
private Integer nextNodeId;
@ApiModelProperty(value = "流程配置值")
private String configValue;
@ApiModelProperty(value = "所属记录")
private Integer recordId;
@ApiModelProperty(value = "流程节点签名方式 0:或签 1:会签")
private Integer nodeSignType;
} }

View File

@ -71,4 +71,11 @@ public interface TmTaskAgreementMapper {
* @return * @return
*/ */
Long selectAgreementIdByTaskId(Long taskId); Long selectAgreementIdByTaskId(Long taskId);
/**
* 根据发布任务ID获取协议ID
* @param publishTask
* @return
*/
String selectAgreementId(String publishTask);
} }

View File

@ -1,22 +1,10 @@
package com.bonus.material.work.controller; package com.bonus.material.work.controller;
import cn.hutool.core.convert.Convert;
import com.bonus.common.biz.config.ListPagingUtil;
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.common.core.utils.ServletUtils;
import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.common.core.web.page.TableDataInfo;
import com.bonus.common.log.annotation.SysLog;
import com.bonus.common.log.enums.OperaType;
import com.bonus.common.security.utils.SecurityUtils; import com.bonus.common.security.utils.SecurityUtils;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.lease.domain.vo.LeaseApplyRequestVo;
import com.bonus.material.lease.service.ILeaseTaskService;
import com.bonus.material.ma.domain.DirectApplyInfo; import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.ma.domain.DirectApplyInfoDetails;
import com.bonus.material.ma.domain.Type;
import com.bonus.material.settlement.domain.SltAgreementInfo;
import com.bonus.material.work.domain.DirectAudit; import com.bonus.material.work.domain.DirectAudit;
import com.bonus.material.work.service.IDirectAuditService; import com.bonus.material.work.service.IDirectAuditService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -24,7 +12,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -61,7 +48,7 @@ public class DirectAuditController extends BaseController {
@ApiOperation(value = "查看审批详情") /* @ApiOperation(value = "查看审批详情")
@GetMapping("/getAuditInfo") @GetMapping("/getAuditInfo")
public AjaxResult getAuditInfo(DirectAudit du) { public AjaxResult getAuditInfo(DirectAudit du) {
try { try {
@ -69,12 +56,12 @@ public class DirectAuditController extends BaseController {
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.success(new DirectApplyInfo()); return AjaxResult.success(new DirectApplyInfo());
} }
} }*/
/** /**
* 审核直转申请 * 审核直转申请
*/ */
@ApiOperation(value = "审核直转申请") /* @ApiOperation(value = "审核直转申请")
@PostMapping("/auditDir") @PostMapping("/auditDir")
public AjaxResult auditDir(@RequestBody DirectAudit audit) { public AjaxResult auditDir(@RequestBody DirectAudit audit) {
try { try {
@ -83,5 +70,5 @@ public class DirectAuditController extends BaseController {
return AjaxResult.error("保存失败"); return AjaxResult.error("保存失败");
} }
} }
*/
} }

View File

@ -20,7 +20,7 @@ public class SysWorkflowTypeController extends BaseController {
@Resource @Resource
private SysWorkflowTypeService sysWorkflowTypeServicel; private SysWorkflowTypeService sysWorkflowTypeService;
/** /**
* 审批类型列表 * 审批类型列表
@ -31,7 +31,7 @@ public class SysWorkflowTypeController extends BaseController {
{ {
try { try {
startPage(); startPage();
List<SysWorkflowType> list = sysWorkflowTypeServicel.selectSysWorkflowTypeList(sysWorkflowType); List<SysWorkflowType> list = sysWorkflowTypeService.selectSysWorkflowTypeList(sysWorkflowType);
return getDataTable(list); return getDataTable(list);
}catch (Exception e){ }catch (Exception e){
return getDataTableError(null); return getDataTableError(null);
@ -46,7 +46,7 @@ public class SysWorkflowTypeController extends BaseController {
public AjaxResult add(@RequestBody SysWorkflowType sysWorkflowType) public AjaxResult add(@RequestBody SysWorkflowType sysWorkflowType)
{ {
try { try {
sysWorkflowTypeServicel.addSysWorkflowType(sysWorkflowType); sysWorkflowTypeService.addSysWorkflowType(sysWorkflowType);
return new AjaxResult(200,"新增成功!"); return new AjaxResult(200,"新增成功!");
}catch (Exception e){ }catch (Exception e){
return error(); return error();
@ -61,7 +61,7 @@ public class SysWorkflowTypeController extends BaseController {
public AjaxResult delete(@RequestBody SysWorkflowType sysWorkflowType) public AjaxResult delete(@RequestBody SysWorkflowType sysWorkflowType)
{ {
try { try {
sysWorkflowTypeServicel.deleteSysWorkflowType(sysWorkflowType); sysWorkflowTypeService.deleteSysWorkflowType(sysWorkflowType);
return new AjaxResult(200,"删除成功!"); return new AjaxResult(200,"删除成功!");
}catch (Exception e){ }catch (Exception e){
return error(); return error();
@ -76,7 +76,7 @@ public class SysWorkflowTypeController extends BaseController {
public AjaxResult update(@RequestBody SysWorkflowType sysWorkflowType) public AjaxResult update(@RequestBody SysWorkflowType sysWorkflowType)
{ {
try { try {
sysWorkflowTypeServicel.updateSysWorkflowType(sysWorkflowType); sysWorkflowTypeService.updateSysWorkflowType(sysWorkflowType);
return new AjaxResult(200,"修改成功!"); return new AjaxResult(200,"修改成功!");
}catch (Exception e){ }catch (Exception e){
return error(); return error();

View File

@ -40,4 +40,9 @@ public class SysWorkflowConfig {
* 创建人 * 创建人
*/ */
private String keyWord; private String keyWord;
/**
* 角色信息
*/
private String roleIds;
} }

View File

@ -92,4 +92,9 @@ public class SysWorkflowNode {
*/ */
private Integer nodeId; private Integer nodeId;
private String nodeLabel; private String nodeLabel;
/**
* 角色信息
*/
private String roleIds;
} }

View File

@ -61,4 +61,9 @@ public class SysWorkflowRecordHistory {
* 所属流程类型ID * 所属流程类型ID
*/ */
private Integer typeId; private Integer typeId;
/**
* 流程节点顺序
*/
private Integer nodeSort;
} }

View File

@ -16,4 +16,6 @@ public interface SysWorkflowNodeMapper {
int updateSysWorkflowNode(SysWorkflowNode sysWorkflowNode); int updateSysWorkflowNode(SysWorkflowNode sysWorkflowNode);
List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode); List<SysWorkflowNode> listByTaskId(SysWorkflowNode sysWorkflowNode);
SysWorkflowNode selectSysWorkflowNodeById(Integer nodeId);
} }

View File

@ -11,4 +11,6 @@ public interface SysWorkflowRecordHistoryMapper {
int addSysWorkflowRecordHistory(SysWorkflowRecordHistory sysWorkflowRecordHistory); int addSysWorkflowRecordHistory(SysWorkflowRecordHistory sysWorkflowRecordHistory);
List<SysWorkflowRecordHistory> seleteSysWorkflowRecordHistory(SysWorkflowRecordHistory sysWorkflowRecordHistory); List<SysWorkflowRecordHistory> seleteSysWorkflowRecordHistory(SysWorkflowRecordHistory sysWorkflowRecordHistory);
SysWorkflowRecordHistory getWorkflowRecordHistoryByRecordId(Integer recordId);
} }

View File

@ -7,24 +7,15 @@ import com.bonus.material.ma.domain.DirectApplyInfo;
import com.bonus.material.work.domain.DirectAudit; import com.bonus.material.work.domain.DirectAudit;
import com.bonus.material.work.domain.SysWorkflowNode; import com.bonus.material.work.domain.SysWorkflowNode;
import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory; import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.mapper.DirectAuditMapper; import com.bonus.material.work.mapper.*;
import com.bonus.material.work.mapper.SysWorkflowNodeMapper;
import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper;
import com.bonus.material.work.mapper.SysWorkflowRecordMapper;
import com.bonus.material.work.service.IDirectAuditService; import com.bonus.material.work.service.IDirectAuditService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -40,17 +31,68 @@ public class DirectAuditImpl implements IDirectAuditService {
private DirectAuditMapper mapper; private DirectAuditMapper mapper;
@Resource @Resource
private SysWorkflowNodeMapper wfnMapper; private SysWorkflowNodeMapper sysWorkflowNodeMapper;
@Resource @Resource
private SysWorkflowRecordHistoryMapper hisMapper; private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper;
@Resource @Resource
private SysWorkflowRecordMapper wfrMapper; private SysWorkflowConfigMapper sysWorkflowConfigMapper;
@Override @Override
public List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo) { public List<DirectApplyInfo> getList(DirectApplyInfo directApplyInfo) {
return mapper.getList(directApplyInfo);
List<DirectApplyInfo> directApplyInfoList = mapper.getList(directApplyInfo);
for (DirectApplyInfo directApplyInfoNew : directApplyInfoList) {
log.info("当前节点为{}",directApplyInfoNew.getNodeId());
SysWorkflowRecordHistory sysWorkflowRecordHistory = sysWorkflowRecordHistoryMapper.getWorkflowRecordHistoryByRecordId(directApplyInfoNew.getRecordId());
directApplyInfoNew.setNodeId(sysWorkflowRecordHistory.getNodeId());
//设置当前节点
if (1==directApplyInfoNew.getNodeSignType() && sysWorkflowRecordHistory.getNodeSort()==1){
directApplyInfoNew.setNodeId(sysWorkflowRecordHistory.getNextNodeId());
}
String configValue = sysWorkflowConfigMapper.selectConfigValueByNodeId(directApplyInfoNew.getNodeId());
SysWorkflowNode sysWorkflowNode = sysWorkflowNodeMapper.selectSysWorkflowNodeById(directApplyInfoNew.getNodeId());
directApplyInfoNew.setConfigValue(configValue);
//判断当前节点是否审核
sysWorkflowRecordHistory.setRecordId(directApplyInfoNew.getRecordId());
sysWorkflowRecordHistory.setNodeId(directApplyInfoNew.getNodeId());
List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory);
//判断是或签还是会签0:或签 1:会签
if (0==sysWorkflowNode.getNodeSignType()){
//当前节点已经审核需要修改节点值
if (sysWorkflowRecordHistoryList.get(0)!=null){
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
directApplyInfoNew.setNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
directApplyInfoNew.setConfigValue(configValueNew);
}
}else {
String[] ConfigValue = configValue.split(",");
List<String> filteredList = Arrays.stream(ConfigValue).collect(Collectors.toList());
for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : sysWorkflowRecordHistoryList) {
if (sysWorkflowRecordHistoryNew != null) {
// 过滤数组元素
filteredList = filteredList.stream()
.filter(value -> value != null && !value.equals(sysWorkflowRecordHistoryNew.getCreateBy()))
.collect(Collectors.toList());
directApplyInfoNew.setConfigValue(filteredList.toString());
}
}
//判断是否这个节点的所有人都审核
if (filteredList.size() == 0) {
String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
directApplyInfoNew.setNodeId(sysWorkflowRecordHistoryList.get(0).getNextNodeId());
directApplyInfoNew.setConfigValue(configValueNew);
} else {
if (sysWorkflowRecordHistoryList.size() > 0) {
directApplyInfoNew.setNodeId(directApplyInfoNew.getNodeId());
directApplyInfoNew.setConfigValue(filteredList.toString());
}
}
}
}
return directApplyInfoList;
} }
@ -102,7 +144,7 @@ public class DirectAuditImpl implements IDirectAuditService {
String isAccept = audit.getIsAccept(); String isAccept = audit.getIsAccept();
String remark = audit.getRemark(); String remark = audit.getRemark();
List<SysWorkflowNode> nodes = wfnMapper.selectSysWorkflowNodeList(node); List<SysWorkflowNode> nodes = sysWorkflowNodeMapper.selectSysWorkflowNodeList(node);
int flowId = audit.getFlowId(); int flowId = audit.getFlowId();
if(nodes !=null && nodes.size()>0){ if(nodes !=null && nodes.size()>0){
@ -134,7 +176,7 @@ public class DirectAuditImpl implements IDirectAuditService {
his.setCreateBy(SecurityUtils.getUsername()); his.setCreateBy(SecurityUtils.getUsername());
his.setCreateTime(new Date()); his.setCreateTime(new Date());
his.setRemark(remark); his.setRemark(remark);
hisMapper.addSysWorkflowRecordHistory(his) ; sysWorkflowRecordHistoryMapper.addSysWorkflowRecordHistory(his) ;
} }

View File

@ -15,8 +15,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.stream.Collectors;
@Service @Service
public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService { public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
@ -55,8 +56,11 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
int count = sysWorkflowNodeMapper.addSysWorkflowNode(sysWorkflowNode); int count = sysWorkflowNodeMapper.addSysWorkflowNode(sysWorkflowNode);
SysWorkflowConfig sysWorkflowConfig = new SysWorkflowConfig(); SysWorkflowConfig sysWorkflowConfig = new SysWorkflowConfig();
sysWorkflowConfig.setNodeId(sysWorkflowNode.getId()); sysWorkflowConfig.setNodeId(sysWorkflowNode.getId());
sysWorkflowConfig.setConfigType(sysWorkflowNode.getNodeSignType()); sysWorkflowConfig.setConfigType(sysWorkflowNode.getNodeSignConfig());
sysWorkflowConfig.setConfigValue(sysWorkflowNode.getConfigValues()); sysWorkflowConfig.setConfigValue(sysWorkflowNode.getConfigValues());
if (sysWorkflowNode.getNodeSignConfig()==0){
sysWorkflowConfig.setRoleIds(sysWorkflowNode.getRoleIds());
}
//新增审核详情表信息 //新增审核详情表信息
sysWorkflowConfigMapper.addSysWorkflowConfig(sysWorkflowConfig); sysWorkflowConfigMapper.addSysWorkflowConfig(sysWorkflowConfig);
return count; return count;
@ -90,8 +94,11 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
sysWorkflowConfig.setNodeId(sysWorkflowNode.getId()); sysWorkflowConfig.setNodeId(sysWorkflowNode.getId());
sysWorkflowConfigMapper.deleteSysWorkflowConfig(sysWorkflowConfig); sysWorkflowConfigMapper.deleteSysWorkflowConfig(sysWorkflowConfig);
sysWorkflowConfig.setNodeId(sysWorkflowNode.getId()); sysWorkflowConfig.setNodeId(sysWorkflowNode.getId());
sysWorkflowConfig.setConfigType(sysWorkflowNode.getNodeSignType()); sysWorkflowConfig.setConfigType(sysWorkflowNode.getNodeSignConfig());
sysWorkflowConfig.setConfigValue(sysWorkflowNode.getConfigValues()); sysWorkflowConfig.setConfigValue(sysWorkflowNode.getConfigValues());
if (sysWorkflowNode.getNodeSignConfig()==0){
sysWorkflowConfig.setRoleIds(sysWorkflowNode.getRoleIds());
}
//新增审核详情表信息 //新增审核详情表信息
sysWorkflowConfigMapper.addSysWorkflowConfig(sysWorkflowConfig); sysWorkflowConfigMapper.addSysWorkflowConfig(sysWorkflowConfig);
return count; return count;
@ -106,42 +113,54 @@ public class SysWorkflowNodeServiceImpl implements SysWorkflowNodeService {
sysWorkflowRecordHistory.setRecordId(SysWorkflowNode.getRecordId()); sysWorkflowRecordHistory.setRecordId(SysWorkflowNode.getRecordId());
sysWorkflowRecordHistory.setNodeId(SysWorkflowNode.getNodeId()); sysWorkflowRecordHistory.setNodeId(SysWorkflowNode.getNodeId());
List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory); List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory);
if (StringUtils.isNotNull(sysWorkflowRecordHistoryList)){ if (sysWorkflowRecordHistoryList.size()>0){
//判断是或签还是会签0:或签 1:会签 //判断是或签还是会签0:或签 1:会签
if (0==SysWorkflowNode.getNodeSignType()){ if (0==SysWorkflowNode.getNodeSignType()){
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryList.get(0).getIsAccept()); SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryList.get(0).getIsAccept());
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryList.get(0).getCreateTime()); SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryList.get(0).getCreateTime());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryList.get(0).getRemark()); SysWorkflowNode.setRemark(sysWorkflowRecordHistoryList.get(0).getRemark());
}else { }else {
String[] ConfigValue =SysWorkflowNode.getConfigValues().split(","); String[] configValue = SysWorkflowNode.getConfigValues().split(",");
List<String> filteredList = Arrays.stream(configValue).collect(Collectors.toList());
// 过滤数组元素 // 过滤数组元素
for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : sysWorkflowRecordHistoryList) { for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : sysWorkflowRecordHistoryList) {
/*List<String> filteredList = Arrays.stream(ConfigValue) // 过滤数组元素
.filter(value -> value.equals(sysWorkflowRecordHistoryNew.getCreateBy())) filteredList = filteredList.stream()
.filter(value ->value != null && !value.equals(sysWorkflowRecordHistoryNew.getCreateBy()))
.collect(Collectors.toList()); .collect(Collectors.toList());
//判断是不是所有人都审核完成
if(filteredList.size()==0){
}*/
//查看当前人是否审核
if(userId.toString().equals(sysWorkflowRecordHistoryNew.getCreateBy())){
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryNew.getIsAccept());
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryNew.getCreateTime());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryNew.getRemark());
} }
//查看别人审核是否有驳回的 //获取所有的审核状态
if (sysWorkflowRecordHistoryNew.getIsAccept().equals(2)){ List<Integer> isAcceptList =sysWorkflowRecordHistoryList.stream()
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryNew.getIsAccept()); .map(SysWorkflowRecordHistory::getIsAccept)
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryNew.getCreateTime()); .collect(Collectors.toList());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryNew.getRemark()); //判断是否有人是驳回
if(isAcceptList.contains(2)){
//获取驳回信息
List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryListNew = sysWorkflowRecordHistoryList.stream()
.filter(value ->value != null && 2==(value.getIsAccept()))
.collect(Collectors.toList());
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryListNew.get(0).getIsAccept());
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryListNew.get(0).getCreateTime());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryListNew.get(0).getRemark());
}else {
//获取当前人的审核信息
List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryListNew = sysWorkflowRecordHistoryList.stream()
.filter(value ->value != null && userId.toString().equals(value.getCreateBy()))
.collect(Collectors.toList());
//判断当前人是否是这个节点的审核人
if (!sysWorkflowRecordHistoryListNew.isEmpty()){
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryListNew.get(0).getIsAccept());
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryListNew.get(0).getCreateTime());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryListNew.get(0).getRemark());
}else {
SysWorkflowNode.setIsAccept(sysWorkflowRecordHistoryList.get(0).getIsAccept());
SysWorkflowNode.setCreateTime(sysWorkflowRecordHistoryList.get(0).getCreateTime());
SysWorkflowNode.setRemark(sysWorkflowRecordHistoryList.get(0).getRemark());
} }
} }
}
} }
} }
}
return sysWorkflowNodeList; return sysWorkflowNodeList;
} }
} }

View File

@ -11,10 +11,7 @@ import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory; import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.domain.SysWorkflowType; import com.bonus.material.work.domain.SysWorkflowType;
import com.bonus.material.work.domain.dto.SysWorkflowAuditDto; import com.bonus.material.work.domain.dto.SysWorkflowAuditDto;
import com.bonus.material.work.mapper.SysWorkflowNodeMapper; import com.bonus.material.work.mapper.*;
import com.bonus.material.work.mapper.SysWorkflowRecordHistoryMapper;
import com.bonus.material.work.mapper.SysWorkflowRecordMapper;
import com.bonus.material.work.mapper.SysWorkflowTypeMapper;
import com.bonus.material.work.service.SysWorkflowRecordHistoryService; import com.bonus.material.work.service.SysWorkflowRecordHistoryService;
import com.bonus.material.work.service.SysWorkflowRecordService; import com.bonus.material.work.service.SysWorkflowRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -22,7 +19,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
@Slf4j @Slf4j
@Service @Service
@ -35,7 +34,7 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
private ISltAgreementReduceService sltAgreementReduceService; private ISltAgreementReduceService sltAgreementReduceService;
@Resource @Resource
private SysWorkflowTypeMapper sysWorkflowTypeMapper; private SysWorkflowConfigMapper sysWorkflowConfigMapper;
@Resource @Resource
private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper; private SysWorkflowRecordHistoryMapper sysWorkflowRecordHistoryMapper;
@ -80,36 +79,56 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
} }
//判断是否是最后一级 //判断是否是最后一级
if (sysWorkflowNodeList.get(sysWorkflowNodeList.size()-1).getId().equals(sysWorkflowRecordHistory.getNodeId())){ if (sysWorkflowNodeList.get(sysWorkflowNodeList.size()-1).getId().equals(sysWorkflowRecordHistory.getNodeId())){
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord(); //判断最后节点是否所有人都审核完成
sysWorkflowRecord.setTaskId(sysWorkflowRecordHistory.getTaskId()); sysWorkflowRecordHistory.setRecordId(sysWorkflowRecordHistory.getRecordId());
sysWorkflowRecord.setWorkflowStatus(2); sysWorkflowRecordHistory.setNodeId(sysWorkflowRecordHistory.getNodeId());
sysWorkflowRecordMapper.updateSysWorkflowRecord(sysWorkflowRecord); //获取这个节点所有审核信息
System.out.println("-------------节点更新任务信息为完成-------------"); List<SysWorkflowRecordHistory> sysWorkflowRecordHistoryList = sysWorkflowRecordHistoryMapper.seleteSysWorkflowRecordHistory(sysWorkflowRecordHistory);
SysWorkflowAuditDto sysWorkflowRecodeInfo = sysWorkflowRecordMapper.getSysWorkflowRecodeByTaskId(sysWorkflowRecordHistory.getTaskId()); //获取该节点需要审核人员信息
if (sysWorkflowRecodeInfo == null) { String configValueNew = sysWorkflowConfigMapper.selectConfigValueByNodeId(sysWorkflowRecordHistory.getNodeId());
throw new ServiceException("任务类型为空"); sysWorkflowNode = sysWorkflowNodeList.get(sysWorkflowNodeList.size()-1);
String[] ConfigValue = configValueNew.split(",");
List<String> filteredList = Arrays.stream(ConfigValue).collect(Collectors.toList());
for (SysWorkflowRecordHistory sysWorkflowRecordHistoryNew : sysWorkflowRecordHistoryList) {
if (sysWorkflowRecordHistoryNew!=null){
// 过滤数组元素
filteredList = filteredList.stream()
.filter(value ->value != null && !value.equals(sysWorkflowRecordHistoryNew.getCreateBy()))
.collect(Collectors.toList());
//判断是否这个节点的所有人都审核
if ((filteredList.size()==0&& sysWorkflowNode.getNodeSignType()==1 )||sysWorkflowNode.getNodeSignType()==0){
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord();
sysWorkflowRecord.setTaskId(sysWorkflowRecordHistory.getTaskId());
sysWorkflowRecord.setWorkflowStatus(2);
sysWorkflowRecordMapper.updateSysWorkflowRecord(sysWorkflowRecord);
System.out.println("-------------节点更新任务信息为完成-------------");
SysWorkflowAuditDto sysWorkflowRecodeInfo = sysWorkflowRecordMapper.getSysWorkflowRecodeByTaskId(sysWorkflowRecordHistory.getTaskId());
if (sysWorkflowRecodeInfo == null) {
throw new ServiceException("任务类型为空");
}
// 根据任务类型修改业务状态
switch (sysWorkflowRecodeInfo.getTaskType()) {
// 领料任务:2
case 2:
//修改业务状态
TmTask tmTask = new TmTask();
tmTask.setTaskId(sysWorkflowRecordHistory.getTaskId().longValue());
tmTask.setTaskStatus(1);
tmTaskMapper.updateTmTask(tmTask);
System.out.println("-------------执行了最后业务办理领料-------------");
break;
// 费用减免:13
case 13:
sltAgreementReduceService.audit(sysWorkflowRecodeInfo);
System.out.println("-------------执行了最后业务办理费用减免-------------");
break;
// 工地直转16
case 16:
break;
}
}
}
} }
// 根据任务类型修改业务状态
switch (sysWorkflowRecodeInfo.getTaskType()) {
// 领料任务:2
case 2:
//修改业务状态
TmTask tmTask = new TmTask();
tmTask.setTaskId(sysWorkflowRecordHistory.getTaskId().longValue());
tmTask.setTaskStatus(1);
tmTaskMapper.updateTmTask(tmTask);
System.out.println("-------------执行了最后业务办理领料-------------");
break;
// 费用减免:13
case 13:
sltAgreementReduceService.audit(sysWorkflowRecodeInfo);
System.out.println("-------------执行了最后业务办理费用减免-------------");
break;
// 工地直转16
case 16:
break;
}
} }
}else { }else {
SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord(); SysWorkflowRecord sysWorkflowRecord = new SysWorkflowRecord();
@ -119,4 +138,5 @@ public class SysWorkflowRecordHistoryServiceImpl implements SysWorkflowRecordHis
} }
return 0; return 0;
} }
} }

View File

@ -113,9 +113,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND mt1.del_flag = '0' AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0' AND mt2.del_flag = '0'
LEFT JOIN lease_apply_info lai ON lod.parent_id = lai.id LEFT JOIN slt_agreement_info sai on lod.type_id = sai.type_id
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_agreement_info ba ON tta.agreement_id = ba.agreement_id
WHERE WHERE
1 = 1 and mm.ma_status = '2' and mm.type_id = #{typeId} 1 = 1 and mm.ma_status = '2' and mm.type_id = #{typeId}
AND ba.unit_id = #{unitId} AND ba.unit_id = #{unitId}

View File

@ -321,11 +321,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHEN bs.out_type = '2' THEN '二维码' WHEN bs.out_type = '2' THEN '二维码'
WHEN bs.out_type = '3' THEN '标准箱' WHEN bs.out_type = '3' THEN '标准箱'
ELSE '未知入库方式' ELSE '未知入库方式'
END AS outStyle END AS outStyle,
mt3.type_id as firstTypeId,
mt2.type_id as secondTypeId
FROM FROM
bm_storage_log bs bm_storage_log bs
LEFT JOIN tm_task_agreement tta ON tta.task_id = bs.task_id LEFT JOIN bm_agreement_info bai ON bai.agreement_id = bs.agreement_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id LEFT JOIN bm_project bpl ON bpl.pro_id = bai.project_id
LEFT JOIN sys_dept sd on sd.dept_id = bpl.imp_unit LEFT JOIN sys_dept sd on sd.dept_id = bpl.imp_unit
LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit bui ON bui.unit_id = bai.unit_id
@ -333,6 +334,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND mt.del_flag = '0' AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0' AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
AND mt3.del_flag = '0'
LEFT JOIN tm_task tt ON bs.task_id = tt.task_id LEFT JOIN tm_task tt ON bs.task_id = tt.task_id
WHERE bs.out_num != 0 WHERE bs.out_num != 0
<if test="unitId != null"> <if test="unitId != null">
@ -358,6 +363,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="typeModelName != null and typeModelName != ''"> <if test="typeModelName != null and typeModelName != ''">
and bs.type_model_name like CONCAT('%',#{typeModelName},'%') and bs.type_model_name like CONCAT('%',#{typeModelName},'%')
</if> </if>
<if test="firstTypeId != null ">
and mt3.type_id = #{firstTypeId}
</if>
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND bs.create_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59')
</if> </if>

View File

@ -297,6 +297,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name AS typeModelName, mt.type_name AS typeModelName,
mt.unit_name AS unit, mt.unit_name AS unit,
lod.out_num AS num, lod.out_num AS num,
lod.ma_id AS maId,
mm.ma_code AS maCode, mm.ma_code AS maCode,
mt.rated_load AS ratedLoad, mt.rated_load AS ratedLoad,
mt.test_load AS testLoad, mt.test_load AS testLoad,
@ -383,4 +384,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ORDER BY ORDER BY
lod.create_time DESC lod.create_time DESC
</select> </select>
<select id="selectByMaId" resultType="com.bonus.material.lease.domain.vo.LeaseOutVo">
SELECT
lod.parent_id AS id,
mt1.type_name AS typeName,
mt.type_name AS typeModelName,
mt.unit_name AS unit,
lod.out_num AS num,
mm.ma_code AS maCode,
mt.rated_load AS ratedLoad,
mt.test_load AS testLoad,
mt.holding_time AS holdingTime,
DATE(lod.create_time) AS testTime,
'合格' AS checkResult,
lad.remark AS remark,
DATE(DATE_SUB(DATE_ADD(lod.create_time, INTERVAL 1 YEAR), INTERVAL 1 DAY)) AS nextTestTime -- 计算 nextTestTime
FROM
lease_out_details lod
LEFT JOIN ma_type mt ON lod.type_id = mt.type_id AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0'
LEFT JOIN ma_machine mm ON lod.ma_id = mm.ma_id
LEFT JOIN lease_apply_details lad ON lod.type_id = lad.type_id
LEFT JOIN purchase_check_details pcd ON lod.type_id = pcd.type_id
WHERE lod.ma_id = #{maId}
GROUP BY lod.type_id, mm.ma_code
ORDER BY lod.create_time DESC
</select>
<select id="getDetailsPublish" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT
lpd.id AS id,
lpd.parent_id AS parentId,
mt1.type_name AS maTypeName,
mt.type_name AS typeName,
mt.unit_name AS unitName,
lpd.new_type AS typeId,
IFNULL( lpd.num, 0 ) AS preNum,
IFNULL( lpd.num, 0 ) - IFNULL( SUM( lod.out_num ), 0 ) AS outNum,
IFNULL( SUM( lod.out_num ), 0 ) AS alNum,
lpd.publish_task AS publishTask
FROM
lease_publish_details lpd
LEFT JOIN ma_type mt ON lpd.new_type = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN lease_out_details lod ON lpd.parent_id = lod.parent_id
AND lpd.publish_task = lod.publish_task
WHERE
lpd.publish_task = #{publishTask}
<if test="keyWord != null and keyWord != ''">
AND (mt1.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%')
OR mt.type_name LIKE CONCAT(CONCAT('%', #{keyWord}), '%'))
</if>
GROUP BY
lpd.new_type
</select>
</mapper> </mapper>

View File

@ -247,4 +247,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join sys_dept sd on su.dept_id = sd.dept_id and sd.del_flag = 0 left join sys_dept sd on su.dept_id = sd.dept_id and sd.del_flag = 0
where su.user_id = #{directAuditBy} and su.del_flag = 0 where su.user_id = #{directAuditBy} and su.del_flag = 0
</select> </select>
<select id="selectPublishList" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
SELECT
lai.id AS id,
lai.code AS code,
lai.create_by AS createBy,
lai.create_time AS createTime,
sd.dept_name AS impUnitName,
bp.contract_part AS contractPart,
lpd.lease_person AS leasePerson,
lpd.phone AS phone,
lpd.unit_id AS leaseUnitId,
lpd.project_id AS leaseProjectId,
bu.unit_name AS leaseUnit,
bp.pro_name AS leaseProject,
bai.agreement_code AS agreementCode,
IFNULL( sum( lpd.num ), 0 ) AS preCountNum,
IFNULL( sum( lod.out_num ), 0 ) AS alNum,
GROUP_CONCAT( mt1.type_name ) AS maTypeNames,
lpd.publish_task AS publishTask
FROM
lease_publish_details lpd
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
LEFT JOIN lease_out_details lod ON lpd.parent_id = lod.parent_id
AND lpd.publish_task = lod.publish_task
LEFT JOIN bm_unit bu ON bu.unit_id = lpd.unit_id
LEFT JOIN bm_project bp ON bp.pro_id = lpd.project_id
LEFT JOIN sys_dept sd ON sd.dept_id = bp.imp_unit
LEFT JOIN ma_type mt ON lpd.new_type = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN bm_agreement_info bai ON lpd.unit_id = bai.unit_id
AND lpd.project_id = bai.project_id
GROUP BY
lpd.publish_task
ORDER BY
lpd.create_time DESC
</select>
</mapper> </mapper>

View File

@ -107,6 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="carCode!= null"> <if test="carCode!= null">
car_code, car_code,
</if> </if>
<if test="publishTask != null and publishTask != ''">
publish_task,
</if>
create_time, create_time,
update_time update_time
</trim> </trim>
@ -141,6 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="carCode!= null"> <if test="carCode!= null">
#{carCode}, #{carCode},
</if> </if>
<if test="publishTask != null and publishTask != ''">
#{publishTask},
</if>
NOW(), NOW(),
NOW() NOW()
</trim> </trim>

View File

@ -38,6 +38,9 @@
<result property="leaseSignUrl" column="lease_sign_url"/> <result property="leaseSignUrl" column="lease_sign_url"/>
<result property="leaseSignType" column="lease_sign_type"/> <result property="leaseSignType" column="lease_sign_type"/>
<result property="applyCode" column="apply_code"/> <result property="applyCode" column="apply_code"/>
<result property="nextNodeId" column="next_node_id"/>
<result property="nodeId" column="node_id"/>
<result property="recordId" column="record_id"/>
</resultMap> </resultMap>
<resultMap type="com.bonus.material.lease.domain.LeaseApplyDetails" id="LeaseApplyDetailsResult"> <resultMap type="com.bonus.material.lease.domain.LeaseApplyDetails" id="LeaseApplyDetailsResult">
@ -262,6 +265,44 @@
</foreach> </foreach>
</insert> </insert>
<insert id="addPublish">
insert into lease_publish_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,</if>
<if test="typeId != null">type_id,</if>
<if test="newTypeId != null">new_type,</if>
<if test="num != null">num,</if>
<if test="leasePerson != null">lease_person,</if>
<if test="phone != null">phone,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="unitId != null">unit_id,</if>
<if test="projectId != null">project_id,</if>
<if test="monthOrder != null">month_order,</if>
<if test="publishTask != null and publishTask != ''">publish_task,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},</if>
<if test="typeId != null">#{typeId},</if>
<if test="newTypeId != null">#{newTypeId},</if>
<if test="num != null">#{num},</if>
<if test="leasePerson != null">#{leasePerson},</if>
<if test="phone != null">#{phone},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="unitId != null">#{unitId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="monthOrder != null">#{monthOrder},</if>
<if test="publishTask != null and publishTask != ''">#{publishTask},</if>
</trim>
</insert>
<update id="updateLeaseApplyInfo"> <update id="updateLeaseApplyInfo">
update lease_apply_info update lease_apply_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
@ -465,14 +506,15 @@
lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark, lai.dept_audit_remark, lai.direct_audit_by, lai.direct_audit_time, lai.direct_audit_remark,
lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id, lai.create_by, lai.create_time, lai.update_by, lai.update_time, lai.remark, lai.company_id,
lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url, lai.direct_id, lai.lease_type, lai.estimate_lease_time, lai.cost_bearing_party, lai.lease_sign_url,
lai.lease_sign_type,tt.task_id as taskId, tt.task_id as taskId,swn.node_sign_type as nodeSignType,
bai.unit_id,bai.project_id,bu.unit_name, bp.pro_name,bai.agreement_id, bai.agreement_code, swr.workflow_status as taskStatus, lai.unit_id,lai.project_id,bu.unit_name, bp.pro_name, swr.workflow_status as taskStatus,bai.agreement_code,
swrs.node_id,swrs.next_node_id,swrs.record_id,
case tt.task_status case tt.task_status
when 0 then '待审核' when 0 then '待审核'
when 1 then '执行中' when 1 then '待审核'
when 2 then '执行完成' when 2 then '审核中'
when 3 then '执行中断' when 3 then '已完成'
when 4 then '已完成'
end as taskStatusName, end as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum, IFNULL(sum(lad.al_num),0) as alNum,
@ -485,8 +527,8 @@
left join lease_apply_details lad on lai.id = lad.parent_id left join lease_apply_details lad on lai.id = lad.parent_id
left join tm_task_agreement tta on lai.task_id = tta.task_id left join tm_task_agreement tta on lai.task_id = tta.task_id
left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id left join bm_agreement_info bai on tta.agreement_id = bai.agreement_id
left join bm_unit bu on bu.unit_id = bai.unit_id left join bm_unit bu on bu.unit_id = lai.unit_id
left join bm_project bp on bp.pro_id = bai.project_id left join bm_project bp on bp.pro_id = lai.project_id
left join sys_dept sd on sd.dept_id = bp.imp_unit left join sys_dept sd on sd.dept_id = bp.imp_unit
left join sys_dict_data sda on tt.task_status = sda.dict_value left join sys_dict_data sda on tt.task_status = sda.dict_value
and sda.dict_type = 'lease_task_status' and sda.dict_type = 'lease_task_status'
@ -496,8 +538,9 @@
left join sys_workflow_type swt on swr.workflow_id = swt.id left join sys_workflow_type swt on swr.workflow_id = swt.id
left join sys_workflow_node swn on swt.id = swn.type_id left join sys_workflow_node swn on swt.id = swn.type_id
left join sys_workflow_config swc on swn.id = swc.node_id left join sys_workflow_config swc on swn.id = swc.node_id
left join sys_workflow_record_history swrs on swr.id = swrs.record_id
where 1=1 where 1=1
<if test="userId != null and userId != ''">and swc.config_value = #{userId}</if> <if test="userId != null and userId != ''">and swc.config_value LIKE CONCAT('%', #{userId}, '%')</if>
<if test="code != null and code != ''">and lai.code = #{code}</if> <if test="code != null and code != ''">and lai.code = #{code}</if>
<if test="taskId != null ">and lai.task_id = #{taskId}</if> <if test="taskId != null ">and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if> <if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if>
@ -545,7 +588,6 @@
<if test="costBearingParty != null and costBearingParty != ''">and lai.cost_bearing_party = <if test="costBearingParty != null and costBearingParty != ''">and lai.cost_bearing_party =
#{costBearingParty} #{costBearingParty}
</if> </if>
and lai.apply_code is not null
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if> <if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if> <if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
GROUP BY lai.id GROUP BY lai.id
@ -611,6 +653,14 @@
where task_Id = #{taskId} where task_Id = #{taskId}
</update> </update>
<update id="updatePublish">
update lease_apply_details
<trim prefix="SET" suffixOverrides=",">
<if test="num != null">publish_num = IFNULL(publish_num, 0) + #{num},</if>
</trim>
where parent_id = #{parentId} and type_id = #{typeId}
</update>
<select id="getApplyInfo" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo"> <select id="getApplyInfo" resultType="com.bonus.common.biz.domain.lease.LeaseApplyInfo">
select select
lai.code as code,lai.lease_person as leasePerson,lai.phone as phone,lai.create_by as createBy, lai.code as code,lai.lease_person as leasePerson,lai.phone as phone,lai.create_by as createBy,
@ -683,6 +733,9 @@
GROUP BY GROUP BY
mt.type_id mt.type_id
) AS subquery0 ON subquery0.type_id = mt.type_id ) AS subquery0 ON subquery0.type_id = mt.type_id
<if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
</if>
WHERE WHERE
lad.parent_id = #{id} lad.parent_id = #{id}
</select> </select>
@ -699,11 +752,9 @@
lai.unit_id,lai.project_id,bu.unit_name, bp.pro_name, tt.task_status as taskStatus, lai.unit_id,lai.project_id,bu.unit_name, bp.pro_name, tt.task_status as taskStatus,
case tt.task_status case tt.task_status
when 0 then '待审核' when 1 then '未完成'
when 1 then '待审核' when 2 then '已终结'
when 2 then '审核中'
when 3 then '已完成' when 3 then '已完成'
when 4 then '已完成'
end as taskStatusName, end as taskStatusName,
IFNULL(sum(lad.pre_num),0) as preCountNum, IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum, IFNULL(sum(lad.al_num),0) as alNum,
@ -722,8 +773,11 @@
and sda.dict_type = 'lease_task_status' and sda.dict_type = 'lease_task_status'
left join ma_type mt on lad.type_id = mt.type_id and mt.del_flag = '0' left join ma_type mt on lad.type_id = mt.type_id and mt.del_flag = '0'
left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0' left join ma_type mt1 on mt.parent_id = mt1.type_id and mt1.del_flag = '0'
<if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lad.type_id AND mtk.user_id = #{userId}
</if>
where tt.task_type = '19' where tt.task_type = '19'
and tt.task_status = '1' and tt.task_status in (1, 2, 3)
<if test="taskId != null ">and lai.task_id = #{taskId}</if> <if test="taskId != null ">and lai.task_id = #{taskId}</if>
<if test="statusList != null and statusList.size() > 0"> <if test="statusList != null and statusList.size() > 0">
and tt.task_status in and tt.task_status in
@ -739,4 +793,24 @@
GROUP BY lai.id GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc ORDER BY tt.task_status,tt.create_time desc
</select> </select>
<select id="selectLeaseApplyDetailsById" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
SELECT
parent_id AS parentId,
type_id AS typeId,
IFNULL( SUM(pre_num), 0 ) AS preNum,
IFNULL( SUM(publish_num), 0 ) AS publishNum
FROM
lease_apply_details
WHERE
parent_id = #{parentId}
GROUP BY
parent_id
</select>
<select id="getMonthMaxOrderByDate" resultType="java.lang.Integer">
select COALESCE(max(month_order), 0) from lease_publish_details
where
month(create_time) = #{month} and year(create_time) = #{year}
</select>
</mapper> </mapper>

View File

@ -421,16 +421,56 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mm.check_man as checkMan, mm.check_man as checkMan,
mm.inspect_man as inspectMan, mm.inspect_man as inspectMan,
mm.phone, mm.phone,
mm.inspect_status as inspectStatus, '合格' as inspectStatus,
mm.ma_vender as maVender, mm.ma_vender as maVender,
mm.ex_code as exCode, mm.ex_code as exCode,
mm.ex_url as exUrl, mm.ex_url as exUrl,
mm.is_jj as isJj mm.is_jj as isJj,
mm.type_id as typeId
FROM FROM
ma_machine mm ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id LEFT JOIN ma_type mt on mt.type_id=mm.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE WHERE
mm.ma_status = '2' and
mm.ma_code like concat('%', #{maCode}, '%')
</select>
<select id="selectMaId" resultType="java.lang.Long">
select ma_id
from ma_machine
WHERE ma_code = #{maCode}
</select>
<select id="selectHouse" resultType="com.bonus.material.ma.domain.Machine">
SELECT
whi.house_name as ownHouse
FROM
ma_type mt
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN ma_type mt3 ON mt2.parent_id = mt3.type_id
AND mt3.del_flag = '0'
LEFT JOIN wh_house_set whs ON mt3.type_id = whs.type_id
LEFT JOIN wh_house_info whi ON whs.house_id = whi.house_id
WHERE
mt.type_id = #{typeId}
</select>
<select id="getByMaCode" resultType="com.bonus.material.ma.domain.Machine">
SELECT
mm.ma_id as maId,
mt2.type_name as materialName,
mt.type_name as materialModel,
mm.ma_code as maCode
FROM
ma_machine mm
LEFT JOIN ma_type mt on mt.type_id=mm.type_id
LEFT JOIN ma_type mt2 on mt2.type_id=mt.parent_id
WHERE
mm.ma_status = '2' and
mm.ma_code like concat('%', #{maCode}, '%') mm.ma_code like concat('%', #{maCode}, '%')
</select> </select>

View File

@ -918,4 +918,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE sai.agreement_id = #{agreementId} WHERE sai.agreement_id = #{agreementId}
AND sai.STATUS = '0') AND sai.STATUS = '0')
</select> </select>
<select id="getListLevel" resultType="com.bonus.material.ma.domain.vo.MaTypeVo">
SELECT
type_id AS typeId,
type_name AS typeName
FROM
ma_type
WHERE `level` = '1'
</select>
</mapper> </mapper>

View File

@ -120,15 +120,19 @@
<select id="getAuditList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce"> <select id="getAuditList" resultType="com.bonus.material.settlement.domain.SltAgreementReduce">
SELECT SELECT
sra.id as id,sra.id as taskId, sra.id as id,swr.task_id as taskId,
sra.create_time as createTime, sra.create_time as createTime,
su.user_name as createBy, su.user_name as createBy,
bu.unit_name as unitName, bu.unit_name as unitName,
bp.pro_name as projectName, bp.pro_name as projectName,
SUM(srd.lease_price * srd.num) as leasePrice, SUM(srd.lease_price * srd.num) as leasePrice,
SUM(srd.lease_money) as leaseMoney, SUM(srd.lease_money) as leaseMoney,
sra.`status`, swr.workflow_status as status,
a.leaseMoneyAll as leaseMoneyAll a.leaseMoneyAll as leaseMoneyAll,
swrs.node_id AS nodeId,
swrs.next_node_id AS nextNodeId,
swrs.record_id AS recordId,
swn.node_sign_type as nodeSignType
FROM FROM
slt_reduce_apply sra slt_reduce_apply sra
LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id LEFT JOIN slt_reduce_details srd on sra.id=srd.apply_id
@ -140,7 +144,7 @@
LEFT JOIN sys_workflow_type swt on swr.workflow_id = swt.id LEFT JOIN sys_workflow_type swt on swr.workflow_id = swt.id
LEFT JOIN sys_workflow_node swn on swt.id = swn.type_id LEFT JOIN sys_workflow_node swn on swt.id = swn.type_id
LEFT JOIN sys_workflow_config swc on swn.id = swc.node_id LEFT JOIN sys_workflow_config swc on swn.id = swc.node_id
left join sys_workflow_record_history swrs on swr.id = swrs.record_id
LEFT JOIN LEFT JOIN
( (
SELECT SELECT
@ -178,4 +182,4 @@
GROUP BY sra.id GROUP BY sra.id
ORDER BY sra.create_time DESC ORDER BY sra.create_time DESC
</select> </select>
</mapper> </mapper>

View File

@ -104,4 +104,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAgreementIdByTaskId" resultType="java.lang.Long"> <select id="selectAgreementIdByTaskId" resultType="java.lang.Long">
select agreement_id from tm_task_agreement where task_id = #{taskId} select agreement_id from tm_task_agreement where task_id = #{taskId}
</select> </select>
<select id="selectAgreementId" resultType="java.lang.String">
SELECT bai.agreement_id
FROM bm_agreement_info bai
LEFT JOIN lease_publish_details lpd ON bai.unit_id = lpd.unit_id
AND bai.project_id = lpd.project_id
WHERE lpd.publish_task = #{publishTask}
</select>
</mapper> </mapper>

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="companyId" column="company_id" /> <result property="companyId" column="company_id" />
<result property="monthOrder" column="month_order" /> <result property="monthOrder" column="month_order" />
<result property="splitType" column="split_type" />
</resultMap> </resultMap>
<sql id="selectTmTaskVo"> <sql id="selectTmTaskVo">
@ -46,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="preTaskId != null">pre_task_id,</if> <if test="preTaskId != null">pre_task_id,</if>
<if test="taskType != null">task_type,</if> <if test="taskType != null">task_type,</if>
<if test="splitType != null">split_type,</if>
<if test="taskStatus != null">task_status,</if> <if test="taskStatus != null">task_status,</if>
<if test="code != null">`code`,</if> <if test="code != null">`code`,</if>
<if test="monthOrder != null">month_order,</if> <if test="monthOrder != null">month_order,</if>
@ -59,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="preTaskId != null">#{preTaskId},</if> <if test="preTaskId != null">#{preTaskId},</if>
<if test="taskType != null">#{taskType},</if> <if test="taskType != null">#{taskType},</if>
<if test="splitType != null">#{splitType},</if>
<if test="taskStatus != null">#{taskStatus},</if> <if test="taskStatus != null">#{taskStatus},</if>
<if test="code != null">#{code},</if> <if test="code != null">#{code},</if>
<if test="monthOrder != null">#{monthOrder},</if> <if test="monthOrder != null">#{monthOrder},</if>

View File

@ -4,7 +4,7 @@
<mapper namespace="com.bonus.material.work.mapper.DirectAuditMapper"> <mapper namespace="com.bonus.material.work.mapper.DirectAuditMapper">
<select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo"> <select id="getList" resultType="com.bonus.material.ma.domain.DirectApplyInfo">
SELECT DISTINCT SELECT
dai.Id, dai.Id,
dai.create_time AS createTime, dai.create_time AS createTime,
su.user_name AS createName, su.user_name AS createName,
@ -18,7 +18,11 @@
bpl1.pro_name AS leaseProName, bpl1.pro_name AS leaseProName,
dai.lease_man as leaseMan , dai.lease_man as leaseMan ,
swr.workflow_status as flowStatus, swr.workflow_status as flowStatus,
swr.id as flowId swr.task_id as flowId,
swrs.node_id AS nodeId,
swrs.next_node_id AS nextNodeId,
swrs.record_id AS recordId,
swn.node_sign_type as nodeSignType
FROM FROM
direct_apply_info dai direct_apply_info dai
LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id LEFT JOIN bm_agreement_info bai ON dai.back_agreement_id = bai.agreement_id
@ -30,6 +34,10 @@
LEFT JOIN direct_apply_details dad on dad.direct_id=dai.id LEFT JOIN direct_apply_details dad on dad.direct_id=dai.id
left join sys_user su on dai.create_by = su.user_id left join sys_user su on dai.create_by = su.user_id
left join sys_workflow_record swr on dai.id = swr.task_id left join sys_workflow_record swr on dai.id = swr.task_id
left join sys_workflow_type swt on swr.workflow_id = swt.id
left join sys_workflow_node swn on swt.id = swn.type_id
left join sys_workflow_config swc on swn.id = swc.node_id
left join sys_workflow_record_history swrs on swr.id = swrs.record_id
<where> <where>
swr.task_id is not null swr.task_id is not null
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
@ -52,7 +60,7 @@
<if test="isApp != null and taskStatus==0">and dai.status = 0 </if> <if test="isApp != null and taskStatus==0">and dai.status = 0 </if>
<if test="isApp != null and taskStatus==1">and (dai.status = 1 or dai.status = 2)</if> <if test="isApp != null and taskStatus==1">and (dai.status = 1 or dai.status = 2)</if>
</where> </where>
order by dai.create_time desc GROUP BY swr.task_id order by dai.create_time desc
</select> </select>

View File

@ -12,12 +12,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="configType != null">config_type,</if> <if test="configType != null">config_type,</if>
<if test="configValue != null">config_value,</if> <if test="configValue != null">config_value,</if>
<if test="isEnable != null">is_enable,</if> <if test="isEnable != null">is_enable,</if>
<if test="roleIds != null">roleIds,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nodeId != null">#{nodeId},</if> <if test="nodeId != null">#{nodeId},</if>
<if test="configType != null">#{configType},</if> <if test="configType != null">#{configType},</if>
<if test="configValue != null">#{configValue},</if> <if test="configValue != null">#{configValue},</if>
<if test="isEnable != null">#{isEnable},</if> <if test="isEnable != null">#{isEnable},</if>
<if test="roleIds != null">#{roleIds},</if>
</trim> </trim>
</insert> </insert>

View File

@ -58,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSysWorkflowNodeList" resultType="com.bonus.material.work.domain.SysWorkflowNode"> <select id="selectSysWorkflowNodeList" resultType="com.bonus.material.work.domain.SysWorkflowNode">
select swn.id as id, swn.type_id typeId, swn.node_name as nodeName, swn.node_sort as nodeSort, select swn.id as id, swn.type_id typeId, swn.node_name as nodeName, swn.node_sort as nodeSort,
swn.node_sign_type as nodeSignType, swn.node_sign_config as nodeSignConfig,swn.node_label as nodeLabel, swn.node_sign_type as nodeSignType, swn.node_sign_config as nodeSignConfig,swn.node_label as nodeLabel,
swn.create_by as createBy,swn.create_time as createTime,swn.is_enable as isEnable, swn.create_by as createBy,swn.create_time as createTime,swn.is_enable as isEnable,sec.roleIds as roleIds,
GROUP_CONCAT(sec.config_value SEPARATOR ',') AS configValues GROUP_CONCAT(sec.config_value SEPARATOR ',') AS configValues
from sys_workflow_node swn from sys_workflow_node swn
left join sys_workflow_config sec on swn.id= sec.node_id left join sys_workflow_config sec on swn.id= sec.node_id
@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="listByTaskId" resultType="com.bonus.material.work.domain.SysWorkflowNode"> <select id="listByTaskId" resultType="com.bonus.material.work.domain.SysWorkflowNode">
select swn.id as id, swn.type_id typeId, swn.node_name as nodeName, swn.node_sort as nodeSort, select swn.id as id, swn.type_id typeId, swn.node_name as nodeName, swn.node_sort as nodeSort,
swn.node_sign_type as nodeSignType, swn.node_sign_config as nodeSignConfig,swn.id as nodeId, swn.node_sign_type as nodeSignType, swn.node_sign_config as nodeSignConfig,swn.id as nodeId,
swrh.create_by as createBy,swn.is_enable as isEnable,sec.config_value as configValues, swrh.create_by as createBy,swn.is_enable as isEnable,
GROUP_CONCAT(DISTINCT sec.config_value SEPARATOR ',') AS configValues, GROUP_CONCAT(DISTINCT sec.config_value SEPARATOR ',') AS configValues,
swr.id as recordId swr.id as recordId
from sys_workflow_node swn from sys_workflow_node swn
@ -83,6 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY swn.id GROUP BY swn.id
</select> </select>
<select id="selectSysWorkflowNodeById" resultType="com.bonus.material.work.domain.SysWorkflowNode">
select node_name as nodeName, node_sign_type as nodeSignType
from sys_workflow_node where id = #{nodeId}
</select>
</mapper> </mapper>

View File

@ -28,8 +28,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert> </insert>
<select id="seleteSysWorkflowRecordHistory" resultType="com.bonus.material.work.domain.SysWorkflowRecordHistory"> <select id="seleteSysWorkflowRecordHistory" resultType="com.bonus.material.work.domain.SysWorkflowRecordHistory">
select swrh.is_accept as isAccept,swrh.create_time as createTime,swrh.remark as remark,swrh.next_node_id as nextNodeId, select swrh.is_accept as isAccept,swrh.create_time as createTime,swrh.remark as remark,swrh.next_node_id as nextNodeId,
swrh.create_by as createBy swrh.create_by as createBy,swrh.node_id as nodeId
from sys_workflow_record_history swrh from sys_workflow_record_history swrh
where swrh.record_id=#{recordId} and swrh.node_id= #{nodeId} where swrh.record_id=#{recordId} and swrh.node_id= #{nodeId}
</select> </select>
<select id="getWorkflowRecordHistoryByRecordId"
resultType="com.bonus.material.work.domain.SysWorkflowRecordHistory">
SELECT swrh.is_accept as isAccept,swrh.create_time as createTime,swrh.remark as remark,swrh.next_node_id as nextNodeId,
swrh.create_by as createBy,swrh.node_id as nodeId,swn.node_sort as nodeSort
FROM sys_workflow_record_history swrh
left join sys_workflow_node swn on swn.id = swrh.node_id
WHERE swrh.record_id =#{recordId} ORDER BY swrh.create_time DESC limit 1
</select>
</mapper> </mapper>