This commit is contained in:
mx 2024-10-24 11:18:13 +08:00
parent 9911e26d6c
commit d897c32a8f
42 changed files with 698 additions and 225 deletions

View File

@ -88,7 +88,50 @@
<failOnMissingWebXml>false</failOnMissingWebXml> <failOnMissingWebXml>false</failOnMissingWebXml>
<warName>${project.artifactId}</warName> <warName>${project.artifactId}</warName>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<!-- 如果是true 在打出来的包/路径上面会增加这个Assembly的id显示-->
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<!-- assembly描述文件位置 -->
<descriptor>src/main/resources/assembly.xml</descriptor>
</descriptors>
<!-- 打包完成后文件输出位置 这里为target目录-->
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<!-- 主要用来打包主jar-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<!--启动文件入口类,就是springboot启动main方法所在类 -->
<mainClass>com.staffing.StaffingApplication</mainClass>
<!-- 主jar依赖的jar包路径-->
<classpathPrefix>lib/</classpathPrefix>
<addClasspath>true</addClasspath>
</manifest>
</archive>
<!-- 不把配置文件和html文件打进主jar内-->
<excludes>
<exclude>*.java</exclude>
<exclude>static/</exclude>
<exclude>db/</exclude>
<exclude>templates/</exclude>
<exclude>*.yml</exclude>
<exclude>*.txt</exclude>
<exclude>logback.xml</exclude>
</excludes>
</configuration>
</plugin>
</plugins> </plugins>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
</build> </build>

View File

@ -2,7 +2,17 @@ package com.staffing.web.controller.custom;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.staffing.common.core.domain.entity.SysUser;
import com.staffing.common.core.redis.RedisCache;
import com.staffing.common.utils.SecurityUtils;
import com.staffing.custom.domain.StTask;
import com.staffing.custom.domain.StTaskSign;
import com.staffing.custom.mapper.StTaskMapper;
import com.staffing.custom.service.IStTaskService;
import com.staffing.custom.service.IStTaskSignService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -22,6 +32,9 @@ import com.staffing.custom.service.IStEmployeeService;
import com.staffing.common.utils.poi.ExcelUtil; import com.staffing.common.utils.poi.ExcelUtil;
import com.staffing.common.core.page.TableDataInfo; import com.staffing.common.core.page.TableDataInfo;
import static com.staffing.common.constant.Constants.DELETED_USER_KEY;
import static com.staffing.common.utils.PageUtils.startPage;
/** /**
* 员工Controller * 员工Controller
* *
@ -34,11 +47,17 @@ public class StEmployeeController extends BaseController
{ {
@Autowired @Autowired
private IStEmployeeService stEmployeeService; private IStEmployeeService stEmployeeService;
@Autowired
private IStTaskSignService taskSignService;
@Autowired
private StTaskMapper stTaskMapper;
@Autowired
private RedisCache redisCache;
/** /**
* 查询员工列表 * 查询员工列表
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:list')") @PreAuthorize("@ss.hasPermi('employee:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(StEmployee stEmployee) public TableDataInfo list(StEmployee stEmployee)
{ {
@ -50,7 +69,7 @@ public class StEmployeeController extends BaseController
/** /**
* 导出员工列表 * 导出员工列表
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:export')") @PreAuthorize("@ss.hasPermi('employee:export')")
@Log(title = "员工", businessType = BusinessType.EXPORT) @Log(title = "员工", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, StEmployee stEmployee) public void export(HttpServletResponse response, StEmployee stEmployee)
@ -63,7 +82,7 @@ public class StEmployeeController extends BaseController
/** /**
* 获取员工详细信息 * 获取员工详细信息
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:query')") @PreAuthorize("@ss.hasPermi('employee:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
@ -73,7 +92,7 @@ public class StEmployeeController extends BaseController
/** /**
* 新增员工 * 新增员工
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:add')") @PreAuthorize("@ss.hasPermi('employee:add')")
@Log(title = "员工", businessType = BusinessType.INSERT) @Log(title = "员工", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody StEmployee stEmployee) public AjaxResult add(@RequestBody StEmployee stEmployee)
@ -89,23 +108,48 @@ public class StEmployeeController extends BaseController
/** /**
* 修改员工 * 修改员工
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:edit')") @PreAuthorize("@ss.hasPermi('employee:edit')")
@Log(title = "员工", businessType = BusinessType.UPDATE) @Log(title = "员工", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody StEmployee stEmployee) public AjaxResult edit(@RequestBody StEmployee stEmployee)
{ {
stEmployee.setUpdateTime(new Date()); stEmployee.setUpdateTime(new Date());
stEmployee.setPhone(null);//不允许修改手机号
return toAjax(stEmployeeService.updateStEmployeeOrNull(stEmployee)); return toAjax(stEmployeeService.updateStEmployeeOrNull(stEmployee));
} }
/** /**
* 删除员工 * 删除员工
*/ */
@PreAuthorize("@ss.hasPermi('employee:employee:remove')") @PreAuthorize("@ss.hasPermi('employee:remove')")
@Log(title = "员工", businessType = BusinessType.DELETE) @Log(title = "员工", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
return toAjax(stEmployeeService.deleteStEmployeeByIds(ids)); //有报名任务则不能删除了
for (Long id : ids) {
StTaskSign stTaskSign = new StTaskSign();
stTaskSign.setEmployeeId(id);
List<StTaskSign> stTaskSigns = taskSignService.selectStTaskSignList(stTaskSign);
if (!stTaskSigns.isEmpty()){
StTask stTask = new StTask();
List<Long> taskIds = stTaskSigns.stream().map(stTask1 -> stTask1.getTaskId()).collect(Collectors.toList());
stTask.setTaskIds(taskIds);
List<StTask> stTasks = stTaskMapper.selectStTaskList(stTask);
if (!stTasks.isEmpty()){
return error("该员工已报名了任务["+ stTasks.get(0).getTaskName() +"], 不能删除");
}
}
}
int i = stEmployeeService.deleteStEmployeeByIds(ids);
if(i > 0){
for (Long id : ids) {
//清除缓存用户踢下线
redisCache.setCacheMapValue(DELETED_USER_KEY, id+"", true);
}
}
return toAjax(i);
} }
} }

View File

@ -46,7 +46,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 查询员工资金流水列表 * 查询员工资金流水列表
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:list')") @PreAuthorize("@ss.hasPermi('fund:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(StEmployeeFundRecord stEmployeeFundRecord) public TableDataInfo list(StEmployeeFundRecord stEmployeeFundRecord)
{ {
@ -58,7 +58,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 导出员工资金流水列表 * 导出员工资金流水列表
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:export')") @PreAuthorize("@ss.hasPermi('fund:export')")
@Log(title = "员工资金流水", businessType = BusinessType.EXPORT) @Log(title = "员工资金流水", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, StEmployeeFundRecord stEmployeeFundRecord) public void export(HttpServletResponse response, StEmployeeFundRecord stEmployeeFundRecord)
@ -90,7 +90,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 获取员工资金流水详细信息 * 获取员工资金流水详细信息
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:query')") @PreAuthorize("@ss.hasPermi('fund:query')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
@ -100,7 +100,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 新增员工资金流水 * 新增员工资金流水
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:add')") @PreAuthorize("@ss.hasPermi('fund:add')")
@Log(title = "员工资金流水", businessType = BusinessType.INSERT) @Log(title = "员工资金流水", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody StEmployeeFundRecord stEmployeeFundRecord) public AjaxResult add(@RequestBody StEmployeeFundRecord stEmployeeFundRecord)
@ -112,7 +112,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 修改员工资金流水 * 修改员工资金流水
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:edit')") @PreAuthorize("@ss.hasPermi('fund:edit')")
@Log(title = "员工资金流水", businessType = BusinessType.UPDATE) @Log(title = "员工资金流水", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody StEmployeeFundRecord stEmployeeFundRecord) public AjaxResult edit(@RequestBody StEmployeeFundRecord stEmployeeFundRecord)
@ -124,7 +124,7 @@ public class StEmployeeFundRecordController extends BaseController
/** /**
* 删除员工资金流水 * 删除员工资金流水
*/ */
@PreAuthorize("@ss.hasPermi('fund:fund:remove')") @PreAuthorize("@ss.hasPermi('fund:remove')")
@Log(title = "员工资金流水", businessType = BusinessType.DELETE) @Log(title = "员工资金流水", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
@ -133,7 +133,7 @@ public class StEmployeeFundRecordController extends BaseController
} }
@Log(title = "流水导入", businessType = BusinessType.IMPORT) @Log(title = "流水导入", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('fund:fund:export')") @PreAuthorize("@ss.hasPermi('fund:export')")
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{ {

View File

@ -8,6 +8,7 @@ import javax.servlet.http.HttpServletResponse;
import com.staffing.common.utils.MinioUtil; import com.staffing.common.utils.MinioUtil;
import com.staffing.common.utils.QRCodeGenerator; import com.staffing.common.utils.QRCodeGenerator;
import com.staffing.custom.domain.StTaskSign;
import io.minio.ObjectWriteResponse; import io.minio.ObjectWriteResponse;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -50,7 +51,9 @@ public class StTaskController extends BaseController
if (task.getCodePic() == null){ if (task.getCodePic() == null){
continue; continue;
} }
task.setCodePic(minioUtil.getObjectURL( "yonggong", task.getCodePic()));
task.setCodePic("https://www.tulkj.cn/file/yonggong/" + task.getCodePic());
// task.setCodePic(minioUtil.getObjectURL( "yonggong", task.getCodePic()));
} }
return getDataTable(list); return getDataTable(list);
} }
@ -73,7 +76,7 @@ public class StTaskController extends BaseController
/** /**
* 获取任务详细信息 * 获取任务详细信息
*/ */
@PreAuthorize("@ss.hasPermi('task:query')") @PreAuthorize("@ss.hasPermi('task:list')")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) public AjaxResult getInfo(@PathVariable("id") Long id)
{ {
@ -93,7 +96,7 @@ public class StTaskController extends BaseController
stTask.setUpdateTime(new Date()); stTask.setUpdateTime(new Date());
stTaskService.insertStTask(stTask); stTaskService.insertStTask(stTask);
String url = "http://yg.pusonggroup.com:81/index.html?id=" + stTask.getId(); String url = "http://www.tulkj.cn:81/index.html?id=" + stTask.getId();
InputStream inputStream = QRCodeGenerator.generateQRCodeImage(url, 500, 500); InputStream inputStream = QRCodeGenerator.generateQRCodeImage(url, 500, 500);
String fileName = System.currentTimeMillis() + stTask.getId() + ".png"; String fileName = System.currentTimeMillis() + stTask.getId() + ".png";
try { try {
@ -118,10 +121,30 @@ public class StTaskController extends BaseController
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody StTask stTask) public AjaxResult edit(@RequestBody StTask stTask)
{ {
//已发放金额的任务不许删除
StTask stTask1 = stTaskService.selectStTaskById(stTask.getId(), true);
for (StTaskSign stTaskSign : stTask1.getListSign()) {
if (stTaskSign.getStEmployeeFundRecord().getPayStatus() == 1){
return error("已发薪的任务禁止修改");
}
}
stTask.setUpdateTime(new Date()); stTask.setUpdateTime(new Date());
return toAjax(stTaskService.updateStTask(stTask)); return toAjax(stTaskService.updateStTask(stTask));
} }
/**
* 修改任务
*/
@PreAuthorize("@ss.hasPermi('task:edit')")
@Log(title = "任务", businessType = BusinessType.UPDATE)
@PutMapping("shangjia")
public AjaxResult shangjia(@RequestBody StTask stTask)
{
stTask.setUpdateTime(new Date());
return toAjax(stTaskService.updateStTask(stTask, false));
}
/** /**
* 删除任务 * 删除任务
*/ */
@ -130,6 +153,16 @@ public class StTaskController extends BaseController
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) public AjaxResult remove(@PathVariable Long[] ids)
{ {
//已发放金额的任务不许删除
for (Long id : ids) {
StTask stTask = stTaskService.selectStTaskById(id, true);
for (StTaskSign stTaskSign : stTask.getListSign()) {
if (stTaskSign.getStEmployeeFundRecord().getPayStatus() == 1){
return error("已发薪的任务禁止删除");
}
}
}
return toAjax(stTaskService.deleteStTaskByIds(ids)); return toAjax(stTaskService.deleteStTaskByIds(ids));
} }
} }

View File

@ -45,6 +45,14 @@ public class StTaskSignController extends BaseController
List<StTaskSign> list = stTaskSignService.selectStTaskSignList(stTaskSign); List<StTaskSign> list = stTaskSignService.selectStTaskSignList(stTaskSign);
return getDataTable(list); return getDataTable(list);
} }
@PreAuthorize("@ss.hasPermi('taskSign:sign:list')")
@GetMapping("/selectStTaskSignByTaskIds")
public TableDataInfo selectStTaskSignByTaskIds(Long taskId)
{
startPage();
List<StTaskSign> list = stTaskSignService.selectStTaskSignByTaskIds(taskId);
return getDataTable(list);
}
/** /**
* 导出签到列表 * 导出签到列表
@ -56,9 +64,11 @@ public class StTaskSignController extends BaseController
{ {
List<StTaskSign> list = stTaskSignService.selectStTaskSignList(stTaskSign); List<StTaskSign> list = stTaskSignService.selectStTaskSignList(stTaskSign);
for (StTaskSign taskSign : list) { for (StTaskSign taskSign : list) {
if (taskSign.getStatus() == 0){ if (taskSign.getStatus() == -1){
taskSign.setStatusStr("未点名");
}else if (taskSign.getStatus() == 0){
taskSign.setStatusStr("未签到"); taskSign.setStatusStr("未签到");
}else{ }else {
taskSign.setStatusStr("已签到"); taskSign.setStatusStr("已签到");
} }

View File

@ -11,6 +11,7 @@ import com.staffing.custom.domain.StTaskSign;
import com.staffing.custom.service.IStEmployeeService; import com.staffing.custom.service.IStEmployeeService;
import com.staffing.custom.service.IStTaskService; import com.staffing.custom.service.IStTaskService;
import com.staffing.custom.service.IStTaskSignService; import com.staffing.custom.service.IStTaskSignService;
import com.staffing.framework.web.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -37,6 +38,8 @@ public class EmployeeTaskController extends BaseController
@Autowired @Autowired
private IStEmployeeService stEmployeeService; private IStEmployeeService stEmployeeService;
@Autowired
private TokenService tokenService;
/** /**
* 查询任务列表 * 查询任务列表
*/ */
@ -52,17 +55,17 @@ public class EmployeeTaskController extends BaseController
stTask.setStatus(1); stTask.setStatus(1);
// 获取当前时间 // 获取当前时间
ZonedDateTime now = ZonedDateTime.now(); ZonedDateTime now = ZonedDateTime.now();
// 将当前时间加上一天然后设置为0点0分 // 今日0点
ZonedDateTime nextDayStart = now.plusDays(1).truncatedTo(ChronoUnit.DAYS); ZonedDateTime nextDayStart = now.plusDays(0).truncatedTo(ChronoUnit.DAYS);
Date nextDayZero = Date.from(nextDayStart.toInstant()); Date dayZero = Date.from(nextDayStart.toInstant());
if (stTask.getDateStatus() != 0){ if (stTask.getDateStatus() != 0){
stTask.setTaskDateCompare(nextDayZero); stTask.setTaskDateCompare(dayZero);
} }
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
long userId = user.getUserId(); long userId = user.getUserId();
List<StTask> list; List<StTask> list;
stTask.getParams().put("order", nextDayZero); stTask.getParams().put("order", dayZero);
if (!self){ if (!self){
list = stTaskService.selectStTaskList(stTask, userId); list = stTaskService.selectStTaskList(stTask, userId);
}else{ }else{
@ -77,6 +80,25 @@ public class EmployeeTaskController extends BaseController
@GetMapping("/baoming") @GetMapping("/baoming")
public AjaxResult baoming(StTaskSign taskSign) public AjaxResult baoming(StTaskSign taskSign)
{ {
SysUser user = SecurityUtils.getLoginUser().getUser();
long userId = user.getUserId();
StEmployee stEmploye = new StEmployee();
stEmploye.setId(userId);
stEmploye.setRealName(taskSign.getEmployeeName());
stEmploye.setIdCard(taskSign.getIdCard());
stEmployeeService.updateStEmployee(stEmploye);
user = SecurityUtils.getLoginUser().getUser();
user.setNickName(taskSign.getEmployeeName());
user.setPhonenumber(taskSign.getPhone());
user.setIdCard(taskSign.getIdCard());
tokenService.refreshToken(SecurityUtils.getLoginUser());
return stTaskSignService.baoming(taskSign); return stTaskSignService.baoming(taskSign);
} }
/** /**

View File

@ -182,7 +182,7 @@ public class EmployeeUserController extends BaseController
{ {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// 生成令牌 // 生成令牌
String token = loginService.wxLogin(loginBody.getLoginCode(), loginBody.getPhoneCode()); String token = loginService.wxLogin(loginBody.getLoginCode(), loginBody.getPhoneCode(), 1);
ajax.put(Constants.TOKEN, token); ajax.put(Constants.TOKEN, token);
return ajax; return ajax;
} }
@ -206,6 +206,12 @@ public class EmployeeUserController extends BaseController
ajax.put("permissions", permissions); ajax.put("permissions", permissions);
return ajax; return ajax;
} }
@GetMapping("verifyToken")
public AjaxResult verifyToken()
{
AjaxResult ajax = AjaxResult.success();
return ajax;
}
/** /**
* 获取路由信息 * 获取路由信息

View File

@ -52,12 +52,12 @@ public class MerchantTaskController extends BaseController
// 获取当前时间 // 获取当前时间
ZonedDateTime now = ZonedDateTime.now(); ZonedDateTime now = ZonedDateTime.now();
// 将当前时间加上一天然后设置为0点0分 // 将当前时间加上一天然后设置为0点0分
ZonedDateTime nextDayStart = now.plusDays(1).truncatedTo(ChronoUnit.DAYS); ZonedDateTime nextDayStart = now.plusDays(0).truncatedTo(ChronoUnit.DAYS);
Date nextDayZero = Date.from(nextDayStart.toInstant()); Date dayZero = Date.from(nextDayStart.toInstant());
if (stTask.getDateStatus() != 0){ if (stTask.getDateStatus() != 0){
stTask.setTaskDateCompare(nextDayZero); stTask.setTaskDateCompare(dayZero);
} }
stTask.getParams().put("order", nextDayZero); stTask.getParams().put("order", dayZero);
List<StTask> list = stTaskService.selectStTaskList(stTask, 0); List<StTask> list = stTaskService.selectStTaskList(stTask, 0);
return getDataTable(list); return getDataTable(list);
} }

View File

@ -170,8 +170,9 @@ public class MerchantUserController extends BaseController
{ {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
// 生成令牌 // 生成令牌
String token = loginService.wxMerchantLogin(loginBody.getLoginCode(), loginBody.getPhoneCode()); String token = loginService.wxLogin(loginBody.getLoginCode(), loginBody.getPhoneCode(), loginBody.getType());
ajax.put(Constants.TOKEN, token); ajax.put(Constants.TOKEN, token);
ajax.put("role", loginBody.getType());
return ajax; return ajax;
} }
/** /**

View File

@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://192.168.18.119:3307/staffing?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.18.119:3308/staffing?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: Ps123456@ password: Ps123456
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭

View File

@ -34,8 +34,8 @@ server:
# 日志配置 # 日志配置
logging: logging:
level: level:
com.staffing: debug com.staffing: DEBUG
org.springframework: warn org.springframework: WARN
# 用户配置 # 用户配置
user: user:
@ -165,7 +165,7 @@ xss:
urlPatterns: /system/*,/monitor/*,/tool/* urlPatterns: /system/*,/monitor/*,/tool/*
minio: minio:
ip: 120.55.69.166 ip: 8.155.21.176
port: 9000 port: 9000
access-key: root access-key: root
secret-key: root_1234 secret-key: root_6688

View File

@ -110,6 +110,11 @@ public class Constants
*/ */
public static final String LOGIN_USER_KEY = "login_user_key"; public static final String LOGIN_USER_KEY = "login_user_key";
/**
* 已删除用户标记
*/
public static final String DELETED_USER_KEY = "deleted_user_key";
/** /**
* 用户ID * 用户ID
*/ */

View File

@ -93,11 +93,22 @@ public class SysUser extends BaseEntity
private String openId; private String openId;
private SysUser.ROLETYPE roleType;
public SysUser() public SysUser()
{ {
} }
public SysUser.ROLETYPE getRoleType() {
return roleType;
}
public void setRoleType(SysUser.ROLETYPE roleType) {
this.roleType = roleType;
}
public String getOpenId() { public String getOpenId() {
return openId; return openId;
} }
@ -341,4 +352,9 @@ public class SysUser extends BaseEntity
.append("dept", getDept()) .append("dept", getDept())
.toString(); .toString();
} }
public enum ROLETYPE{
MERCHANT,
EMPLOYEE;
}
} }

View File

@ -31,6 +31,19 @@ public class LoginBody
private String loginCode; private String loginCode;
private String phoneCode; private String phoneCode;
/**
* emum ROLETYPE
*/
private Integer type;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getLoginCode() { public String getLoginCode() {
return loginCode; return loginCode;
} }

View File

@ -10,8 +10,10 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class WxUtil { public class WxUtil {
public final static String appId = "wx7bc7df6eb945a84f"; // public final static String appId = "wx7bc7df6eb945a84f";//ps
public final static String secret = "60dc8f7e8c850dfbe0170acefa48070a"; // public final static String secret = "60dc8f7e8c850dfbe0170acefa48070a";//ps
public final static String appId = "wx26e952dad7a8aae5";
public final static String secret = "60a85e94d921a385ce52faaaed4a103b";
private static WxToken wxToken = null; private static WxToken wxToken = null;

View File

@ -118,7 +118,22 @@ public class SysLoginService
* 登录验证 * 登录验证
* @return 结果 * @return 结果
*/ */
public String wxLogin(String loginCode, String phoneCode) public String wxLogin(String loginCode, String phoneCode, int type)
{
if (type == SysUser.ROLETYPE.EMPLOYEE.ordinal()){
return wxEmployeeLogin(loginCode, phoneCode);
}else{
return wxMerchantLogin(loginCode, phoneCode);
}
}
/**
* 职工端 登录
* @param loginCode
* @param phoneCode
* @return
*/
public String wxEmployeeLogin(String loginCode, String phoneCode)
{ {
// 登录前置校验 // 登录前置校验
@ -150,6 +165,7 @@ public class SysLoginService
user.setIdCard(stEmployee.getIdCard()); user.setIdCard(stEmployee.getIdCard());
user.setNickName(stEmployee.getRealName()); user.setNickName(stEmployee.getRealName());
user.setOpenId(stEmployee.getOpenId()); user.setOpenId(stEmployee.getOpenId());
user.setRoleType(SysUser.ROLETYPE.EMPLOYEE);
loginUser = new LoginUser(stEmployee.getId(), 0l, user, new HashSet<>()); loginUser = new LoginUser(stEmployee.getId(), 0l, user, new HashSet<>());
} }
catch (Exception e) catch (Exception e)
@ -193,9 +209,8 @@ public class SysLoginService
{ {
throw new ServiceException(MessageUtils.message("user.blocked")); throw new ServiceException(MessageUtils.message("user.blocked"));
} }
user.setRoleType(SysUser.ROLETYPE.MERCHANT);
loginUser = createLoginUser(user); loginUser = createLoginUser(user);
recordLoginInfo(loginUser.getUserId()); recordLoginInfo(loginUser.getUserId());
} }
catch (Exception e) catch (Exception e)

View File

