Commit de977859 by tangzhaoqian

登录人信息API 优化,企业中心-显示常用的企业开票资料API 优化

parent 4d80a30b
......@@ -3,19 +3,16 @@ package cn.timer.api.aspect;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import com.alibaba.fastjson.JSONObject;
......@@ -23,7 +20,6 @@ import com.alibaba.fastjson.JSONObject;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.aspect.lang.annotation.BindingResultCtrol;
import cn.timer.api.aspect.lang.bean.ValidationError;
import cn.timer.api.utils.ResultUtil;
......@@ -43,7 +39,7 @@ public class BindingResultAspect {
{
}
// execution 配置织入点
// execution 配置织入点 -匹配 cn.timer.api.controller 包下的所有子包的类的方法
@Pointcut("execution(* cn.timer.api.controller.*.*.*(..))")
public void clazzPointCut()
{
......@@ -78,9 +74,9 @@ public class BindingResultAspect {
fieldString = fieldString.substring(fieldString.lastIndexOf(".") + 1);
}
for (String str : one.getCodes()) {
System.err.println(str);
}
// for (String str : one.getCodes()) {
// System.err.println(str);
// }
ve = ValidationError.builder().field(fieldString).msg(one.getDefaultMessage()).build();
listVe.add(ve);
......@@ -94,25 +90,6 @@ public class BindingResultAspect {
Long endtime = System.currentTimeMillis();
Console.log("执行耗时为{}:" ,endtime-startTime + "ms");
// Object[] objs = joinPoint.getArgs();
//
// List<Object> listObj = CollectionUtil.toList(objs);
// BeanPropertyBindingResult optional = (BeanPropertyBindingResult)listObj.stream()
// .filter(p -> "BeanPropertyBindingResult".equals(ClassUtil.getClassName(p, true)))
// .findFirst()
// .orElse(null);
// if (optional != null && optional.hasErrors()) {
// System.err.println("Optional: "+ optional);
// }
return retVal;
}
......
......@@ -229,14 +229,16 @@ public class QyzxController {
@GetMapping(value = "/invoiceusual")
@ApiOperation(value = "显示常用的企业开票资料", httpMethod = "GET", notes = "接口发布说明")
public Result<QyzxInvoiceUsual> invoiceusual(@CurrentUser UserBean userBean) {
QyzxInvoiceUsual one = new LambdaQueryChainWrapper<QyzxInvoiceUsual>(qyzxInvoiceUsualMapper)
.eq(QyzxInvoiceUsual::getOrgCode, userBean.getOrgCode()).one();
QyzxInvoiceUsual one = qyzxInvoiceUsualMapper.selectOne(new QueryWrapper<QyzxInvoiceUsual>().lambda()
.eq(QyzxInvoiceUsual::getOrgCode, userBean.getOrgCode()));
if (one != null) {
if (one.getShippingArea() == null) {
one.setShippingArea("");
}
if (one.getShippingAddress() == null) {
one.setShippingAddress("");
}
}
return ResultUtil.data(one, "显示常用的企业开票资料");
}
......
......@@ -9,6 +9,7 @@ import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -30,6 +31,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.aspect.lang.annotation.BindingResultCtrol;
import cn.timer.api.aspect.lang.bean.ValidationError;
import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.bean.spmk.SpmkApprovalTemplate;
import cn.timer.api.bean.spmk.SpmkApprovalTemplateG;
......@@ -246,10 +248,24 @@ public class SpmkServiceImpl {
}
/**
* 查询列表-审批组
* 查询列表-审批组-审批管理
*/
@GetMapping(value = "/all_approval_g")
@ApiOperation(value = "11.查询列表-审批组-审批管理", httpMethod = "GET", notes = "查询列表-审批组-审批管理")
@ApiOperationSupport(order = 11)
public Result<Object> selectListAgByAdmin(@CurrentUser UserBean userBean){
List<Integer> depts = zzglBmgwMService.empNumupGetDepts(userBean.getOrgCode(), userBean.getEmpNum());
System.out.println(depts);
return ResultUtil.data(spmkApprovalGMapper.selectListAgInCaByAdmin(userBean.getOrgCode(), userBean.getEmpNum(), depts),"操作成功!");
}
/**
* 查询列表-审批组-个人审批
*/
@GetMapping(value = "/list_approval_g")
@ApiOperation(value = "11.查询列表-审批组", httpMethod = "GET", notes = "查询列表-审批组")
@ApiOperation(value = "11.查询列表-审批组-个人审批", httpMethod = "GET", notes = "查询列表-审批组-个人审批")
@ApiOperationSupport(order = 11)
public Result<Object> selectListAg(@CurrentUser UserBean userBean){
......@@ -399,7 +415,6 @@ public class SpmkServiceImpl {
@Transactional(rollbackFor = Exception.class)
// @BindingResultCtrol(title = "发起审批")
public Result<Object> saveCa(@CurrentUser UserBean userBean,@Valid @RequestBody SpmkApproveSummaryDto spmkApproveSummaryDto,BindingResult bindingResult) throws Exception{
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
......
......@@ -79,6 +79,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.LoginInfoDto;
import cn.timer.api.dto.yggl.LoginerChargeDto;
import cn.timer.api.dto.yggl.LzbQueryDto;
import cn.timer.api.dto.yggl.LzygQueryDto;
......@@ -145,17 +146,35 @@ public class YgglController {
@GetMapping(value = "/loginmessage")
@ApiOperation(value = " 获取登录人的相关信息", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 68)
public Result<YgglMainEmp> loginmessage(@CurrentUser UserBean userBean) {
public Result<LoginInfoDto> loginmessage(@CurrentUser UserBean userBean) {
Integer empNum = userBean.getEmpNum();
Integer orgCode = userBean.getOrgCode();
LoginInfoDto loginInfo = LoginInfoDto.builder().build();
YgglMainEmp ygglMainEmp = new LambdaQueryChainWrapper<YgglMainEmp>(ygglMainEmpMapper)
.select(YgglMainEmp::getBmgwId, YgglMainEmp::getName, YgglMainEmp::getRzTime, YgglMainEmp::getEmpNum)
.select(YgglMainEmp::getBmgwId,
YgglMainEmp::getName,
YgglMainEmp::getRzTime,
YgglMainEmp::getZzTime,
YgglMainEmp::getEmpNum)
.eq(YgglMainEmp::getEmpNum, empNum).eq(YgglMainEmp::getOrgCode, orgCode).one();
if (ygglMainEmp != null) {
Integer gw = ygglMainEmp.getBmgwId();
ZzglBmgwM bmid = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId)
ZzglBmgwM gwObj = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getUpId,ZzglBmgwM::getName)
.eq(ZzglBmgwM::getId, gw).eq(ZzglBmgwM::getOrgCode, orgCode).one();
ygglMainEmp.setUnionid(bmid.toString());
return ResultUtil.data(ygglMainEmp, "部门id返回字段为unionid");
ZzglBmgwM bmObj = new LambdaQueryChainWrapper<ZzglBmgwM>(zzglBmgwMMapper).select(ZzglBmgwM::getId,ZzglBmgwM::getName)
.eq(ZzglBmgwM::getId, gwObj.getUpId()).eq(ZzglBmgwM::getOrgCode, orgCode).one();
loginInfo.setEmpNum(ygglMainEmp.getEmpNum());
loginInfo.setName(ygglMainEmp.getName());
loginInfo.setBmId(bmObj != null ? bmObj.getId() : null);
loginInfo.setBmName(bmObj != null ? bmObj.getName() : null);
loginInfo.setGwId(gw);
loginInfo.setGwName(gwObj != null ? gwObj.getName() : "");
loginInfo.setEntryTime(ygglMainEmp.getRzTime());
loginInfo.setRegularTime(ygglMainEmp.getRzTime());
}
return ResultUtil.data(loginInfo, "操作成功!");
}
/**
......
......@@ -21,4 +21,6 @@ public interface SpmkApprovalGMapper extends BaseMapper<SpmkApprovalG> {
boolean updateListRandsById(List<SpmkApprovalG> list);
List<SpmkApprovalG> selectListAgInCaByAdmin(@Param("org_code") Integer org_code, @Param("emp_num") Integer emp_num, @Param("deptIds") List<Integer> deptIds);
}
......@@ -2,12 +2,10 @@ package cn.timer.api.dto.spmk;
import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.ApiModelProperty;
......
package cn.timer.api.dto.yggl;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class LoginInfoDto {
@ApiModelProperty(value = "员工id", example = "1")
private Integer empNum;
@ApiModelProperty(value = "员工姓名", example = "1")
private String name;
@ApiModelProperty(value = "部门id", example = "1")
private Integer bmId;
@ApiModelProperty(value = "部门名称", example = "1")
private String bmName;
@ApiModelProperty(value = "岗位id", example = "1")
private Integer gwId;
@ApiModelProperty(value = "岗位名称", example = "1")
private String gwName;
@ApiModelProperty(value = "入职日期", example = "1")
private Date entryTime;
@ApiModelProperty(value = "转正时间", example = "1")
private Date regularTime;
}
......@@ -66,6 +66,18 @@
b.router SpmkCustomApproval_router -->
</sql>
<select id="selectListAgInCaByAdmin" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias_a" />,
<include refid="Base_Column_List_Alias_ca" />
FROM spmk_approval_g a
LEFT JOIN spmk_custom_approval b
ON a.id = b.approval_g_id
WHERE a.org_code = #{org_code}
ORDER BY a.ranks, b.ranks
</select>
<select id="selectListAgInCa" resultMap="BaseResultMapDto">
SELECT
<include refid="Base_Column_List_Alias_a" />,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment