Compare commits
3 Commits
e807076cfe
...
241ec43730
| Author | SHA1 | Date |
|---|---|---|
|
|
241ec43730 | |
|
|
a110304fd2 | |
|
|
55a68298e7 |
|
|
@ -105,7 +105,7 @@ public class SysPasswordService {
|
|||
throw new CaptchaException("手机号不能为空");
|
||||
}
|
||||
String code = VerificationCodeUtils.generateVerificationCode(VerificationCodeUtils.CodeType.NUMERIC);
|
||||
String str = "您的验证码为" + code + ",尊敬的客户,以上验证码3分钟有效,微服务平台提醒您:转发可能导致账号被盗,请勿将验证码泄露于他人";
|
||||
String str = "您的验证码为" + code + ",尊敬的客户,以上验证码3分钟有效,实名制提醒您:转发可能导致账号被盗,请勿将验证码泄露于他人";
|
||||
String verifyKey = CacheConstants.VERIFICATION_CODE + phone;
|
||||
String s = SmsUtils.smsToken(phone, str, "");
|
||||
if (StringUtils.isNotEmpty(s)) {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,11 @@
|
|||
package com.bonus.bmw.controller;
|
||||
|
||||
import com.bonus.bmw.domain.dto.FileBasicMsgDto;
|
||||
import com.bonus.bmw.domain.dto.PmWorkerDto;
|
||||
import com.bonus.bmw.domain.dto.WebFileDto;
|
||||
import com.bonus.bmw.domain.po.BmSubContract;
|
||||
import com.bonus.bmw.domain.po.PmSubCompany;
|
||||
import com.bonus.bmw.domain.vo.BmSubContractVo;
|
||||
import com.bonus.bmw.domain.vo.PmWorker;
|
||||
import com.bonus.bmw.domain.vo.TreeVo;
|
||||
import com.bonus.bmw.service.AppService;
|
||||
import com.bonus.bmw.service.BmSubContractService;
|
||||
import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||
import com.bonus.common.core.utils.json.FastJsonHelper;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.core.web.page.TableDataInfo;
|
||||
import com.bonus.common.log.annotation.SysLog;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.common.security.annotation.InnerAuth;
|
||||
|
|
@ -28,10 +18,6 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* app部分接口
|
||||
|
|
@ -136,4 +122,16 @@ public class AppController extends BaseController {
|
|||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("worker:ein:edit"))
|
||||
@PostMapping("/appWorkerExitFile")
|
||||
@SysLog(title = "人员出场", businessType = OperaType.UPDATE, logType = 0, module = "施工人员->出入场管理->人员出场", details = "人员出场")
|
||||
public AjaxResult appWorkerExitFile(@Validated @RequestBody PmWorkerDto workerDto) {
|
||||
try {
|
||||
return service.appWorkerExitFile(workerDto);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,6 +161,24 @@ public class PmWorkerExitController extends BaseController {
|
|||
return getDataTableError(new ArrayList<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号扫码出场或补文件
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth(isUser = false))
|
||||
@GetMapping("/getWorkerListByPhone")
|
||||
@SysLog(title = "扫码出场", businessType = OperaType.QUERY, logType = 0, module = "施工人员->出入场管理->扫码出场", details = "扫码出场")
|
||||
public AjaxResult getWorkerListByPhone(PmWorkerDto o) {
|
||||
try {
|
||||
List<PmWorker> list = service.getWorkerListByPhone(o);
|
||||
return AjaxResult.success(list);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.toString(), e);
|
||||
}
|
||||
return AjaxResult.error("系统异常,请联系管理员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工程出场历史列表
|
||||
* @param o
|
||||
|
|
|
|||
|
|
@ -198,4 +198,6 @@ public class PmWorker {
|
|||
|
||||
private String facePhotoBase64;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,6 @@ public interface PmWorkerExitMapper {
|
|||
* @return
|
||||
*/
|
||||
List<PmWorker> selectWorkListByProId(PmWorkerDto o);
|
||||
|
||||
List<PmWorker> getWorkerListByPhone(PmWorkerDto o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,6 @@ public interface AppService {
|
|||
* @return
|
||||
*/
|
||||
AjaxResult appWorkerExit(PmWorkerDto workerDto) throws Exception;
|
||||
|
||||
AjaxResult appWorkerExitFile(PmWorkerDto workerDto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,4 +58,12 @@ public interface PmWorkerExitService {
|
|||
* @return
|
||||
*/
|
||||
List<PmWorker> selectWorkListByProId(PmWorkerDto o);
|
||||
|
||||
/**
|
||||
* 根据手机号查询人员列表
|
||||
*
|
||||
* @param o
|
||||
* @return
|
||||
*/
|
||||
List<PmWorker> getWorkerListByPhone(PmWorkerDto o);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ public class AppServiceImpl implements AppService {
|
|||
String[] split = record.getPhotoIds().split(",");
|
||||
for (int x = 0; x < split.length; x++) {
|
||||
int i = mapper.updateFileMsg(split[x], Constants.FILE_UPLOAD_WORKER_EXIT, record.getId());
|
||||
log.error("app更新人员出场:第{}条,{}", x, i > 0 ? "更新成功" : "更新失败");
|
||||
log.error("app人员出场-图片遍历:第{}条,{}", x, i > 0 ? "更新成功" : "更新失败");
|
||||
}
|
||||
isUploadFile = 1;
|
||||
}
|
||||
|
|
@ -261,6 +261,24 @@ public class AppServiceImpl implements AppService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult appWorkerExitFile(PmWorkerDto record) {
|
||||
//修改在场记录表状态
|
||||
int einStatus = 2;
|
||||
//是否上传文件
|
||||
int isUploadFile = 0;
|
||||
if(!StringUtils.isEmpty(record.getPhotoIds())){
|
||||
String[] split = record.getPhotoIds().split(",");
|
||||
for (int x = 0; x < split.length; x++) {
|
||||
int i = mapper.updateFileMsg(split[x], Constants.FILE_UPLOAD_WORKER_EXIT, record.getId());
|
||||
log.error("app人员出场-补-图片遍历:第{}条,{}", x, i > 0 ? "更新成功" : "更新失败");
|
||||
}
|
||||
isUploadFile = 1;
|
||||
}
|
||||
int k = pmWorkerExitMapper.updateEinProRecordStatus(record.getId(),einStatus,isUploadFile,record.getExitWay(),"");
|
||||
return k>0 ? AjaxResult.success() :AjaxResult.error("离场失败");
|
||||
}
|
||||
|
||||
static void delUrkUser(PmWorkerDto record, UrkSendService urkSendService) throws Exception {
|
||||
int workerId = record.getWorkerId()==null?0:record.getWorkerId();
|
||||
int proId = record.getProId()==null?0:record.getProId();
|
||||
|
|
|
|||
|
|
@ -215,4 +215,9 @@ public class PmWorkerExitServiceImpl implements PmWorkerExitService {
|
|||
return mapper.selectWorkListByProId(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmWorker> getWorkerListByPhone(PmWorkerDto o) {
|
||||
return mapper.getWorkerListByPhone(o);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
<result column="is_upload_file" property="isUploadFile" />
|
||||
<result column="days_since_exit" property="daysSinceExit" />
|
||||
<result column="is_shanghai" property="isShanghai"/>
|
||||
<result column="type" property="type"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectWorkList" resultMap="BaseResultMap">
|
||||
|
|
@ -209,4 +210,57 @@
|
|||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="getWorkerListByPhone" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
bwepr.id,
|
||||
pw.id as worker_id,
|
||||
pw.`name`,
|
||||
pw.id_number,
|
||||
bwepr.pro_id,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_id,
|
||||
bwepr.sub_name,
|
||||
bwepr.team_id,
|
||||
bwepr.team_name,
|
||||
bwepr.post_id,
|
||||
bwepr.post_name,
|
||||
pp.is_shanghai,
|
||||
'1' as type
|
||||
FROM
|
||||
pm_worker pw
|
||||
INNER JOIN bm_worker_ein_pro_record bwepr ON bwepr.worker_id = pw.id
|
||||
INNER JOIN pm_project pp ON pp.id = bwepr.pro_id
|
||||
WHERE
|
||||
pw.is_active = 1
|
||||
AND pw.phone = #{phone}
|
||||
AND bwepr.is_upload_file is null
|
||||
|
||||
UNION
|
||||
|
||||
SELECT
|
||||
bwepr.id,
|
||||
pw.id as worker_id,
|
||||
pw.`name`,
|
||||
pw.id_number,
|
||||
bwepr.pro_id,
|
||||
bwepr.pro_name,
|
||||
bwepr.sub_id,
|
||||
bwepr.sub_name,
|
||||
bwepr.team_id,
|
||||
bwepr.team_name,
|
||||
bwepr.post_id,
|
||||
bwepr.post_name,
|
||||
pp.is_shanghai,
|
||||
'2' as type
|
||||
FROM
|
||||
pm_worker pw
|
||||
INNER JOIN bm_worker_ein_pro_record bwepr ON bwepr.worker_id = pw.id
|
||||
INNER JOIN pm_project pp ON pp.id = bwepr.pro_id
|
||||
WHERE
|
||||
pw.is_active = 1
|
||||
AND pw.phone = #{phone}
|
||||
AND bwepr.is_upload_file = 0 and pp.is_shanghai = 0
|
||||
and if(is_upload_file=0,DATEDIFF(NOW(), exit_time),0) < 31
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -440,6 +440,6 @@
|
|||
<select id="selectWorkerByPhotoNumber" resultType="int">
|
||||
select count(1)
|
||||
from pm_worker
|
||||
where phone = #{photoNumber}
|
||||
where phone = #{photoNumber} and is_active = 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue