退料审核通过和驳回逻辑提交
This commit is contained in:
parent
1f5869efe5
commit
32b9538771
|
|
@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录校验方法
|
* 登录校验方法
|
||||||
|
|
@ -212,7 +209,8 @@ public class SysLoginService {
|
||||||
*/
|
*/
|
||||||
public void register(RegisterBody registerBody) {
|
public void register(RegisterBody registerBody) {
|
||||||
String username = registerBody.getUsername();
|
String username = registerBody.getUsername();
|
||||||
String password = registerBody.getPassword();
|
// 随机生成一个10位数密码
|
||||||
|
String password = generateRandomPassword(10);
|
||||||
String phone = registerBody.getPhone();
|
String phone = registerBody.getPhone();
|
||||||
// 用户名或密码为空 错误
|
// 用户名或密码为空 错误
|
||||||
if (StringUtils.isAnyBlank(username, password)) {
|
if (StringUtils.isAnyBlank(username, password)) {
|
||||||
|
|
@ -270,12 +268,16 @@ public class SysLoginService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static long[] convertToLongArray(int num) {
|
// 生成一个随时length位数密码
|
||||||
String numStr = Integer.toString(num);
|
public static String generateRandomPassword(int length) {
|
||||||
long[] longArray = new long[numStr.length()];
|
String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
for (int i = 0; i < numStr.length(); i++) {
|
Random random = new Random();
|
||||||
longArray[i] = Long.parseLong(String.valueOf(numStr.charAt(i)));
|
StringBuilder password = new StringBuilder();
|
||||||
|
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
int index = random.nextInt(characters.length());
|
||||||
|
password.append(characters.charAt(index));
|
||||||
}
|
}
|
||||||
return longArray;
|
return password.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,10 @@ public class LeaseOutDetailsController extends BaseController {
|
||||||
int i = leaseOutDetailsService.bindMachineByRfid(maMachine);
|
int i = leaseOutDetailsService.bindMachineByRfid(maMachine);
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
return AjaxResult.success("绑定成功");
|
return AjaxResult.success("绑定成功");
|
||||||
|
} else if (i == 1) {
|
||||||
|
return AjaxResult.error("未查询到该设备");
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("绑定失败");
|
return AjaxResult.error("该设备已绑定");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,10 +52,14 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
@Override
|
@Override
|
||||||
public int bindMachineByRfid(MaMachine maMachine) {
|
public int bindMachineByRfid(MaMachine maMachine) {
|
||||||
List<MaMachine> maMachineByMaIdAndMaCode = maMachineMapper.getMaMachineByMaIdAndMaCode(maMachine);
|
List<MaMachine> maMachineByMaIdAndMaCode = maMachineMapper.getMaMachineByMaIdAndMaCode(maMachine);
|
||||||
if (CollUtil.isNotEmpty(maMachineByMaIdAndMaCode)){
|
if (CollUtil.isNotEmpty(maMachineByMaIdAndMaCode)) {
|
||||||
for (MaMachine machine : maMachineByMaIdAndMaCode) {
|
for (MaMachine machine : maMachineByMaIdAndMaCode) {
|
||||||
machine.setRfidCode(maMachine.getRfidCode());
|
if (StringUtils.isBlank(machine.getRfidCode())) {
|
||||||
maMachineMapper.updateMaMachine(machine);
|
machine.setRfidCode(maMachine.getRfidCode());
|
||||||
|
maMachineMapper.updateMaMachine(machine);
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -65,9 +69,9 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public AjaxResult submitOutRfid(List<LeaseOutDetails> recordList) {
|
public AjaxResult submitOutRfid(List<LeaseOutDetails> recordList) {
|
||||||
for (LeaseOutDetails bean : recordList){
|
for (LeaseOutDetails bean : recordList) {
|
||||||
AjaxResult ajaxResult = submitOut(bean);
|
AjaxResult ajaxResult = submitOut(bean);
|
||||||
if (ajaxResult.isError()){
|
if (ajaxResult.isError()) {
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -128,9 +132,9 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
leaseOutDetailsMapper.updateTaskStatus(taskId, 34);
|
leaseOutDetailsMapper.updateTaskStatus(taskId, 34);
|
||||||
}
|
}
|
||||||
int j = insSltInfo(taskId, record);
|
int j = insSltInfo(taskId, record);
|
||||||
if (j > 0){
|
if (j > 0) {
|
||||||
return AjaxResult.success("领料出库成功!");
|
return AjaxResult.success("领料出库成功!");
|
||||||
}else {
|
} else {
|
||||||
return AjaxResult.error("出库失败,更新设备规格库存数量时出错!");
|
return AjaxResult.error("出库失败,更新设备规格库存数量时出错!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,25 +150,25 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
return AjaxResult.error("出库操作失败,更新领料数量及状态时出错!");
|
return AjaxResult.error("出库操作失败,更新领料数量及状态时出错!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public int insSltInfo(String taskId,LeaseOutDetails record){
|
public int insSltInfo(String taskId, LeaseOutDetails record) {
|
||||||
SltAgreementInfo sltAgreementInfo = leaseOutDetailsMapper.getSltAgreementInfo(record);
|
SltAgreementInfo sltAgreementInfo = leaseOutDetailsMapper.getSltAgreementInfo(record);
|
||||||
if (sltAgreementInfo != null){
|
if (sltAgreementInfo != null) {
|
||||||
double num = Double.parseDouble(sltAgreementInfo.getNum());
|
double num = Double.parseDouble(sltAgreementInfo.getNum());
|
||||||
double outNum = record.getOutNum();
|
double outNum = record.getOutNum();
|
||||||
sltAgreementInfo.setNum(String.valueOf(num + outNum));
|
sltAgreementInfo.setNum(String.valueOf(num + outNum));
|
||||||
return leaseOutDetailsMapper.updSltInfo(sltAgreementInfo);
|
return leaseOutDetailsMapper.updSltInfo(sltAgreementInfo);
|
||||||
}else {
|
} else {
|
||||||
String agreementId = leaseOutDetailsMapper.getAgreementId(taskId);
|
String agreementId = leaseOutDetailsMapper.getAgreementId(taskId);
|
||||||
String protocol = leaseOutDetailsMapper.getProtocol(agreementId);
|
String protocol = leaseOutDetailsMapper.getProtocol(agreementId);
|
||||||
MaType ma = leaseOutDetailsMapper.getMaType(record.getTypeId());
|
MaType ma = leaseOutDetailsMapper.getMaType(record.getTypeId());
|
||||||
if (protocol.isEmpty()){
|
if (protocol.isEmpty()) {
|
||||||
ma.setFinalPrice(ma.getLeasePrice());
|
ma.setFinalPrice(ma.getLeasePrice());
|
||||||
}else {
|
} else {
|
||||||
if (protocol.equals("1")){
|
if (protocol.equals("1")) {
|
||||||
ma.setFinalPrice(ma.getLeasePrice());
|
ma.setFinalPrice(ma.getLeasePrice());
|
||||||
}else if (protocol.equals("2")){
|
} else if (protocol.equals("2")) {
|
||||||
ma.setFinalPrice(ma.getRentPrice());
|
ma.setFinalPrice(ma.getRentPrice());
|
||||||
}else {
|
} else {
|
||||||
ma.setFinalPrice(ma.getLeasePrice());
|
ma.setFinalPrice(ma.getLeasePrice());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +202,6 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MaMachine> getMaMachineByRfidCode(String rfidCode) {
|
public List<MaMachine> getMaMachineByRfidCode(String rfidCode) {
|
||||||
return maMachineMapper.getMaMachineByRfidCode(rfidCode);
|
return maMachineMapper.getMaMachineByRfidCode(rfidCode);
|
||||||
|
|
|
||||||
|
|
@ -80,24 +80,47 @@ public class BackApplyController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 退料申请详情
|
* 退料申请详情
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "退料申请详情")
|
@ApiOperation(value = "退料申请(查看)")
|
||||||
@GetMapping("/getView")
|
@GetMapping("/getViewByApply")
|
||||||
public TableDataInfo getView(BackApplyInfo bean) {
|
public TableDataInfo getViewByApply(BackApplyInfo bean) {
|
||||||
startPage();
|
startPage();
|
||||||
List<BackApplyInfo> list = backApplyService.getView(bean);
|
bean.setFlag(0);
|
||||||
|
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料申请详情--用于退料单,不带分页
|
* 退料申请详情--用于退料单,不带分页
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "退料单")
|
@ApiOperation(value = "退料申请(退料单、审批)")
|
||||||
@GetMapping("/materialReturnNote")
|
@GetMapping("/materialReturnNoteByApply")
|
||||||
public AjaxResult materialReturnNote(BackApplyInfo bean) {
|
public AjaxResult materialReturnNoteByApply(BackApplyInfo bean) {
|
||||||
|
bean.setFlag(1);
|
||||||
|
List<BackApplyInfo> list = backApplyService.getViewByApply(bean);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 退料审核详情
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退料审核(查看)")
|
||||||
|
@GetMapping("/getViewByExamine")
|
||||||
|
public TableDataInfo getViewByExamine(BackApplyInfo bean) {
|
||||||
|
startPage();
|
||||||
|
List<BackApplyInfo> list = backApplyService.getView(bean);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料审核详情-不带分页
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退料审核(审批/退料单)")
|
||||||
|
@GetMapping("/materialReturnNoteByExamine")
|
||||||
|
public AjaxResult materialReturnNoteByExamine(BackApplyInfo bean) {
|
||||||
List<BackApplyInfo> list = backApplyService.getView(bean);
|
List<BackApplyInfo> list = backApplyService.getView(bean);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料申请详情修改
|
* 退料申请详情修改
|
||||||
*/
|
*/
|
||||||
|
|
@ -223,12 +246,24 @@ public class BackApplyController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 退料申请导出
|
* 退料申请导出
|
||||||
*/
|
*/
|
||||||
@ApiOperation("退料申请导出")
|
@ApiOperation("退料申请列表导出")
|
||||||
@Log(title = "退料申请导出", businessType = BusinessType.EXPORT)
|
@Log(title = "退料申请列表导出", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, BackApplyInfo bean) {
|
public void exportApply(HttpServletResponse response, BackApplyInfo bean) {
|
||||||
List<BackApplyInfo> list = backApplyService.getBackApplyList(bean);
|
List<BackApplyInfo> list = backApplyService.getBackApplyList(bean);
|
||||||
ExcelUtil<BackApplyInfo> util = new ExcelUtil<BackApplyInfo>(BackApplyInfo.class);
|
ExcelUtil<BackApplyInfo> util = new ExcelUtil<BackApplyInfo>(BackApplyInfo.class);
|
||||||
util.exportExcel(response, list, "退料申请数据");
|
util.exportExcel(response, list, "退料申请数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退料审核导出
|
||||||
|
*/
|
||||||
|
@ApiOperation("退料审核列表导出")
|
||||||
|
@Log(title = "退料审核列表导出", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/exportExamine")
|
||||||
|
public void exportExamine(HttpServletResponse response, BackApplyInfo bean) {
|
||||||
|
List<BackApplyInfo> list = backApplyService.getBackAuditList(bean);
|
||||||
|
ExcelUtil<BackApplyInfo> util = new ExcelUtil<BackApplyInfo>(BackApplyInfo.class);
|
||||||
|
util.exportExcel(response, list, "退料申请数据");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,27 @@ public class BackApplyInfo extends BaseEntity {
|
||||||
@ApiModelProperty(value = "退料ID")
|
@ApiModelProperty(value = "退料ID")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="工程id")
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 工程名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="工程名称")
|
||||||
|
private String proName;
|
||||||
|
|
||||||
/** 退料ID-字符串 */
|
/** 退料ID-字符串 */
|
||||||
@ApiModelProperty(value = "退料ID-字符串")
|
@ApiModelProperty(value = "退料ID-字符串")
|
||||||
private String ids;
|
private String ids;
|
||||||
|
|
||||||
|
private String applyStatus;
|
||||||
|
/**
|
||||||
|
* 装备管理方式(0编号 1计数)
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "装备管理方式名称")
|
||||||
|
private String manageTypeName;
|
||||||
|
|
||||||
|
private int flag;
|
||||||
|
|
||||||
/** 退料单号 */
|
/** 退料单号 */
|
||||||
@Excel(name = "退料单号")
|
@Excel(name = "退料单号")
|
||||||
@ApiModelProperty(value = "退料单号")
|
@ApiModelProperty(value = "退料单号")
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ public interface BackApplyMapper {
|
||||||
List<BackApplyInfo> getBackApplyList(BackApplyInfo bean);
|
List<BackApplyInfo> getBackApplyList(BackApplyInfo bean);
|
||||||
|
|
||||||
List<BackApplyInfo> getBackApplyListByAdmin(BackApplyInfo bean);
|
List<BackApplyInfo> getBackApplyListByAdmin(BackApplyInfo bean);
|
||||||
|
List<BackApplyInfo> getBackApplyListByAdmin1(BackApplyInfo bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取在用物料列表
|
* 获取在用物料列表
|
||||||
|
|
@ -73,6 +74,7 @@ public interface BackApplyMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BackApplyInfo> getView(BackApplyInfo bean);
|
List<BackApplyInfo> getView(BackApplyInfo bean);
|
||||||
|
List<BackApplyInfo> getViewByApply(BackApplyInfo bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@ public interface BackApplyService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BackApplyInfo> getView(BackApplyInfo bean);
|
List<BackApplyInfo> getView(BackApplyInfo bean);
|
||||||
|
List<BackApplyInfo> getViewByApply(BackApplyInfo bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料申请详情修改
|
* 退料申请详情修改
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
if (roles.contains("admin")) {
|
if (roles.contains("admin")) {
|
||||||
//管理员可以看到所有退料申请
|
//管理员可以看到所有退料申请
|
||||||
return backApplyMapper.getBackApplyListByAdmin(bean);
|
return backApplyMapper.getBackApplyListByAdmin1(bean);
|
||||||
}
|
}
|
||||||
//个人只能看到自己的申请的退料
|
//个人只能看到自己的申请的退料
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
String username = SecurityUtils.getLoginUser().getUsername();
|
||||||
|
|
@ -126,7 +126,30 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BackApplyInfo> getView(BackApplyInfo bean) {
|
public List<BackApplyInfo> getView(BackApplyInfo bean) {
|
||||||
return backApplyMapper.getView(bean);
|
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||||
|
if (companyId != null) {
|
||||||
|
bean.setCompanyId(companyId.toString());
|
||||||
|
return backApplyMapper.getView(bean);
|
||||||
|
} else {
|
||||||
|
return backApplyMapper.getView(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BackApplyInfo> getViewByApply(BackApplyInfo bean) {
|
||||||
|
List<BackApplyInfo> viewByApply = backApplyMapper.getViewByApply(bean);
|
||||||
|
if (bean.getFlag() == 1) {
|
||||||
|
List<BackApplyInfo> backApplyInfos = new ArrayList<>();
|
||||||
|
for (BackApplyInfo backApplyInfo : viewByApply) {
|
||||||
|
if ("2".equals(backApplyInfo.getStatus()) || "4".equals(backApplyInfo.getStatus())) {
|
||||||
|
backApplyInfos.add(backApplyInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return backApplyInfos;
|
||||||
|
}
|
||||||
|
return viewByApply;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -161,7 +184,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult audit(BackApplyInfo bean) {
|
public AjaxResult audit(BackApplyInfo bean) {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
Long userid = SecurityUtils.getLoginUser().getUserid();
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (!StringUtils.isEmpty(bean.getIds())) {
|
if (!StringUtils.isEmpty(bean.getIds())) {
|
||||||
|
|
@ -169,18 +192,26 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
String id = ids[i];
|
String id = ids[i];
|
||||||
bean.setId(Long.valueOf(id));
|
bean.setId(Long.valueOf(id));
|
||||||
if (roles.contains("jjfgs") || roles.contains("admin")) {
|
if (roles.contains("admin")) {
|
||||||
bean.setCompanyId(companyId.toString());
|
bean.setCreateBy(userid.toString());
|
||||||
bean.setCreateBy(username);
|
|
||||||
bean.setStatus("1");
|
bean.setStatus("1");
|
||||||
int re = backApplyMapper.audit(bean);
|
int re = backApplyMapper.audit(bean);
|
||||||
if (re < 1) {
|
if (re < 1) {
|
||||||
return AjaxResult.error("审核失败");
|
return AjaxResult.error("审核失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roles.contains("tsfgs") || roles.contains("admin")) {
|
if (roles.contains("jjfgs")) {
|
||||||
bean.setCompanyId(companyId.toString());
|
bean.setCompanyId(companyId.toString());
|
||||||
bean.setCreateBy(username);
|
bean.setCreateBy(userid.toString());
|
||||||
|
bean.setStatus("1");
|
||||||
|
int re = backApplyMapper.audit(bean);
|
||||||
|
if (re < 1) {
|
||||||
|
return AjaxResult.error("审核失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (roles.contains("tsfgs")) {
|
||||||
|
bean.setCompanyId(companyId.toString());
|
||||||
|
bean.setCreateBy(userid.toString());
|
||||||
bean.setStatus("3");
|
bean.setStatus("3");
|
||||||
int re = backApplyMapper.audit(bean);
|
int re = backApplyMapper.audit(bean);
|
||||||
if (re < 1) {
|
if (re < 1) {
|
||||||
|
|
@ -209,7 +240,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult refuse(BackApplyInfo bean) {
|
public AjaxResult refuse(BackApplyInfo bean) {
|
||||||
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
String username = SecurityUtils.getLoginUser().getUsername();
|
Long userId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||||
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (!StringUtils.isEmpty(bean.getIds())) {
|
if (!StringUtils.isEmpty(bean.getIds())) {
|
||||||
|
|
@ -217,18 +248,26 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
String id = ids[i];
|
String id = ids[i];
|
||||||
bean.setId(Long.valueOf(id));
|
bean.setId(Long.valueOf(id));
|
||||||
if (roles.contains("jjfgs") || roles.contains("admin")) {
|
if (roles.contains("admin")) {
|
||||||
bean.setCompanyId(companyId.toString());
|
bean.setCreateBy(userId.toString());
|
||||||
bean.setCreateBy(username);
|
|
||||||
bean.setStatus("2");
|
bean.setStatus("2");
|
||||||
int re = backApplyMapper.refuse(bean);
|
int re = backApplyMapper.refuse(bean);
|
||||||
if (re < 1) {
|
if (re < 1) {
|
||||||
return AjaxResult.error("驳回失败");
|
return AjaxResult.error("驳回失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (roles.contains("tsfgs") || roles.contains("admin")) {
|
if (roles.contains("jjfgs")) {
|
||||||
bean.setCompanyId(companyId.toString());
|
bean.setCompanyId(companyId.toString());
|
||||||
bean.setCreateBy(username);
|
bean.setCreateBy(userId.toString());
|
||||||
|
bean.setStatus("2");
|
||||||
|
int re = backApplyMapper.refuse(bean);
|
||||||
|
if (re < 1) {
|
||||||
|
return AjaxResult.error("驳回失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (roles.contains("tsfgs")) {
|
||||||
|
bean.setCompanyId(companyId.toString());
|
||||||
|
bean.setCreateBy(userId.toString());
|
||||||
bean.setStatus("4");
|
bean.setStatus("4");
|
||||||
int re = backApplyMapper.refuse(bean);
|
int re = backApplyMapper.refuse(bean);
|
||||||
if (re < 1) {
|
if (re < 1) {
|
||||||
|
|
@ -243,7 +282,7 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (num == taskIdById.size()) {
|
if (num > 0) {
|
||||||
bean.setTaskStatus("101");
|
bean.setTaskStatus("101");
|
||||||
backApplyMapper.updateTmTask(bean);
|
backApplyMapper.updateTmTask(bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
<if test="companyId != null and companyId != ''">
|
<if test="companyId != null and companyId != ''">
|
||||||
and bai.company_id = #{companyId},
|
and bai.company_id = #{companyId}
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
@ -265,11 +265,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
UPDATE tm_task tt
|
UPDATE tm_task tt
|
||||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||||
SET bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status=#{status},bai.direct_audit_time=NOW()
|
SET bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.status=#{status},bai.direct_audit_time=NOW()
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
<if test="companyId != null and companyId != ''">
|
<if test="companyId != null and companyId != ''">
|
||||||
and bai.company_id = #{companyId},
|
and bai.company_id = #{companyId}
|
||||||
</if>
|
</if>
|
||||||
</update>
|
</update>
|
||||||
<update id="updateTmTask">
|
<update id="updateTmTask">
|
||||||
|
|
@ -304,6 +304,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
bai.id,
|
bai.id,
|
||||||
bai.`code`,
|
bai.`code`,
|
||||||
bai.back_person as backPerson,
|
bai.back_person as backPerson,
|
||||||
|
bai.`status` as applyStatus,
|
||||||
bai.phone,
|
bai.phone,
|
||||||
bpl.lot_id as lotId,
|
bpl.lot_id as lotId,
|
||||||
bpl.lot_name as lotName,
|
bpl.lot_name as lotName,
|
||||||
|
|
@ -352,7 +353,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="time != null and time != ''">
|
<if test="time != null and time != ''">
|
||||||
and bai.back_time =#{time}
|
and bai.back_time =#{time}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
GROUP BY bai.task_id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||||
ORDER BY bai.create_time desc
|
ORDER BY bai.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -433,6 +434,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM
|
FROM
|
||||||
back_apply_details bad
|
back_apply_details bad
|
||||||
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
||||||
|
LEFT JOIN tm_task tt on bai.task_id = tt.task_id
|
||||||
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||||
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
||||||
LEFT JOIN bm_project_lot lot ON lot.lot_id = bagi.project_id
|
LEFT JOIN bm_project_lot lot ON lot.lot_id = bagi.project_id
|
||||||
|
|
@ -443,7 +445,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.task_id = #{taskId}
|
||||||
|
<if test="companyId != null and companyId != ''">
|
||||||
|
and bai.company_id = #{companyId}
|
||||||
|
</if>
|
||||||
<if test="keyWord != null and keyWord != ''">
|
<if test="keyWord != null and keyWord != ''">
|
||||||
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||||
mt.type_name like concat('%', #{keyWord}, '%'))
|
mt.type_name like concat('%', #{keyWord}, '%'))
|
||||||
|
|
@ -588,8 +593,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
SELECT
|
SELECT
|
||||||
bai.id,
|
bai.id,
|
||||||
bai.`code`,
|
bai.`code`,
|
||||||
|
bai.`status` as applyStatus,
|
||||||
bai.back_person as backPerson,
|
bai.back_person as backPerson,
|
||||||
bai.phone,
|
bai.phone,
|
||||||
|
bai.task_id as taskId,
|
||||||
bpl.lot_id as lotId,
|
bpl.lot_id as lotId,
|
||||||
bpl.lot_name as lotName,
|
bpl.lot_name as lotName,
|
||||||
bui.unit_id as unitId,
|
bui.unit_id as unitId,
|
||||||
|
|
@ -648,5 +655,102 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
(SELECT * FROM back_apply_info bai2 WHERE bai2.id = #{id}) dd
|
(SELECT * FROM back_apply_info bai2 WHERE bai2.id = #{id}) dd
|
||||||
on bai1.task_id = dd.task_id
|
on bai1.task_id = dd.task_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getViewByApply" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||||
|
SELECT
|
||||||
|
bai.back_person AS backPerson,
|
||||||
|
bai.phone AS phone,
|
||||||
|
bai.back_time as backTime,
|
||||||
|
lot.lot_name AS lotName,
|
||||||
|
lot.lot_id as proId,
|
||||||
|
lot.pro_id as projectId,
|
||||||
|
lot.lot_name as proName,
|
||||||
|
unit.unit_name AS unitName,
|
||||||
|
unit.unit_id AS unitId,
|
||||||
|
mt.type_name typeCode,
|
||||||
|
mt.num,
|
||||||
|
case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName,
|
||||||
|
mt2.type_name AS typeName,
|
||||||
|
bagi.agreement_code as agreementCode,
|
||||||
|
bai.`status` as `status`,
|
||||||
|
bad.pre_num AS num
|
||||||
|
FROM
|
||||||
|
back_apply_details bad
|
||||||
|
LEFT JOIN back_apply_info bai ON bai.id = bad.parent_id
|
||||||
|
LEFT JOIN tm_task tt on bai.task_id = tt.task_id
|
||||||
|
LEFT JOIN tm_task_agreement tta ON tta.task_id = bai.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bagi ON bagi.agreement_id = tta.agreement_id
|
||||||
|
LEFT JOIN bm_project_lot lot ON lot.lot_id = bagi.project_id
|
||||||
|
LEFT JOIN bm_unit_info unit ON unit.unit_id = bagi.unit_id
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = bad.type_id
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id = bad.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt1.parent_id
|
||||||
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||||
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
|
WHERE
|
||||||
|
bai.task_id in (SELECT task_id from back_apply_info WHERE id = #{id})
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and (mt2.type_name like concat('%', #{keyWord}, '%') or
|
||||||
|
mt.type_name like concat('%', #{keyWord}, '%'))
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="getBackApplyListByAdmin1" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||||
|
SELECT
|
||||||
|
bai.id,
|
||||||
|
bai.`code`,
|
||||||
|
bai.`status` as applyStatus,
|
||||||
|
bai.back_person as backPerson,
|
||||||
|
bai.phone,
|
||||||
|
bai.task_id as taskId,
|
||||||
|
bpl.lot_id as lotId,
|
||||||
|
bpl.lot_name as lotName,
|
||||||
|
bui.unit_id as unitId,
|
||||||
|
bui.unit_name as unitName,
|
||||||
|
bai.back_time as backTime,
|
||||||
|
bagi.agreement_code as agreementCode,
|
||||||
|
tt.task_status as taskStatus,
|
||||||
|
tta.agreement_id as agreementId,
|
||||||
|
GROUP_CONCAT(bai.company_id) as companyId,
|
||||||
|
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
|
||||||
|
GROUP_CONCAT(mt2.type_name) AS typeName,
|
||||||
|
GROUP_CONCAT(bad.status) AS status
|
||||||
|
FROM
|
||||||
|
back_apply_info bai
|
||||||
|
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||||
|
LEFT JOIN tm_task tt on tt.task_id=bai.task_id
|
||||||
|
LEFT JOIN tm_task_agreement tta on tta.task_id=tt.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bagi on bagi.agreement_id=tta.agreement_id
|
||||||
|
LEFT JOIN bm_project_lot bpl on bpl.lot_id=bagi.project_id
|
||||||
|
LEFT JOIN bm_unit_info bui on bui.unit_id=bagi.unit_id
|
||||||
|
LEFT JOIN sys_user us on us.user_id=bai.create_by
|
||||||
|
LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id
|
||||||
|
LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id
|
||||||
|
WHERE
|
||||||
|
1=1
|
||||||
|
<if test="keyWord != null and keyWord != ''">
|
||||||
|
and (bai.`code` like concat('%', #{keyWord}, '%') or
|
||||||
|
bai.back_person like concat('%', #{keyWord}, '%') or
|
||||||
|
bai.phone like concat('%', #{keyWord}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="unitId != null and unitId != ''">
|
||||||
|
and bui.unit_id = #{unitId}
|
||||||
|
</if>
|
||||||
|
<if test="lotId != null and lotId != ''">
|
||||||
|
and bpl.lot_id = #{lotId}
|
||||||
|
</if>
|
||||||
|
<if test="proId != null and proId != ''">
|
||||||
|
and bpl.lot_id = #{proId}
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus != null and taskStatus != ''">
|
||||||
|
and tt.task_status = #{taskStatus}
|
||||||
|
</if>
|
||||||
|
<if test="agreementCode != null and agreementCode != ''">
|
||||||
|
and bagi.agreement_code like concat('%', #{agreementCode}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="time != null and time != ''">
|
||||||
|
and bai.back_time =#{time}
|
||||||
|
</if>
|
||||||
|
GROUP BY bai.task_id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
|
||||||
|
ORDER BY bai.create_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue