提交diamagnetic

main
姜玉琦 2024-06-22 22:21:10 +08:00
parent e087575672
commit a1fadd65a4
17 changed files with 489 additions and 145 deletions

View File

@ -16,7 +16,7 @@ yanZhu:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
port: 8087
servlet:
# 应用的访问路径
context-path: /

View File

@ -0,0 +1,117 @@
# 项目相关配置
yanZhu:
# 名称
name: ProjectName
# 版本
version: 3.8.7
# 版权年份
copyrightYear: 2023
# 文件路径 示例( Windows配置D:/yanZhu/uploadPathLinux配置 /home/yanZhu/uploadPath
profile: /data/yanzhu
# 获取ip地址开关
addressEnabled: false
# 验证码类型 math 数字计算 char 字符验证
captchaType: math
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8087
servlet:
# 应用的访问路径
context-path: /yanZhuProject
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# 连接数满后的排队数默认为100
accept-count: 1000
threads:
# tomcat最大线程数默认为200
max: 800
# Tomcat启动初始化的线程数默认值10
min-spare: 100
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://62.234.3.186:3306/yanzhu_project?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8
username: root
password: Sxyanzhu@cf123
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置连接超时时间
connectTimeout: 30000
# 配置网络超时时间
socketTimeout: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000
# 配置检测连接是否有效
validationQuery: SELECT 1 FROM DUAL
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
enabled: true
statViewServlet:
enabled: true
# 设置白名单,不填则允许所有访问
allow:
url-pattern: /druid/*
# 控制台管理用户名和密码
login-username: yanzhu
login-password: Sxyanzhu@yanzhu+mz
filter:
stat:
enabled: true
# 慢SQL记录
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# redis 配置
redis:
# 地址
host: 127.0.0.1
# 端口默认为6379
port: 6379
# 数据库索引
database: 0
# 密码
password: 123456
# 连接超时时间
timeout: 10s
lettuce:
pool:
# 连接池中的最小空闲连接
min-idle: 0
# 连接池中的最大空闲连接
max-idle: 8
# 连接池的最大数据库连接数
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms

View File

@ -19,7 +19,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
active: test
# 文件上传
servlet:
multipart:

View File

@ -0,0 +1,37 @@
package com.yanzhu.common.enums;
import com.yanzhu.common.core.text.Convert;
/**
*
*/
public enum ApplyStatusEnums {
SQZ("1", "申请中"),
DYS("10", "待验收"),
YYS("100", "已验收");
private final String code;
private final String info;
ApplyStatusEnums(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
public Long getLongCode()
{
return Convert.toLong(code);
}
}

View File

@ -0,0 +1,40 @@
package com.yanzhu.flowable.config;
import com.yanzhu.flowable.listener.GlobalEventListener;
import lombok.RequiredArgsConstructor;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
/**
* Flowable
*
* @author JiangYuQi
*/
@Configuration
@RequiredArgsConstructor
public class FlowableGlobalListenerConfig implements ApplicationListener<ContextRefreshedEvent> {
private final SpringProcessEngineConfiguration configuration;
private final GlobalEventListener globalEventListener;
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
FlowableEventDispatcher dispatcher = configuration.getEventDispatcher();
/**
* -
* PROCESS_CREATED
* TASK_CREATED
* TASK_COMPLETED
* PROCESS_COMPLETED
*
*/
dispatcher.addEventListener(globalEventListener,FlowableEngineEventType.PROCESS_COMPLETED);
}
}

View File

@ -1,95 +1,95 @@
//package com.yanzhu.flowable.config;
//
//import com.sun.prism.paint.Color;
//import org.flowable.bpmn.model.AssociationDirection;
//import org.flowable.image.impl.DefaultProcessDiagramCanvas;
//
//import java.awt.*;
//import java.awt.geom.Line2D;
//import java.awt.geom.RoundRectangle2D;
//
///**
// * @author Tony
// * @date 2021-04-03
// */
//public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
// //设置高亮线的颜色 这里我设置成绿色
// protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN;
//
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
// super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
// }
//
// public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
// super(width, height, minX, minY, imageType);
// }
//
//
// /**
// * 画线颜色设置
// */
// @Override
// public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType,
// AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
//
// Paint originalPaint = g.getPaint();
// Stroke originalStroke = g.getStroke();
//
// g.setPaint(CONNECTION_COLOR);
// if (connectionType.equals("association")) {
// g.setStroke(ASSOCIATION_STROKE);
// } else if (highLighted) {
// //设置线的颜色
// g.setPaint(originalPaint);
// g.setStroke(HIGHLIGHT_FLOW_STROKE);
// }
//
// for (int i = 1; i < xPoints.length; i++) {
// Integer sourceX = xPoints[i - 1];
// Integer sourceY = yPoints[i - 1];
// Integer targetX = xPoints[i];
// Integer targetY = yPoints[i];
// Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);
// g.draw(line);
// }
//
// if (isDefault) {
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
// drawDefaultSequenceFlowIndicator(line, scaleFactor);
// }
//
// if (conditional) {
// Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
// drawConditionalSequenceFlowIndicator(line, scaleFactor);
// }
//
// if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
// Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);
// drawArrowHead(line, scaleFactor);
// }
// if (associationDirection == AssociationDirection.BOTH) {
// Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
// drawArrowHead(line, scaleFactor);
// }
// g.setPaint(originalPaint);
// g.setStroke(originalStroke);
// }
//
// /**
// * 高亮节点设置
// */
// @Override
// public void drawHighLight(int x, int y, int width, int height) {
// Paint originalPaint = g.getPaint();
// Stroke originalStroke = g.getStroke();
// //设置高亮节点的颜色
// g.setPaint(HIGHLIGHT_COLOR);
// g.setStroke(THICK_TASK_BORDER_STROKE);
//
// RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
// g.draw(rect);
//
// g.setPaint(originalPaint);
// g.setStroke(originalStroke);
// }
//}
package com.yanzhu.flowable.config;
import org.flowable.bpmn.model.AssociationDirection;
import org.flowable.image.impl.DefaultProcessDiagramCanvas;
import java.awt.*;
import java.awt.geom.Line2D;
import java.awt.geom.RoundRectangle2D;
/**
* @author Tony
* @date 2021-04-03
*/
public class MyDefaultProcessDiagramCanvas extends DefaultProcessDiagramCanvas {
//设置高亮线的颜色 这里我设置成绿色
protected static Color HIGHLIGHT_SEQUENCEFLOW_COLOR = Color.GREEN;
public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType, String activityFontName, String labelFontName, String annotationFontName, ClassLoader customClassLoader) {
super(width, height, minX, minY, imageType, activityFontName, labelFontName, annotationFontName, customClassLoader);
}
public MyDefaultProcessDiagramCanvas(int width, int height, int minX, int minY, String imageType) {
super(width, height, minX, minY, imageType);
}
/**
* 线
*/
@Override
public void drawConnection(int[] xPoints, int[] yPoints, boolean conditional, boolean isDefault, String connectionType,
AssociationDirection associationDirection, boolean highLighted, double scaleFactor) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
g.setPaint(CONNECTION_COLOR);
if (connectionType.equals("association")) {
g.setStroke(ASSOCIATION_STROKE);
} else if (highLighted) {
//设置线的颜色
g.setPaint(originalPaint);
g.setStroke(HIGHLIGHT_FLOW_STROKE);
}
for (int i = 1; i < xPoints.length; i++) {
Integer sourceX = xPoints[i - 1];
Integer sourceY = yPoints[i - 1];
Integer targetX = xPoints[i];
Integer targetY = yPoints[i];
Line2D.Double line = new Line2D.Double(sourceX, sourceY, targetX, targetY);
g.draw(line);
}
if (isDefault) {
Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
drawDefaultSequenceFlowIndicator(line, scaleFactor);
}
if (conditional) {
Line2D.Double line = new Line2D.Double(xPoints[0], yPoints[0], xPoints[1], yPoints[1]);
drawConditionalSequenceFlowIndicator(line, scaleFactor);
}
if (associationDirection == AssociationDirection.ONE || associationDirection == AssociationDirection.BOTH) {
Line2D.Double line = new Line2D.Double(xPoints[xPoints.length - 2], yPoints[xPoints.length - 2], xPoints[xPoints.length - 1], yPoints[xPoints.length - 1]);
drawArrowHead(line, scaleFactor);
}
if (associationDirection == AssociationDirection.BOTH) {
Line2D.Double line = new Line2D.Double(xPoints[1], yPoints[1], xPoints[0], yPoints[0]);
drawArrowHead(line, scaleFactor);
}
g.setPaint(originalPaint);
g.setStroke(originalStroke);
}
/**
*
*/
@Override
public void drawHighLight(int x, int y, int width, int height) {
Paint originalPaint = g.getPaint();
Stroke originalStroke = g.getStroke();
//设置高亮节点的颜色
g.setPaint(HIGHLIGHT_COLOR);
g.setStroke(THICK_TASK_BORDER_STROKE);
RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, 20, 20);
g.draw(rect);
g.setPaint(originalPaint);
g.setStroke(originalStroke);
}
}

View File

@ -0,0 +1,54 @@
package com.yanzhu.flowable.listener;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.common.enums.ApplyStatusEnums;
import com.yanzhu.project.domain.ProProjectApply;
import com.yanzhu.project.service.IProProjectApplyService;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
import org.flowable.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Flowable
*
* @author JiangYuQi
*/
@Slf4j
@Component
public class GlobalEventListener extends AbstractFlowableEngineEventListener {
@Autowired
private TaskService taskService;
@Autowired
private RuntimeService runtimeService;
@Autowired
private RepositoryService repositoryService;
@Autowired
private IProProjectApplyService proProjectApplyService;
@Override
protected void processCompleted(FlowableEngineEntityEvent event) {
log.info("任务流程审批完成...{}",event.getProcessInstanceId());
super.processCompleted(event);
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(event.getProcessInstanceId()).singleResult();
try {
ProProjectApply entity = proProjectApplyService.selectProProjectApplyById(Convert.toLong(processInstance.getBusinessKey()));
entity.setApplyStatus(ApplyStatusEnums.DYS.getCode());
proProjectApplyService.updateProProjectApplyEntity(entity);
}catch (Exception e){
e.printStackTrace();
}
}
}

View File

@ -27,6 +27,12 @@ public interface IFlowTaskService {
*/
void taskReject(FlowTaskVo flowTaskVo);
/**
*
*
* @param flowTaskVo
*/
void defaultReturn(FlowTaskVo flowTaskVo);
/**
* 退

View File

@ -319,6 +319,16 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
}
}
/**
*
*
* @param flowTaskVo
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void defaultReturn(FlowTaskVo flowTaskVo){
}
/**
* 退

View File

@ -1,6 +1,7 @@
package com.yanzhu.framework.web.service;
import com.yanzhu.common.core.domain.entity.SysDept;
import com.yanzhu.common.core.domain.entity.SysRole;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.system.service.ISysDeptService;
import org.slf4j.Logger;
@ -62,8 +63,9 @@ public class UserDetailsServiceImpl implements UserDetailsService
//设置项目单位信息
if(!user.isAdmin()){
String[] tmps=user.getDept().getAncestors().split(",");
Long deptId = Convert.toLong(tmps[tmps.length-1]);
//判断是否是段队管理员
String[] ancestors = user.getDept().getAncestors().split(",");
Long deptId = Convert.toLong(ancestors[ancestors.length-1]);
if(deptId != null){
SysDept sysDept = sysDeptService.selectDeptById(deptId);
user.setParDeptId(sysDept.getDeptId());

View File

@ -1,11 +1,16 @@
package com.yanzhu.web;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.yanzhu.common.constant.Constants;
import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.common.core.redis.RedisCache;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.common.enums.ShiFouEnum;
import com.yanzhu.common.utils.DateUtils;
import com.yanzhu.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -35,6 +40,10 @@ import com.yanzhu.common.core.page.TableDataInfo;
@RequestMapping("/project/projectInfo")
public class ProProjectInfoController extends BaseController
{
@Autowired
private RedisCache redisCache;
@Autowired
private IProProjectInfoService proProjectInfoService;
@ -81,7 +90,12 @@ public class ProProjectInfoController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody ProProjectInfo proProjectInfo)
{
return toAjax(proProjectInfoService.insertProProjectInfo(proProjectInfo));
int res = proProjectInfoService.insertProProjectInfo(proProjectInfo);
if(res>0){
String key = "YANZHU.PROJ.V1.findMyProjectList."+proProjectInfo.getDeptId();
redisCache.deleteObject(key);
}
return toAjax(res);
}
/**
@ -92,7 +106,12 @@ public class ProProjectInfoController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody ProProjectInfo proProjectInfo)
{
return toAjax(proProjectInfoService.updateProProjectInfo(proProjectInfo));
int res = proProjectInfoService.updateProProjectInfo(proProjectInfo);
if(res>0){
String key = "YANZHU.PROJ.V1.findMyProjectList."+proProjectInfo.getDeptId();
redisCache.deleteObject(key);
}
return toAjax(res);
}
/**
@ -103,7 +122,35 @@ public class ProProjectInfoController extends BaseController
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(proProjectInfoService.deleteProProjectInfoByIds(ids));
int res = proProjectInfoService.deleteProProjectInfoByIds(ids);
if(res>0){
for(Long id:ids){
ProProjectInfo proProjectInfo = proProjectInfoService.selectProProjectInfoById(id);
String key = "YANZHU.PROJ.V1.findMyProjectList."+proProjectInfo.getDeptId();
redisCache.deleteObject(key);
}
}
return toAjax(res);
}
/**
*
*/
@GetMapping(value = "/findMyDeptProjectNo")
public AjaxResult findMyDeptProjectNo()
{
Long parDeptId = super.getLoginUser().getUser().getParDeptId();
ProProjectInfo proProjectInfo = new ProProjectInfo();
proProjectInfo.setDeptId(parDeptId);
int count=1;
List<ProProjectInfo> list = proProjectInfoService.selectProProjectInfoList(proProjectInfo);
if(StringUtils.isNotEmpty(list)){
count = count+list.size();
}
String proNo = parDeptId+DateUtils.parseDateToStr(DateUtils.YYYY,new Date())+String.format("%03d", count);
AjaxResult ajax = AjaxResult.success();
ajax.put("data", proNo);
return ajax;
}
/**

View File

@ -92,7 +92,7 @@ public class WxFlowableController extends BaseController {
String key = "YANZHU.FLOW.readNotes:" + deployId;
Object object = redisCache.getCacheObject(key);
if (object != null) {
//return success(object);
return success(object);
}
List<FlowElement> list = flowDefinitionService.readNodes(deployId);
redisCache.setCacheObject(key, list, Constants.DATA_EXPIRATION, TimeUnit.MINUTES);
@ -179,6 +179,19 @@ public class WxFlowableController extends BaseController {
return AjaxResult.success();
}
/**
*
* @param flowTaskVo
* @return
*/
@ApiOperation(value = "驳回申请人")
@Log(title = "驳回申请人", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE)
@PostMapping(value = "/defaultReturn")
public AjaxResult taskDefaultReturn(@RequestBody FlowTaskVo flowTaskVo) {
flowTaskService.defaultReturn(flowTaskVo);
return AjaxResult.success();
}
/**
*
* @param instanceId ID
@ -257,20 +270,15 @@ public class WxFlowableController extends BaseController {
* @return
*/
@PostMapping(value = "/myAwaitFlowTaskList")
public TableDataInfo myAwaitFlowTaskList(@RequestBody FlowTaskEntity flowTaskEntity) {
startPage();
public AjaxResult myAwaitFlowTaskList(@RequestBody FlowTaskEntity flowTaskEntity) {
//超管查询所有数据
if(!SysUser.isAdmin(super.getUserId())){
SysUser sysUser = super.getLoginUser().getUser();
if(SysRole.roleIsDeptAdmin(sysUser.getRoles())){
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
}else{
flowTaskEntity.setAssigneeId(sysUser.getUserId());
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
}
flowTaskEntity.setAssigneeId(sysUser.getUserId());
flowTaskEntity.setDeptAncestors(sysUser.getDept().getAncestors()+","+sysUser.getDeptId());
flowTaskEntity.setRoleIds(sysUser.getRoles().stream().map(role -> role.getRoleId()).collect(Collectors.toList()));
}
return getDataTable(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
return success(flowBusinessKeyService.selectMyAwaitFlowTask(flowTaskEntity));
}
/**
@ -306,6 +314,8 @@ public class WxFlowableController extends BaseController {
@GetMapping(value = "/myFinishedFlowTaskList")
public TableDataInfo myFinishedFlowTaskList(FlowTaskEntity flowTaskEntity) {
startPage();
SysUser sysUser = super.getLoginUser().getUser();
flowTaskEntity.setAssigneeId(sysUser.getUserId());
return getDataTable(flowBusinessKeyService.selectMyFinishedFlowTask(flowTaskEntity));
}

View File

@ -90,7 +90,7 @@ public class WxLoginController extends BaseController {
@ApiOperation(value = "退出登录")
@RateLimiter(count = 10, limitType = LimitType.IP)
@Log(title = "用户退出登录", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE)
@PostMapping("/loginOut")
@GetMapping("/loginOut")
public AjaxResult loginOut(HttpServletRequest request)
{
tokenService.delLoginUser(request);

View File

@ -18,6 +18,10 @@ public class ProProjectInfo extends BaseEntity
/** 主键 */
private Long id;
/** 项目编号 */
@Excel(name = "项目编号")
private String no;
/** 项目名称 */
@Excel(name = "项目名称")
private String name;
@ -58,11 +62,7 @@ public class ProProjectInfo extends BaseEntity
@Excel(name = "是否删除")
private String isDel;
/** 项目级单位 */
@Excel(name = "项目级单位")
private String unit;
public void setId(Long id)
public void setId(Long id)
{
this.id = id;
}
@ -71,7 +71,16 @@ public class ProProjectInfo extends BaseEntity
{
return id;
}
public void setName(String name)
public String getNo() {
return no;
}
public void setNo(String no) {
this.no = no;
}
public void setName(String name)
{
this.name = name;
}
@ -157,24 +166,16 @@ public class ProProjectInfo extends BaseEntity
this.isDel = isDel;
}
public String getIsDel()
public String getIsDel()
{
return isDel;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("no", getNo())
.append("name", getName())
.append("deptId", getDeptId())
.append("address", getAddress())
@ -190,7 +191,6 @@ public class ProProjectInfo extends BaseEntity
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.append("unit", getUnit())
.toString();
}
}

View File

@ -43,6 +43,14 @@ public interface IProProjectApplyService
*/
public int updateProProjectApply(ProProjectApply proProjectApply);
/**
*
*
* @param proProjectApply
* @return
*/
public int updateProProjectApplyEntity(ProProjectApply proProjectApply);
/**
*
*

View File

@ -93,7 +93,6 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
public int updateProProjectApply(ProProjectApply proProjectApply)
{
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
proProjectApply.setCreateTime(DateUtils.getNowDate());
proProjectApply.setUpdateBy(sysUser.getNickName());
proProjectApply.setUpdateTime(DateUtils.getNowDate());
proProjectApplyMapper.deleteProProjectApplyDetailByApplyId(proProjectApply.getId());
@ -101,6 +100,20 @@ public class ProProjectApplyServiceImpl implements IProProjectApplyService
return proProjectApplyMapper.updateProProjectApply(proProjectApply);
}
/**
*
*
* @param proProjectApply
* @return
*/
@Transactional
@Override
public int updateProProjectApplyEntity(ProProjectApply proProjectApply)
{
proProjectApply.setUpdateTime(DateUtils.getNowDate());
return proProjectApplyMapper.updateProProjectApply(proProjectApply);
}
/**
*
*

View File

@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ProProjectInfo" id="ProProjectInfoResult">
<result property="id" column="id" />
<result property="no" column="no" />
<result property="name" column="name" />
<result property="deptId" column="dept_id" />
<result property="address" column="address" />
@ -21,24 +22,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="remark" column="remark" />
<result property="unit" column="unit" />
</resultMap>
<sql id="selectProProjectInfoVo">
select id, name, dept_id, address, infos, person_name, person_phone, main_image, images, proj_status, is_del, create_by, create_time, update_by, update_time, remark, unit
select id, no, name, dept_id, address, infos, person_name, person_phone, main_image, images, proj_status, is_del, create_by, create_time, update_by, update_time, remark
from pro_project_info
</sql>
<select id="selectProProjectInfoList" parameterType="ProProjectInfo" resultMap="ProProjectInfoResult">
<include refid="selectProProjectInfoVo"/>
<where>
<where>
<if test="no != null and no != ''"> and no = #{no}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="personName != null and personName != ''"> and person_name like concat('%', #{personName}, '%')</if>
<if test="personPhone != null and personPhone != ''"> and person_phone = #{personPhone}</if>
<if test="projStatus != null and projStatus != ''"> and proj_status = #{projStatus}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
</where>
order by create_time desc
</select>
@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertProProjectInfo" parameterType="ProProjectInfo" useGeneratedKeys="true" keyProperty="id">
insert into pro_project_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="no != null">no,</if>
<if test="name != null">name,</if>
<if test="deptId != null">dept_id,</if>
<if test="address != null">address,</if>
@ -66,9 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="remark != null">remark,</if>
<if test="unit != null">unit,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="no != null">#{no},</if>
<if test="name != null">#{name},</if>
<if test="deptId != null">#{deptId},</if>
<if test="address != null">#{address},</if>
@ -84,13 +85,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="remark != null">#{remark},</if>
<if test="unit != null">#{unit},</if>
</trim>
</insert>
<update id="updateProProjectInfo" parameterType="ProProjectInfo">
update pro_project_info
<trim prefix="SET" suffixOverrides=",">
<if test="no != null">no = #{no},</if>
<if test="name != null">name = #{name},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="address != null">address = #{address},</if>
@ -106,19 +107,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="unit != null">unit = #{unit},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProProjectInfoById" parameterType="Long">
delete from pro_project_info where id = #{id}
</delete>
<update id="deleteProProjectInfoById" parameterType="Long">
update pro_project_info set is_del=1 where id = #{id}
</update>
<delete id="deleteProProjectInfoByIds" parameterType="String">
delete from pro_project_info where id in
<update id="deleteProProjectInfoByIds" parameterType="String">
update pro_project_info set is_del=1 where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</update>
</mapper>