@ -4,6 +4,8 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.staffing.common.core.domain.entity.SysUser;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -23,6 +25,8 @@ import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts; import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm; import io.jsonwebtoken.SignatureAlgorithm;
import static com.staffing.common.constant.Constants.DELETED_USER_KEY;
/** /**
* token验证处理 * token验证处理
* *
@ -72,6 +76,20 @@ public class TokenService
String uuid = (String) claims.get(Constants.LOGIN_USER_KEY); String uuid = (String) claims.get(Constants.LOGIN_USER_KEY);
String userKey = getTokenKey(uuid); String userKey = getTokenKey(uuid);
LoginUser user = redisCache.getCacheObject(userKey); LoginUser user = redisCache.getCacheObject(userKey);
Object cacheMapValue = redisCache.getCacheMapValue(DELETED_USER_KEY, user.getUserId() + "");
if (cacheMapValue != null){
return null;
}
if (user.getUser().getRoleType() != null){
if (user.getUser().getRoleType() != SysUser.ROLETYPE.MERCHANT && request.getServletPath().indexOf("/merchant/") > -1){
return null;
}
if (user.getUser().getRoleType() != SysUser.ROLETYPE.EMPLOYEE && request.getServletPath().indexOf("/employee/") > -1){
return null;
}
}
return user; return user;
} }
catch (Exception e) catch (Exception e)

View File

@ -38,7 +38,7 @@ public class StTask extends BaseEntity
/** 用工数量 */ /** 用工数量 */
@Excel(name = "用工数量") @Excel(name = "用工数量")
private int useNum; private Integer useNum;
/** 二维码 */ /** 二维码 */
@Excel(name = "二维码") @Excel(name = "二维码")
@ -57,20 +57,21 @@ public class StTask extends BaseEntity
private Date createTime; private Date createTime;
@Excel(name = "报名人数") @Excel(name = "报名人数")
private int baomingNum; private Integer baomingNum;
@Excel(name = "签到数量") @Excel(name = "签到数量")
private int signNum; private Integer signNum;//已到人数
//组装参数 //组装参数
private List<StTaskSign> listSign; private List<StTaskSign> listSign;
private StTaskSign selfSign; private StTaskSign selfSign;
private int yfNum; private Integer yfNum;
private int sfNum; private Integer sfNum;
private int dfNum; private Integer dfNum;
private String yfPrice; private String yfPrice;
private String sfPrice; private String sfPrice;
private String dfPrice; private String dfPrice;
private Integer noSignNum;//未到人数
//查询参数 //查询参数
/**0全部 1进行中 2已结束 根据时间查询的参数 */ /**0全部 1进行中 2已结束 根据时间查询的参数 */
@ -83,6 +84,14 @@ public class StTask extends BaseEntity
private Collection<Long> taskIds; private Collection<Long> taskIds;
public Integer getNoSignNum() {
return noSignNum;
}
public void setNoSignNum(Integer noSignNum) {
this.noSignNum = noSignNum;
}
@Override @Override
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
@ -120,49 +129,12 @@ public class StTask extends BaseEntity
this.dfPrice = dfPrice; this.dfPrice = dfPrice;
} }
public int getYfNum() {
return yfNum;
}
public void setYfNum(int yfNum) {
this.yfNum = yfNum;
}
public int getSfNum() {
return sfNum;
}
public void setSfNum(int sfNum) {
this.sfNum = sfNum;
}
public int getDfNum() {
return dfNum;
}
public void setDfNum(int dfNum) {
this.dfNum = dfNum;
}
public void setListSign(List<StTaskSign> listSign) { public void setListSign(List<StTaskSign> listSign) {
this.listSign = listSign; this.listSign = listSign;
} }
public int getBaomingNum() {
return baomingNum;
}
public void setBaomingNum(int baomingNum) {
this.baomingNum = baomingNum;
}
public int getSignNum() {
return signNum;
}
public void setSignNum(int signNum) {
this.signNum = signNum;
}
public void setId(Long id) public void setId(Long id)
{ {
@ -200,16 +172,8 @@ public class StTask extends BaseEntity
{ {
return dayPrice; return dayPrice;
} }
public void setUseNum(int useNum)
{
this.useNum = useNum;
}
public int getUseNum() public void setCodePic(String codePic)
{
return useNum;
}
public void setCodePic(String codePic)
{ {
this.codePic = codePic; this.codePic = codePic;
} }
@ -218,15 +182,7 @@ public class StTask extends BaseEntity
{ {
return codePic; return codePic;
} }
public void setStatus(Integer status)
{
this.status = status;
}
public Integer getStatus()
{
return status;
}
@Override @Override
public String toString() { public String toString() {
@ -242,6 +198,62 @@ public class StTask extends BaseEntity
.toString(); .toString();
} }
public Integer getUseNum() {
return useNum;
}
public void setUseNum(Integer useNum) {
this.useNum = useNum;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getBaomingNum() {
return baomingNum;
}
public void setBaomingNum(Integer baomingNum) {
this.baomingNum = baomingNum;
}
public Integer getSignNum() {
return signNum;
}
public void setSignNum(Integer signNum) {
this.signNum = signNum;
}
public Integer getYfNum() {
return yfNum;
}
public void setYfNum(Integer yfNum) {
this.yfNum = yfNum;
}
public Integer getSfNum() {
return sfNum;
}
public void setSfNum(Integer sfNum) {
this.sfNum = sfNum;
}
public Integer getDfNum() {
return dfNum;
}
public void setDfNum(Integer dfNum) {
this.dfNum = dfNum;
}
@Override @Override
public Date getUpdateTime() { public Date getUpdateTime() {
return updateTime; return updateTime;

View File

@ -54,7 +54,9 @@ public class StTaskSign extends BaseEntity
/** 签到状态 */ /** 签到状态 */
@Excel(name = "签到状态") @Excel(name = "签到状态")
private String statusStr; private String statusStr;
/**
* -1未点 0未到 1已到
*/
private Integer status; private Integer status;
@Excel(name = "二次核验备注") @Excel(name = "二次核验备注")

View File

@ -49,6 +49,8 @@ public interface StEmployeeFundRecordMapper
*/ */
public int updateStEmployeeFundRecord(StEmployeeFundRecord stEmployeeFundRecord); public int updateStEmployeeFundRecord(StEmployeeFundRecord stEmployeeFundRecord);
public int updateStEmployeeFundRecordByTaskAndUid(StEmployeeFundRecord stEmployeeFundRecord); public int updateStEmployeeFundRecordByTaskAndUid(StEmployeeFundRecord stEmployeeFundRecord);
public int updateStEmployeeFundRecordByTask(StEmployeeFundRecord stEmployeeFundRecord);
public int updateStEmployeeFundRecordByEmId(StEmployeeFundRecord stEmployeeFundRecord);
/** /**
* 删除员工资金流水 * 删除员工资金流水
@ -65,4 +67,7 @@ public interface StEmployeeFundRecordMapper
* @return 结果 * @return 结果
*/ */
public int deleteStEmployeeFundRecordByIds(Long[] ids); public int deleteStEmployeeFundRecordByIds(Long[] ids);
public int deleteStEmployeeFundRecordByUidAndTaskId(@Param("taskId") Long taskId, @Param("employeeId") Long employeeId);
} }

View File

@ -48,6 +48,9 @@ public interface StTaskSignMapper
*/ */
public int updateStTaskSign(StTaskSign stTaskSign); public int updateStTaskSign(StTaskSign stTaskSign);
int updateStTaskSignByEmId(StTaskSign stTaskSign);
int updateStTaskSignByTaskId(StTaskSign stTaskSign);
int updateStTaskSignByTaskIdAndEmId(StTaskSign stTaskSign); int updateStTaskSignByTaskIdAndEmId(StTaskSign stTaskSign);
/** /**

View File

@ -1,6 +1,8 @@
package com.staffing.custom.service; package com.staffing.custom.service;
import java.util.List; import java.util.List;
import com.staffing.custom.domain.StEmployee;
import com.staffing.custom.domain.StTask; import com.staffing.custom.domain.StTask;
/** /**
@ -58,7 +60,7 @@ public interface IStTaskService
* @return 结果 * @return 结果
*/ */
public int updateStTask(StTask stTask); public int updateStTask(StTask stTask);
public int updateStTask(StTask stTask, boolean syncRelationsTabel);
/** /**
* 批量删除任务 * 批量删除任务
* *
@ -74,4 +76,6 @@ public interface IStTaskService
* @return 结果 * @return 结果
*/ */
public int deleteStTaskById(Long id); public int deleteStTaskById(Long id);
void updateTaskUserInfo(StEmployee stEmployee);
} }

View File

@ -29,6 +29,8 @@ public interface IStTaskSignService
*/ */
public List<StTaskSign> selectStTaskSignList(StTaskSign stTaskSign); public List<StTaskSign> selectStTaskSignList(StTaskSign stTaskSign);
List<StTaskSign> selectStTaskSignByTaskIds(Long taskId);
AjaxResult baoming(StTaskSign taskSign); AjaxResult baoming(StTaskSign taskSign);
/** /**
* 新增签到 * 新增签到

View File

@ -1,8 +1,17 @@
package com.staffing.custom.service.impl; package com.staffing.custom.service.impl;
import java.util.List; import java.util.List;
import com.staffing.common.core.domain.entity.SysUser;
import com.staffing.common.utils.DateUtils; import com.staffing.common.utils.DateUtils;
import com.staffing.common.utils.SecurityUtils;
import com.staffing.custom.domain.StEmployeeFundRecord;
import com.staffing.custom.domain.StTaskSign;
import com.staffing.custom.mapper.StEmployeeFundRecordMapper;
import com.staffing.custom.mapper.StTaskSignMapper;
import com.staffing.custom.service.IStTaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.staffing.custom.mapper.StEmployeeMapper; import com.staffing.custom.mapper.StEmployeeMapper;
import com.staffing.custom.domain.StEmployee; import com.staffing.custom.domain.StEmployee;
@ -20,6 +29,14 @@ public class StEmployeeServiceImpl implements IStEmployeeService
@Autowired @Autowired
private StEmployeeMapper stEmployeeMapper; private StEmployeeMapper stEmployeeMapper;
@Autowired
private StTaskSignMapper stTaskSignMapper;
@Autowired
private StEmployeeFundRecordMapper stEmployeeFundRecordMapper;
@Autowired
private IStTaskService stTaskService;
/** /**
* 查询员工 * 查询员工
* *
@ -69,6 +86,8 @@ public class StEmployeeServiceImpl implements IStEmployeeService
@Override @Override
public int updateStEmployee(StEmployee stEmployee) public int updateStEmployee(StEmployee stEmployee)
{ {
stTaskService.updateTaskUserInfo(stEmployee);
stEmployee.setUpdateTime(DateUtils.getNowDate()); stEmployee.setUpdateTime(DateUtils.getNowDate());
return stEmployeeMapper.updateStEmployee(stEmployee); return stEmployeeMapper.updateStEmployee(stEmployee);
} }
@ -76,10 +95,14 @@ public class StEmployeeServiceImpl implements IStEmployeeService
@Override @Override
public int updateStEmployeeOrNull(StEmployee stEmployee) public int updateStEmployeeOrNull(StEmployee stEmployee)
{ {
stTaskService.updateTaskUserInfo(stEmployee);
stEmployee.setUpdateTime(DateUtils.getNowDate()); stEmployee.setUpdateTime(DateUtils.getNowDate());
return stEmployeeMapper.updateStEmployeeOrNull(stEmployee); stEmployeeMapper.updateStEmployeeOrNull(stEmployee);
return 1;
} }
/** /**
* 批量删除员工 * 批量删除员工
* *

View File

@ -11,6 +11,7 @@ import java.util.stream.Collectors;
import com.staffing.common.utils.DateUtils; import com.staffing.common.utils.DateUtils;
import com.staffing.common.utils.MinioUtil; import com.staffing.common.utils.MinioUtil;
import com.staffing.common.utils.QRCodeGenerator; import com.staffing.common.utils.QRCodeGenerator;
import com.staffing.custom.domain.StEmployee;
import com.staffing.custom.domain.StEmployeeFundRecord; import com.staffing.custom.domain.StEmployeeFundRecord;
import com.staffing.custom.domain.StTaskSign; import com.staffing.custom.domain.StTaskSign;
import com.staffing.custom.mapper.StEmployeeFundRecordMapper; import com.staffing.custom.mapper.StEmployeeFundRecordMapper;
@ -93,9 +94,12 @@ public class StTaskServiceImpl implements IStTaskService
stTask.setListSign(stTaskSigns); stTask.setListSign(stTaskSigns);
int signNum = 0; int signNum = 0;
int noSignNum = 0;
for (StTaskSign stTaskSign1 : stTaskSigns) { for (StTaskSign stTaskSign1 : stTaskSigns) {
if (stTaskSign1.getStatus() == 1){ if (stTaskSign1.getStatus() == 1){
signNum ++; signNum ++;
}else if (stTaskSign1.getStatus() == 0){
noSignNum++;
} }
stTaskSign1.setTaskName(stTask.getTaskName()); stTaskSign1.setTaskName(stTask.getTaskName());
stTaskSign1.setDayPrice(stTask.getDayPrice()); stTaskSign1.setDayPrice(stTask.getDayPrice());
@ -103,6 +107,7 @@ public class StTaskServiceImpl implements IStTaskService
stTaskSign1.setStEmployeeFundRecord(fundMap.get(stTaskSign1.getEmployeeId())); stTaskSign1.setStEmployeeFundRecord(fundMap.get(stTaskSign1.getEmployeeId()));
} }
stTask.setSignNum(signNum); stTask.setSignNum(signNum);
stTask.setNoSignNum(noSignNum);
stTask.setBaomingNum(stTask.getListSign().size()); stTask.setBaomingNum(stTask.getListSign().size());
return stTask; return stTask;
@ -172,6 +177,7 @@ public class StTaskServiceImpl implements IStTaskService
continue; continue;
} }
int signNum = 0; int signNum = 0;
int noSignNum = 0;
int yfNum = 0;//应发 int yfNum = 0;//应发
int sfNum = 0;//实发 int sfNum = 0;//实发
int dfNum = 0;//待发 int dfNum = 0;//待发
@ -181,21 +187,26 @@ public class StTaskServiceImpl implements IStTaskService
for (StTaskSign stTaskSign : task.getListSign()) { for (StTaskSign stTaskSign : task.getListSign()) {
if (employeeFundRecordMap != null){
StEmployeeFundRecord fundRecord = employeeFundRecordMap.get(stTaskSign.getEmployeeId());
if (fundRecord != null){
stTaskSign.setStEmployeeFundRecord(fundRecord);
if (fundRecord.getPayStatus() == 1){
sfNum++;
sfPrice = sfPrice.add(new BigDecimal(fundRecord.getRealPrice()));
}
yfPrice = yfPrice.add(new BigDecimal(fundRecord.getRealPrice()));
}
}
if (stTaskSign.getStatus() == 0){
noSignNum++;
}
if (stTaskSign.getStatus() == 1){ if (stTaskSign.getStatus() == 1){
signNum ++; signNum ++;
yfNum++; yfNum++;
if (employeeFundRecordMap != null){
StEmployeeFundRecord fundRecord = employeeFundRecordMap.get(stTaskSign.getEmployeeId());
if (fundRecord != null){
stTaskSign.setStEmployeeFundRecord(fundRecord);
if (fundRecord.getPayStatus() == 1){
sfNum++;
sfPrice = sfPrice.add(new BigDecimal(fundRecord.getRealPrice()));
}
yfPrice = yfPrice.add(new BigDecimal(fundRecord.getRealPrice()));
}
}
} }
stTaskSign.setTaskName(task.getTaskName()); stTaskSign.setTaskName(task.getTaskName());
@ -216,6 +227,7 @@ public class StTaskServiceImpl implements IStTaskService
task.setSfPrice(sfPrice.toString()); task.setSfPrice(sfPrice.toString());
task.setDfPrice(dfPrice.toString()); task.setDfPrice(dfPrice.toString());
task.setSignNum(signNum); task.setSignNum(signNum);
task.setNoSignNum(noSignNum);
task.setBaomingNum(task.getListSign().size()); task.setBaomingNum(task.getListSign().size());
} }
@ -262,7 +274,7 @@ public class StTaskServiceImpl implements IStTaskService
List<StTaskSign> listSign = stTask.getListSign(); List<StTaskSign> listSign = stTask.getListSign();
for (StTaskSign stTaskSign : listSign) { for (StTaskSign stTaskSign : listSign) {
stTaskSign.setTaskId(stTask.getId()); stTaskSign.setTaskId(stTask.getId());
stTaskSign.setStatus(0); stTaskSign.setStatus(-1);
stTaskSign.setDayPrice(stTask.getDayPrice()); stTaskSign.setDayPrice(stTask.getDayPrice());
stTaskSign.setTaskName(stTask.getTaskName()); stTaskSign.setTaskName(stTask.getTaskName());
stTaskSignMapper.insertStTaskSign(stTaskSign); stTaskSignMapper.insertStTaskSign(stTaskSign);
@ -270,6 +282,10 @@ public class StTaskServiceImpl implements IStTaskService
return i; return i;
} }
@Override
public int updateStTask(StTask stTask){
return updateStTask(stTask, true);
}
/** /**
* 修改任务 * 修改任务
* *
@ -277,12 +293,30 @@ public class StTaskServiceImpl implements IStTaskService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateStTask(StTask stTask) public int updateStTask(StTask stTask, boolean syncRelationsTabel)
{ {
RLock lock = redissonClient.getLock(stTask.getId() + ""); RLock lock = redissonClient.getLock(stTask.getId() + "");
try { try {
lock.lock(); lock.lock();
if (syncRelationsTabel){
//签到表
StTaskSign stTaskSignUpdate = new StTaskSign();
stTaskSignUpdate.setTaskName(stTask.getTaskName());
stTaskSignUpdate.setDayPrice(stTask.getDayPrice());
stTaskSignUpdate.setTaskId(stTask.getId());
stTaskSignMapper.updateStTaskSignByTaskId(stTaskSignUpdate);
//流水表
StEmployeeFundRecord stEmployeeFundRecord = new StEmployeeFundRecord();
stEmployeeFundRecord.setTaskName(stTask.getTaskName());
stEmployeeFundRecord.setDayPrice(stTask.getDayPrice());
stEmployeeFundRecord.setTaskId(stTask.getId());
stEmployeeFundRecord.setRealPrice(stTask.getDayPrice());
stEmployeeFundRecord.setTaskDate(stTask.getTaskDate());
stEmployeeFundRecordMapper.updateStEmployeeFundRecordByTask(stEmployeeFundRecord);
}
stTask.setUpdateTime(DateUtils.getNowDate()); stTask.setUpdateTime(DateUtils.getNowDate());
StTaskSign param = new StTaskSign(); StTaskSign param = new StTaskSign();
@ -296,12 +330,11 @@ public class StTaskServiceImpl implements IStTaskService
List<StTaskSign> listSign = stTask.getListSign(); List<StTaskSign> listSign = stTask.getListSign();
if (listSign != null) { if (listSign != null) {
for (StTaskSign stTaskSign : listSign) { for (StTaskSign stTaskSign : listSign) {
stTaskSign.setTaskId(stTask.getId());
stTaskSign.setStatus(0);
stTaskSign.setDayPrice(stTask.getDayPrice());
stTaskSign.setTaskName(stTask.getTaskName());
if (!stTaskSignMap.containsKey(stTaskSign.getEmployeeId())) { if (!stTaskSignMap.containsKey(stTaskSign.getEmployeeId())) {
stTaskSign.setTaskId(stTask.getId());
stTaskSign.setStatus(-1);
stTaskSign.setDayPrice(stTask.getDayPrice());
stTaskSign.setTaskName(stTask.getTaskName());
stTaskSignMapper.insertStTaskSign(stTaskSign); stTaskSignMapper.insertStTaskSign(stTaskSign);
} }
stTaskSignMap.remove(stTaskSign.getEmployeeId()); stTaskSignMap.remove(stTaskSign.getEmployeeId());
@ -323,7 +356,7 @@ public class StTaskServiceImpl implements IStTaskService
} }
public int generatePrCode(StTask stTask){ public int generatePrCode(StTask stTask){
String url = "http://yg.pusonggroup.com:81/index.html?id=" + stTask.getId(); String url = "http://www.tulkj.cn:81/index.html?id=" + stTask.getId();
InputStream inputStream = QRCodeGenerator.generateQRCodeImage(url, 500, 500); InputStream inputStream = QRCodeGenerator.generateQRCodeImage(url, 500, 500);
String fileName = System.currentTimeMillis() + stTask.getId() + ".png"; String fileName = System.currentTimeMillis() + stTask.getId() + ".png";
try { try {
@ -361,4 +394,21 @@ public class StTaskServiceImpl implements IStTaskService
{ {
return stTaskMapper.deleteStTaskById(id); return stTaskMapper.deleteStTaskById(id);
} }
public void updateTaskUserInfo(StEmployee stEmployee) {
//将相关报名信息修改
StTaskSign stTaskSign = new StTaskSign();
stTaskSign.setEmployeeId(stEmployee.getId());
stTaskSign.setEmployeeName(stEmployee.getRealName());
stTaskSign.setIdCard(stEmployee.getIdCard());
stTaskSignMapper.updateStTaskSignByEmId(stTaskSign);
StEmployeeFundRecord stEmployeeFundRecord = new StEmployeeFundRecord();
stEmployeeFundRecord.setEmployeeId(stEmployee.getId());
stEmployeeFundRecord.setEmployeeName(stEmployee.getRealName());
stEmployeeFundRecord.setIdCard(stEmployee.getIdCard());
stEmployeeFundRecordMapper.updateStEmployeeFundRecordByEmId(stEmployeeFundRecord);
}
} }

View File

@ -1,5 +1,6 @@
package com.staffing.custom.service.impl; package com.staffing.custom.service.impl;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -65,12 +66,19 @@ public class StTaskSignServiceImpl implements IStTaskSignService
return stTaskSignMapper.selectStTaskSignList(stTaskSign); return stTaskSignMapper.selectStTaskSignList(stTaskSign);
} }
@Override
public List<StTaskSign> selectStTaskSignByTaskIds(Long taskId)
{
return stTaskSignMapper.selectStTaskSignByTaskIds(Arrays.asList(taskId));
}
@Override @Override
public AjaxResult baoming(StTaskSign taskSign) public AjaxResult baoming(StTaskSign taskSign)
{ {
RLock lock = redissonClient.getLock(taskSign.getTaskId() + ""); RLock lock = redissonClient.getLock(taskSign.getTaskId() + "");
try{ try{
lock.lock(); lock.lock();
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
long userId = user.getUserId(); long userId = user.getUserId();
taskSign.setEmployeeId(userId); taskSign.setEmployeeId(userId);
@ -86,8 +94,8 @@ public class StTaskSignServiceImpl implements IStTaskSignService
} }
taskSign.setDayPrice(stTask.getDayPrice()); taskSign.setDayPrice(stTask.getDayPrice());
taskSign.setEmployeeName(taskSign.getEmployeeName()); taskSign.setEmployeeName(taskSign.getEmployeeName());
taskSign.setStatus(0); taskSign.setStatus(-1);//未点名
return AjaxResult.success(); return AjaxResult.success(insertStTaskSign(taskSign));
}finally { }finally {
// 锁被持有 // 锁被持有
if (lock != null && lock.isLocked()) { if (lock != null && lock.isLocked()) {
@ -136,31 +144,42 @@ public class StTaskSignServiceImpl implements IStTaskSignService
updateStTaskSign.setSignTime(new Date()); updateStTaskSign.setSignTime(new Date());
return insertStTaskSign(updateStTaskSign); return insertStTaskSign(updateStTaskSign);
} }
if (stTaskSign.getSignTime() == null && stTaskSign.getStatus() == 0 && updateStTaskSign.getStatus() == 1){ if (stTaskSign.getSignTime() == null && (stTaskSign.getStatus() == 0 || stTaskSign.getStatus() == -1) && updateStTaskSign.getStatus() == 1){
updateStTaskSign.setSignTime(new Date()); updateStTaskSign.setSignTime(new Date());
} }
StEmployeeFundRecord fundRecords = stEmployeeFundRecordMapper.selectStEmployeeFundRecordByUidAndTaskId(stTaskSign.getTaskId(), stTaskSign.getEmployeeId()); if (updateStTaskSign.getStatus() == 0){
if (fundRecords == null){ updateStTaskSign.setSignTime(null);
StTask stTask = stTaskService.selectStTaskById(stTaskSign.getTaskId()); }
StEmployeeFundRecord stEmployeeFundRecord = new StEmployeeFundRecord(); if (stTaskSign == null || updateStTaskSign.getStatus() != stTaskSign.getStatus()){
stEmployeeFundRecord.setTaskId(stTaskSign.getTaskId()); if (updateStTaskSign.getStatus() == 1){
stEmployeeFundRecord.setTaskName(stTask.getTaskName()); StEmployeeFundRecord fundRecords = stEmployeeFundRecordMapper.selectStEmployeeFundRecordByUidAndTaskId(stTaskSign.getTaskId(), stTaskSign.getEmployeeId());
stEmployeeFundRecord.setTaskDate(stTask.getTaskDate()); if (fundRecords == null){
stEmployeeFundRecord.setEmployeeId(stTaskSign.getEmployeeId()); StTask stTask = stTaskService.selectStTaskById(stTaskSign.getTaskId());
stEmployeeFundRecord.setEmployeeName(stTaskSign.getEmployeeName()); StEmployeeFundRecord stEmployeeFundRecord = new StEmployeeFundRecord();
stEmployeeFundRecord.setPhone(stTaskSign.getPhone()); stEmployeeFundRecord.setTaskId(stTaskSign.getTaskId());
stEmployeeFundRecord.setIdCard(stTaskSign.getIdCard()); stEmployeeFundRecord.setTaskName(stTask.getTaskName());
stEmployeeFundRecord.setDayPrice(stTaskSign.getDayPrice()); stEmployeeFundRecord.setTaskDate(stTask.getTaskDate());
stEmployeeFundRecord.setEmployeeId(stTaskSign.getEmployeeId());
stEmployeeFundRecord.setEmployeeName(stTaskSign.getEmployeeName());
stEmployeeFundRecord.setPhone(stTaskSign.getPhone());
stEmployeeFundRecord.setIdCard(stTaskSign.getIdCard());
stEmployeeFundRecord.setDayPrice(stTaskSign.getDayPrice());
// stEmployeeFundRecord.setShouldPrice(stTask.getDayPrice()); // stEmployeeFundRecord.setShouldPrice(stTask.getDayPrice());
stEmployeeFundRecord.setRealPrice(stTask.getDayPrice());//默认实发为日结 stEmployeeFundRecord.setRealPrice(stTask.getDayPrice());//默认实发为日结
// stEmployeeFundRecord.setPayWay(0l); // stEmployeeFundRecord.setPayWay(0l);
// stEmployeeFundRecord.setPayAccount(0l); // stEmployeeFundRecord.setPayAccount(0l);
// stEmployeeFundRecord.setPayTime(); // stEmployeeFundRecord.setPayTime();
stEmployeeFundRecord.setPayStatus(0l); stEmployeeFundRecord.setPayStatus(0l);
stEmployeeFundRecord.setUpdateTime(new Date()); stEmployeeFundRecord.setUpdateTime(new Date());
stEmployeeFundRecord.setTransferNo(OrderUtils.genOrderId("D")); stEmployeeFundRecord.setTransferNo(OrderUtils.genOrderId("D"));
employeeFundRecordService.insertStEmployeeFundRecord(stEmployeeFundRecord); employeeFundRecordService.insertStEmployeeFundRecord(stEmployeeFundRecord);
}
}else{
stEmployeeFundRecordMapper.deleteStEmployeeFundRecordByUidAndTaskId(stTaskSign.getTaskId(), stTaskSign.getEmployeeId());
}
} }
return updateStTaskSignByTaskIdAndEmId(updateStTaskSign); return updateStTaskSignByTaskIdAndEmId(updateStTaskSign);
} }

View File

@ -136,7 +136,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<update id="updateStEmployeeFundRecordByEmId" parameterType="StEmployeeFundRecord">
update st_employee_fund_record
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="taskName != null">task_name = #{taskName},</if>
<if test="taskDate != null">task_date = #{taskDate},</if>
<if test="employeeId != null">employee_id = #{employeeId},</if>
<if test="employeeName != null">employee_name = #{employeeName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="dayPrice != null">day_price = #{dayPrice},</if>
<if test="shouldPrice != null">should_price = #{shouldPrice},</if>
<if test="realPrice != null">real_price = #{realPrice},</if>
<if test="payWay != null">pay_way = #{payWay},</if>
<if test="payAccount != null">pay_account = #{payAccount},</if>
<if test="payTime != null">pay_time = #{payTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="payStatus != null">pay_status = #{payStatus},</if>
<if test="transferNo != null">transfer_no = #{transferNo},</if>
</trim>
where employee_id = #{employeeId}
</update>
<update id="updateStEmployeeFundRecordByTaskAndUid" parameterType="StEmployeeFundRecord"> <update id="updateStEmployeeFundRecordByTaskAndUid" parameterType="StEmployeeFundRecord">
update st_employee_fund_record update st_employee_fund_record
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
@ -160,6 +181,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where task_id = #{taskId} where task_id = #{taskId}
and employee_id = #{employeeId} and employee_id = #{employeeId}
</update> </update>
<update id="updateStEmployeeFundRecordByTask" parameterType="StEmployeeFundRecord">
update st_employee_fund_record
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="taskName != null">task_name = #{taskName},</if>
<if test="taskDate != null">task_date = #{taskDate},</if>
<if test="employeeId != null">employee_id = #{employeeId},</if>
<if test="employeeName != null">employee_name = #{employeeName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="dayPrice != null">day_price = #{dayPrice},</if>
<if test="shouldPrice != null">should_price = #{shouldPrice},</if>
<if test="realPrice != null">real_price = #{realPrice},</if>
<if test="payWay != null">pay_way = #{payWay},</if>
<if test="payAccount != null">pay_account = #{payAccount},</if>
<if test="payTime != null">pay_time = #{payTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="payStatus != null">pay_status = #{payStatus},</if>
<if test="transferNo != null">transfer_no = #{transferNo},</if>
</trim>
where task_id = #{taskId}
</update>
<delete id="deleteStEmployeeFundRecordById" parameterType="Long"> <delete id="deleteStEmployeeFundRecordById" parameterType="Long">
delete from st_employee_fund_record where id = #{id} delete from st_employee_fund_record where id = #{id}
</delete> </delete>
@ -170,4 +213,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<delete id="deleteStEmployeeFundRecordByUidAndTaskId">
delete from st_employee_fund_record
where task_id = #{taskId}
and employee_id = #{employeeId}
</delete>
</mapper> </mapper>

View File

@ -23,7 +23,7 @@
<select id="selectStTaskList" parameterType="StTask" resultMap="StTaskResult"> <select id="selectStTaskList" parameterType="StTask" resultMap="StTaskResult">
select id, task_name, task_date, day_price, use_num, code_pic, status, update_time, create_time select id, task_name, task_date, day_price, use_num, code_pic, status, update_time, create_time
<if test="params.order != null"> <if test="params.order != null">
, (task_date > #{params.order,jdbcType=DATE}) as progress_status , (task_date >= #{params.order,jdbcType=DATE}) as progress_status
</if> </if>
from st_task from st_task
@ -49,7 +49,9 @@
<if test="params.order != null"> <if test="params.order != null">
order by progress_status desc, create_time desc order by progress_status desc, create_time desc
</if> </if>
<if test="params.order == null">
order by create_time desc
</if>
</select> </select>

View File

@ -99,8 +99,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<update id="updateStTaskSignByEmId" parameterType="StTaskSign">
update st_task_sign
<trim prefix="SET" suffixOverrides=",">
<if test="taskId != null">task_id = #{taskId},</if>
<if test="taskName != null">task_name = #{taskName},</if>
<if test="dayPrice != null">day_price = #{dayPrice},</if>
<if test="signTime != null">sign_time = #{signTime},</if>
<if test="employeeId != null">employee_id = #{employeeId},</if>
<if test="employeeName != null">employee_name = #{employeeName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where employee_id = #{employeeId}
</update>
<update id="updateStTaskSignByTaskIdAndEmId" parameterType="StTaskSign"> <update id="updateStTaskSignByTaskIdAndEmId" parameterType="StTaskSign">
update st_task_sign
<trim prefix="SET" suffixOverrides=",">
<if test="taskName != null">task_name = #{taskName},</if>
<if test="dayPrice != null">day_price = #{dayPrice},</if>
sign_time = #{signTime},
<if test="employeeName != null">employee_name = #{employeeName},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="idCard != null">id_card = #{idCard},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where task_id = #{taskId} and employee_id = #{employeeId}
</update>
<update id="updateStTaskSignByTaskId" parameterType="StTaskSign">
update st_task_sign update st_task_sign
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="taskName != null">task_name = #{taskName},</if> <if test="taskName != null">task_name = #{taskName},</if>
@ -112,9 +144,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
</trim> </trim>
where task_id = #{taskId} and employee_id = #{employeeId} where task_id = #{taskId}
</update> </update>
<delete id="deleteStTaskSignById" parameterType="Long"> <delete id="deleteStTaskSignById" parameterType="Long">
delete from st_task_sign where id = #{id} delete from st_task_sign where id = #{id}
</delete> </delete>

View File

@ -6,3 +6,6 @@ ENV = 'production'
# 管理系统/生产环境 # 管理系统/生产环境
VUE_APP_BASE_API = '/prod-api' VUE_APP_BASE_API = '/prod-api'
port = 8089
npm_config_port = 8089

View File

@ -72,6 +72,7 @@
"connect": "3.6.6", "connect": "3.6.6",
"eslint": "7.15.0", "eslint": "7.15.0",
"eslint-plugin-vue": "7.2.0", "eslint-plugin-vue": "7.2.0",
"html-webpack-plugin": "^4.5.2",
"lint-staged": "10.5.3", "lint-staged": "10.5.3",
"runjs": "4.4.2", "runjs": "4.4.2",
"sass": "1.32.13", "sass": "1.32.13",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -34,6 +34,15 @@ export function updateTask(data) {
data: data data: data
}) })
} }
// 修改任务
export function shangjia(data) {
return request({
url: '/task/task/shangjia',
method: 'put',
data: data
})
}
// 删除任务 // 删除任务
export function delTask(id) { export function delTask(id) {
@ -42,3 +51,9 @@ export function delTask(id) {
method: 'delete' method: 'delete'
}) })
} }
export function getListSign(id) {
return request({
url: '/taskSign/sign/selectStTaskSignByTaskIds?taskId=' + id,
method: 'get'
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -55,7 +55,7 @@ const user = {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getInfo().then(res => { getInfo().then(res => {
const user = res.user const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; const avatar = process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles) commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions) commit('SET_PERMISSIONS', res.permissions)

View File

@ -90,6 +90,11 @@
<el-table v-loading="loading" :data="employeeList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="employeeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column hidden label="id" align="center" prop="id" />--> <!-- <el-table-column hidden label="id" align="center" prop="id" />-->
<el-table-column label="用工类型" align="center" prop="employeeType">
<template slot-scope="scope">
<dict-tag :options="dict.type.use_type" :value="scope.row.employeeType"/>
</template>
</el-table-column>
<el-table-column label="名字" align="center" prop="realName" /> <el-table-column label="名字" align="center" prop="realName" />
<el-table-column label="手机" align="center" prop="phone" /> <el-table-column label="手机" align="center" prop="phone" />
<el-table-column label="身份证" align="center" prop="idCard" /> <el-table-column label="身份证" align="center" prop="idCard" />
@ -114,11 +119,7 @@
<el-table-column label="供应商" align="center" prop="supplier" /> <el-table-column label="供应商" align="center" prop="supplier" />
<el-table-column label="员工单价" align="center" prop="employeePrice" /> <el-table-column label="员工单价" align="center" prop="employeePrice" />
<el-table-column label="供应商单价" align="center" prop="supplierPrice" /> <el-table-column label="供应商单价" align="center" prop="supplierPrice" />
<el-table-column label="用工类型" align="center" prop="employeeType">
<template slot-scope="scope">
<dict-tag :options="dict.type.use_type" :value="scope.row.employeeType"/>
</template>
</el-table-column>
<el-table-column label="编辑时间" align="center" prop="updateTime" width="180"> <el-table-column label="编辑时间" align="center" prop="updateTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime) }}</span> <span>{{ parseTime(scope.row.updateTime) }}</span>
@ -153,62 +154,9 @@
/> />
<!-- 添加或修改员工对话框 --> <!-- 添加或修改员工对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="1100px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" :inline="true"> <el-form ref="form" :model="form" :rules="rules" :inline="true">
<el-form-item label="名字" prop="realName" label-width="100px"> <el-form-item label="用工类型" prop="employeeType" label-width="105px" style="width: 100%">
<el-input v-model="form.realName" placeholder="请输入名字" />
</el-form-item>
<el-form-item label="手机" prop="phone" label-width="100px">
<el-input v-model="form.phone" placeholder="请输入手机" />
</el-form-item>
<el-form-item label="身份证" prop="idCard" label-width="100px">
<el-input v-model="form.idCard" placeholder="请输入身份证" />
</el-form-item>
<el-form-item label="性别" prop="sex" label-width="100px">
<el-select v-model="form.sex" placeholder="请选择性别" style="width: 200px;" >
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="民族" prop="nation" label-width="100px">
<el-input v-model="form.nation" placeholder="请输入民族" />
</el-form-item>
<el-form-item label="年龄" prop="age" label-width="100px">
<el-input v-model="form.age" placeholder="请输入年龄" />
</el-form-item>
<el-form-item label="用工单位" prop="useUnit" label-width="100px">
<el-input v-model="form.useUnit" placeholder="请输入用工单位" />
</el-form-item>
<el-form-item label="面试日期" prop="interviewDate" label-width="100px" >
<el-date-picker clearable style="width: 200px;"
v-model="form.interviewDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择面试日期">
</el-date-picker>
</el-form-item>
<el-form-item label="入职日期" prop="entryDate" label-width="100px">
<el-date-picker clearable style="width: 200px;"
v-model="form.entryDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择入职日期">
</el-date-picker>
</el-form-item>
<el-form-item label="供应商" prop="supplier" label-width="100px">
<el-input v-model="form.supplier" placeholder="请输入供应商" style="width: 200px;"/>
</el-form-item>
<el-form-item label="员工单价" prop="employeePrice" label-width="100px">
<el-input v-model="form.employeePrice" placeholder="请输入员工单价" style="width: 192px;"/>
</el-form-item>
<el-form-item label="供应商单价" prop="supplierPrice" label-width="100px">
<el-input v-model="form.supplierPrice" placeholder="请输入供应商单价" style="width: 192px;"/>
</el-form-item>
<el-form-item label="用工类型" prop="employeeType" label-width="100px">
<el-select style="width: 200px;" v-model="form.employeeType" placeholder="请选择用工类型"> <el-select style="width: 200px;" v-model="form.employeeType" placeholder="请选择用工类型">
<el-option <el-option
v-for="dict in dict.type.use_type" v-for="dict in dict.type.use_type"
@ -218,6 +166,61 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="名字" prop="realName" label-width="105px">
<el-input v-model="form.realName" placeholder="请输入名字" />
</el-form-item>
<el-form-item label="手机" prop="phone" label-width="105px">
<el-input v-model="form.phone" placeholder="请输入手机" :disabled="phoneInputDisable"/>
</el-form-item>
<el-form-item label="身份证" prop="idCard" label-width="105px">
<el-input v-model="form.idCard" placeholder="请输入身份证" />
</el-form-item>
<el-form-item label="性别" prop="sex" label-width="105px">
<el-select v-model="form.sex" placeholder="请选择性别" style="width: 200px;" >
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="民族" prop="nation" label-width="105px">
<el-input v-model="form.nation" placeholder="请输入民族" />
</el-form-item>
<el-form-item label="年龄" prop="age" label-width="105px">
<el-input v-model="form.age" placeholder="请输入年龄" />
</el-form-item>
<el-form-item label="用工单位" prop="useUnit" label-width="105px">
<el-input v-model="form.useUnit" placeholder="请输入用工单位" />
</el-form-item>
<el-form-item label="面试日期" prop="interviewDate" label-width="105px" >
<el-date-picker clearable style="width: 200px;"
v-model="form.interviewDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择面试日期">
</el-date-picker>
</el-form-item>
<el-form-item label="入职日期" prop="entryDate" label-width="105px">
<el-date-picker clearable style="width: 200px;"
v-model="form.entryDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择入职日期">
</el-date-picker>
</el-form-item>
<el-form-item label="供应商" prop="supplier" label-width="105px">
<el-input v-model="form.supplier" placeholder="请输入供应商" style="width: 200px;"/>
</el-form-item>
<el-form-item label="员工单价" prop="employeePrice" label-width="105px">
<el-input v-model="form.employeePrice" placeholder="请输入员工单价" style="width: 200px;"/>
</el-form-item>
<el-form-item label="供应商单价" prop="supplierPrice" label-width="87px">
<el-input v-model="form.supplierPrice" placeholder="请输入供应商单价" style="width: 200px;"/>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -278,6 +281,7 @@ export default {
employeeType: [ employeeType: [
{ required: true, message: "用工类型不能为空", trigger: "change" } { required: true, message: "用工类型不能为空", trigger: "change" }
], ],
phoneInputDisable: true,
} }
}; };
}, },
@ -341,9 +345,11 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加员工"; this.title = "添加员工";
this.phoneInputDisable = false;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.phoneInputDisable = true;
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids
getEmployee(id).then(response => { getEmployee(id).then(response => {
@ -400,9 +406,4 @@ export default {
}; };
</script> </script>
<style type="text/css">
.from-input{
width: 100px;
}
</style>

View File

@ -89,7 +89,7 @@
icon="el-icon-upload" icon="el-icon-upload"
size="mini" size="mini"
@click="handleImport" @click="handleImport"
v-hasPermi="['tool:gen:import']" v-hasPermi="['fund:fund:import']"
>导入</el-button> >导入</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">

View File

@ -152,7 +152,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg"); background-image: url("../assets/images/bg.jpg");
background-size: cover; background-size: cover;
} }
.title { .title {

View File

@ -313,7 +313,7 @@
<div class="head"> <div class="head">
<div class="title"> <div class="title">
用工详情 签到详情
</div> </div>
<div class="close" @click="closeSignDialog()"> <div class="close" @click="closeSignDialog()">
X X
@ -368,6 +368,12 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="发放状态" align="center" prop="stEmployeeFundRecord.payStatus">
<template slot-scope="scope">
<dict-tag :options="dict.type.pay_status" :value="scope.row.stEmployeeFundRecord == null ? 0 : scope.row.stEmployeeFundRecord.payStatus"/>
</template>
</el-table-column>
<el-table-column width="200" property="remark" label="二次核验备注说明"></el-table-column> <el-table-column width="200" property="remark" label="二次核验备注说明"></el-table-column>
</el-table> </el-table>
@ -401,7 +407,7 @@
background-color: #ffffff; background-color: #ffffff;
border: 2px solid #000000; border: 2px solid #000000;
border-radius: 5px; border-radius: 5px;
/*width: 75%;*/ width: 75%;
height: 65%; height: 65%;
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -449,12 +455,12 @@
</style> </style>
<script> <script>
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/task/task"; import { listTask, getTask, delTask, addTask, updateTask, shangjia, getListSign } from "@/api/task/task";
import { listEmployee, getEmployee } from "@/api/employee/employee"; import { listEmployee, getEmployee } from "@/api/employee/employee";
import html2canvas from "html2canvas"; import html2canvas from "html2canvas";
export default { export default {
name: "Task", name: "Task",
dicts: ['task_status', 'sign_status'], dicts: ['task_status', 'sign_status', 'pay_status'],
data() { data() {
return { return {
// //
@ -631,13 +637,23 @@
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
//
if (row.listSign == null){
row.listSign = [];
}
for (let i = 0; i < row.listSign.length; i++) {
if (row.listSign[i].stEmployeeFundRecord != null && row.listSign[i].stEmployeeFundRecord.payStatus == 1){
this.$modal.msgError("已有发薪记录,无法修改");
return;
}
}
this.reset(); this.reset();
const id = row.id || this.ids const id = row.id || this.ids
getTask(id).then(response => { getTask(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改任务"; this.title = "修改任务";
console.log( row.listSign)
for (let i = 0; i < row.listSign.length; i++) { for (let i = 0; i < row.listSign.length; i++) {
row.listSign[i].realName = row.listSign[i].employeeName; row.listSign[i].realName = row.listSign[i].employeeName;
this.addEmployeeMap.set(row.listSign[i].phone, row.listSign[i]); this.addEmployeeMap.set(row.listSign[i].phone, row.listSign[i]);
@ -651,7 +667,7 @@
this.reset(); this.reset();
this.form.id = row.id; this.form.id = row.id;
this.form.status = status; this.form.status = status;
updateTask(this.form).then(response => { shangjia(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
@ -703,7 +719,7 @@
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('确认要删除该任务吗?').then(function() { this.$modal.confirm('删除后签到记录也会同步进行删除,确认要删除该任务吗?').then(function() {
return delTask(ids); return delTask(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
@ -726,10 +742,14 @@
this.signDialogOpen = false; this.signDialogOpen = false;
}else{ }else{
this.signDialogOpen = true; this.signDialogOpen = true;
this.listSign = row.listSign;
this.signQueryParams.taskId = row.id; this.signQueryParams.taskId = row.id;
console.log(row);
getListSign(row.id).then(response => {
this.listSign = response.rows;
});
} }
}, },
closeSignDialog(){ closeSignDialog(){
this.signDialogOpen = false; this.signDialogOpen = false;
}, },
@ -830,4 +850,7 @@
} }
} }
.el-table:before {
width: 0 !important;
}
</style> </style>