Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
a493718dbd
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.base.api.domain;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -61,6 +62,11 @@ public class MaType extends BaseEntity {
|
|||
@ApiModelProperty(value = "租赁单价")
|
||||
private String leasePrice;
|
||||
|
||||
/** 租赁单价 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "租赁单价")
|
||||
private Date effTime;
|
||||
|
||||
@ApiModelProperty(value = "外部价格")
|
||||
private String rentPrice;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public class BackApplyController extends BaseController {
|
|||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料详情查看", businessType = BusinessType.QUERY)
|
||||
@GetMapping("view")
|
||||
@PostMapping("view")
|
||||
public AjaxResult view(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backApplyService.view(record);
|
||||
|
|
@ -106,7 +106,7 @@ public class BackApplyController extends BaseController {
|
|||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料审核明细", businessType = BusinessType.QUERY)
|
||||
@GetMapping("examineView")
|
||||
@PostMapping("examineView")
|
||||
public AjaxResult examineView(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
List<BackApplyInfo> list =backApplyService.examineView(record);
|
||||
|
|
@ -123,7 +123,7 @@ public class BackApplyController extends BaseController {
|
|||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料删除", businessType = BusinessType.QUERY)
|
||||
@GetMapping("del")
|
||||
@PostMapping("del")
|
||||
public AjaxResult del(@RequestBody BackApplyInfo record) {
|
||||
try {
|
||||
int re =backApplyService.del(record);
|
||||
|
|
@ -144,7 +144,7 @@ public class BackApplyController extends BaseController {
|
|||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料申请-退料单位", businessType = BusinessType.QUERY)
|
||||
@GetMapping("getbackUnit")
|
||||
@PostMapping("getbackUnit")
|
||||
public AjaxResult getbackUnit(@RequestBody BmAgreementInfo record) {
|
||||
try {
|
||||
List<BmAgreementInfo> list =backApplyService.getbackUnit(record);
|
||||
|
|
@ -161,7 +161,7 @@ public class BackApplyController extends BaseController {
|
|||
* @return AjaxResult对象
|
||||
*/
|
||||
@Log(title = "退料申请-退料工程", businessType = BusinessType.QUERY)
|
||||
@GetMapping("getbackPro")
|
||||
@PostMapping("getbackPro")
|
||||
public AjaxResult getbackPro(@RequestBody BmAgreementInfo record) {
|
||||
try {
|
||||
List<BmAgreementInfo> list =backApplyService.getbackPro(record);
|
||||
|
|
|
|||
|
|
@ -81,4 +81,9 @@ public class BackApplyInfo {
|
|||
* 审核备注
|
||||
*/
|
||||
private String directAuditRemark;
|
||||
private String code;
|
||||
private String backPerson;
|
||||
private String lotId;
|
||||
private String unitId;
|
||||
private String backTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.sgzb.base.mapper;
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.sgzb.base.domain.MaLabelBind;
|
||||
import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 机具设备标签ma_label_bindMapper接口
|
||||
|
|
@ -9,6 +11,7 @@ import com.bonus.sgzb.base.vo.MaLabelBindVO;
|
|||
* @author bonus
|
||||
* @date 2023-12-13
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaLabelBindMapper
|
||||
{
|
||||
/**
|
||||
|
|
@ -65,4 +68,6 @@ public interface MaLabelBindMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int updateMaLabelBindByMaIds(Long maId);
|
||||
|
||||
int insertLabelBind(MaLabelBind maLabelBind);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,12 @@
|
|||
package com.bonus.sgzb.base.service.impl;
|
||||
|
||||
import cn.hutool.http.server.HttpServerRequest;
|
||||
import com.bonus.sgzb.base.domain.RepairApplyRecord;
|
||||
import com.bonus.sgzb.base.domain.RepairPartDetails;
|
||||
import com.bonus.sgzb.base.domain.RepairTask;
|
||||
import com.bonus.sgzb.base.domain.RepairTaskDetails;
|
||||
import com.bonus.sgzb.base.domain.vo.TreeSelect;
|
||||
import com.bonus.sgzb.base.domain.vo.dictVo;
|
||||
import com.bonus.sgzb.base.mapper.RepairMapper;
|
||||
import com.bonus.sgzb.base.service.RepairService;
|
||||
import com.bonus.sgzb.common.core.constant.TokenConstants;
|
||||
import com.bonus.sgzb.common.core.utils.SpringUtils;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.service.TokenService;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService {
|
|||
List<Integer> valueList = commonUtil.setMaterialReturnData(list);
|
||||
num = valueList.get(0);
|
||||
num2 = valueList.get(1);
|
||||
rate = commonUtil.getRate(num, num + num2);
|
||||
rate = commonUtil.getRate(num2, num);
|
||||
} catch (Exception e) {
|
||||
log.error("当月退料分析", e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,12 +305,16 @@
|
|||
<select id="getbackList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
bai.id,
|
||||
us.user_name as userName,
|
||||
bai.`code`,
|
||||
bai.back_person as backPerson,
|
||||
bai.phone,
|
||||
bpl.lot_id,
|
||||
bpl.lot_name as lotName,
|
||||
bui.unit_id as unitId,
|
||||
bui.unit_name as unitName,
|
||||
bagi.plan_start_time as planStartTime,
|
||||
bai.back_time as backTime,
|
||||
tt.task_status as taskStatus,
|
||||
tta.agreement_id as agreementId,
|
||||
GROUP_CONCAT(DISTINCT bad.type_id) as typeId,
|
||||
GROUP_CONCAT(CONCAT_WS('/', IFNULL(mt3.type_name, ''))) AS typeName
|
||||
FROM
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@
|
|||
<insert id="insertMaLabelBindS" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO" useGeneratedKeys="true" keyProperty="maId">
|
||||
insert into ma_label_bind
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">ma_id,</if>
|
||||
<if test="labelCode != null">label_code,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="binder != null">binder,</if>
|
||||
|
|
@ -96,6 +97,30 @@
|
|||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="labelCode != null">#{labelCode},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="binder != null">#{binder},</if>
|
||||
<if test="labelType != null">#{labelType},</if>
|
||||
<if test="companyId != null">#{companyId},</if>
|
||||
<if test="isBind != null">#{binderTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertLabelBind">
|
||||
insert into ma_label_bind
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">ma_id,</if>
|
||||
<if test="labelCode != null">label_code,</if>
|
||||
<if test="typeId != null">type_id,</if>
|
||||
<if test="binder != null">binder,</if>
|
||||
<if test="labelType != null">label_type,</if>
|
||||
<if test="companyId != null">company_id,</if>
|
||||
<if test="isBind != null">binder_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="maId != null">#{maId},</if>
|
||||
<if test="labelCode != null">#{labelCode},</if>
|
||||
<if test="typeId != null">#{typeId},</if>
|
||||
<if test="binder != null">#{binder},</if>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
LEFT JOIN tm_task_agreement tta ON bai.task_id = tta.task_id
|
||||
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
|
||||
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id
|
||||
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id
|
||||
LEFT JOIN bm_project_info bpi ON bai2.project_id = bpi.pro_id and bpi.status = '0' and bpi.del_flag = '0'
|
||||
left join sys_user su on rd.create_by = su.user_id
|
||||
left join sys_dic sd on sd.id = tt.task_status
|
||||
where 1=1
|
||||
|
|
|
|||
|
|
@ -62,8 +62,9 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
String result = format.replace("-", "");
|
||||
int num = agreementInfoMapper.selectNumByMonth(nowDate) + 1;
|
||||
String code = "XY" + format + "-000" + num;
|
||||
String code = "XY" + result + "000" + num;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
package com.bonus.sgzb.system.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* 通用映射配置
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Configuration
|
||||
public class ResourcesConfig implements WebMvcConfigurer
|
||||
{
|
||||
/**
|
||||
* 上传文件存储在本地的根路径
|
||||
*/
|
||||
@Value("${file.path}")
|
||||
private String localFilePath;
|
||||
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
@Value("${file.prefix}")
|
||||
public String localFilePrefix;
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry)
|
||||
{
|
||||
/** 本地文件上传路径 */
|
||||
registry.addResourceHandler("/**")
|
||||
.addResourceLocations("file:" + localFilePath + File.separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启跨域
|
||||
*/
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
// 设置允许跨域的路由
|
||||
registry.addMapping( "/**")
|
||||
// 设置允许跨域请求的域名
|
||||
.allowedOrigins("*")
|
||||
// 设置允许的方法
|
||||
.allowedMethods("GET");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.bonus.sgzb.system.controller;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.domain.SelectDto;
|
||||
import com.bonus.sgzb.system.service.SelectService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 统一下拉选
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/select/")
|
||||
public class SelectController {
|
||||
|
||||
@Resource(name = "SelectService")
|
||||
private SelectService service;
|
||||
|
||||
@ApiOperation(value = "往来单位下拉选")
|
||||
@PostMapping("getUnitData")
|
||||
public AjaxResult getUnitData(SelectDto dto) {
|
||||
return service.getUnitData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "工程下拉选")
|
||||
@PostMapping("getProData")
|
||||
public AjaxResult getProData(SelectDto dto) {
|
||||
return service.getProData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "机具类型下拉选")
|
||||
@PostMapping("getMaTypeData")
|
||||
public AjaxResult getMaTypeData(SelectDto dto){
|
||||
return service.getMaTypeData(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "机具类型下拉树")
|
||||
@PostMapping("getMaTypeTreeData")
|
||||
public AjaxResult getMaTypeTreeData(SelectDto dto){
|
||||
// return service.getMaTypeTreeData(dto);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "数据字典下拉选")
|
||||
@PostMapping("getDictByPidCbx")
|
||||
public AjaxResult getDictByPidCbx(SelectDto dto){
|
||||
return service.getDictByPidCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单位树/归属部门/所属上级")
|
||||
@PostMapping("getDeptTree")
|
||||
public AjaxResult getDeptTree(SelectDto dto){
|
||||
return service.getDeptTree(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "岗位下拉选")
|
||||
@PostMapping("getPostCbx")
|
||||
public AjaxResult getPostCbx(SelectDto dto){
|
||||
return service.getPostCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "角色下拉选")
|
||||
@PostMapping("getRoleCbx")
|
||||
public AjaxResult getRoleCbx(SelectDto dto){
|
||||
return service.getRoleCbx(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "单位类型下拉选")
|
||||
@PostMapping("getUnitTypeCbx")
|
||||
public AjaxResult getUnitTypeCbx(SelectDto dto){
|
||||
return service.getUnitTypeCbx(dto);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.sgzb.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
*/
|
||||
@Data
|
||||
public class SelectDto {
|
||||
|
||||
/** 参数id*/
|
||||
private String id;
|
||||
|
||||
/** 2.物品种类 3.设备类型 4.规格型号*/
|
||||
private String type;
|
||||
|
||||
/** 字典表 父类值*/
|
||||
private String parentValue;
|
||||
|
||||
/** 层级*/
|
||||
private String level;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.sgzb.system.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
*/
|
||||
@Data
|
||||
public class SelectVo {
|
||||
|
||||
/** id*/
|
||||
private long id;
|
||||
|
||||
/** 名称*/
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package com.bonus.sgzb.system.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 下拉树-实体类
|
||||
*/
|
||||
@Data
|
||||
public class TreeNode {
|
||||
|
||||
private long id;
|
||||
|
||||
private String label;
|
||||
|
||||
private long parentId;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeNode> children = new ArrayList<>();
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.bonus.sgzb.system.mapper;
|
||||
|
||||
import com.bonus.sgzb.system.domain.SelectDto;
|
||||
import com.bonus.sgzb.system.domain.SelectVo;
|
||||
import com.bonus.sgzb.system.domain.TreeNode;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 统一下拉选
|
||||
*/
|
||||
@Repository("SelectMapper")
|
||||
public interface SelectMapper {
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 往来单位
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 14:23
|
||||
*/
|
||||
List<SelectVo> getUnitData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 工程
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 15:05
|
||||
*/
|
||||
List<SelectVo> getProData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 机具类型
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:02
|
||||
*/
|
||||
List<SelectVo> getMaTypeData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 数据字典下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:23
|
||||
*/
|
||||
List<SelectVo> getDictByPidCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<TreeVo>
|
||||
* @description 单位树/归属部门/所属上级
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:10
|
||||
*/
|
||||
List<TreeNode> getDeptTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 岗位下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:50
|
||||
*/
|
||||
List<SelectVo> getPostCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 角色下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:56
|
||||
*/
|
||||
List<SelectVo> getRoleCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return List<SelectVo>
|
||||
* @description 单位类型下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 18:01
|
||||
*/
|
||||
List<SelectVo> getUnitTypeCbx(SelectDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
package com.bonus.sgzb.system.service;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.domain.SelectDto;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 统一下拉选
|
||||
*/
|
||||
public interface SelectService {
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 往来单位
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 14:20
|
||||
*/
|
||||
AjaxResult getUnitData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 工程
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 15:04
|
||||
*/
|
||||
AjaxResult getProData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 机具类型
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:02
|
||||
*/
|
||||
AjaxResult getMaTypeData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 机具类型-下拉树
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:10
|
||||
*/
|
||||
// AjaxResult getMaTypeTreeData(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 数据字典下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:22
|
||||
*/
|
||||
AjaxResult getDictByPidCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 单位树/归属部门/所属上级
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 16:36
|
||||
*/
|
||||
AjaxResult getDeptTree(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 岗位下拉树
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:45
|
||||
*/
|
||||
AjaxResult getPostCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 角色下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 17:56
|
||||
*/
|
||||
AjaxResult getRoleCbx(SelectDto dto);
|
||||
|
||||
/**
|
||||
* @param dto
|
||||
* @return AjaxResult
|
||||
* @description 单位类型下拉选
|
||||
* @author cwchen
|
||||
* @date 2023/12/20 18:00
|
||||
*/
|
||||
AjaxResult getUnitTypeCbx(SelectDto dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,123 @@
|
|||
package com.bonus.sgzb.system.service.impl;
|
||||
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.system.domain.SelectDto;
|
||||
import com.bonus.sgzb.system.domain.SelectVo;
|
||||
import com.bonus.sgzb.system.domain.TreeNode;
|
||||
import com.bonus.sgzb.system.mapper.SelectMapper;
|
||||
import com.bonus.sgzb.system.service.SelectService;
|
||||
import com.bonus.sgzb.system.util.TreeBuild;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 10488
|
||||
* 统一下拉选
|
||||
*/
|
||||
@Service("SelectService")
|
||||
@Slf4j
|
||||
public class SelectServiceImpl implements SelectService {
|
||||
|
||||
@Resource(name = "SelectMapper")
|
||||
private SelectMapper mapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult getUnitData(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getUnitData(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("往来单位-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getProData(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getProData(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("工程-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getMaTypeData(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getMaTypeData(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("机具类型-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDictByPidCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDictByPidCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("数据字典-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getDeptTree(SelectDto dto) {
|
||||
List<TreeNode> groupList = new ArrayList<>();
|
||||
List<TreeNode> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getDeptTree(dto);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
// 创建树形结构(数据集合作为参数)
|
||||
TreeBuild treeBuild = new TreeBuild(list);
|
||||
// 原查询结果转换树形结构
|
||||
groupList = treeBuild.buildTree();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("单位树/归属部门/所属上级-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(groupList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getPostCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getPostCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("岗位下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getRoleCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getRoleCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("角色下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getUnitTypeCbx(SelectDto dto) {
|
||||
List<SelectVo> list = new ArrayList<>();
|
||||
try {
|
||||
list = mapper.getUnitTypeCbx(dto);
|
||||
} catch (Exception e) {
|
||||
log.error("单位类型下拉选-查询失败", e);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,8 @@ public class SysFileServiceImpl implements SysFileService {
|
|||
FileInfo file = new FileInfo();
|
||||
StandardMultipartHttpServletRequest req = (StandardMultipartHttpServletRequest) request;
|
||||
String photoType = req.getParameter("fileType");
|
||||
String userId = req.getParameter("userId");
|
||||
// String userId = req.getParameter("userId");
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
HashMap<String, Object> map = getFile(req);
|
||||
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
|
||||
MultipartFile item = items.get(0);
|
||||
|
|
@ -61,7 +62,7 @@ public class SysFileServiceImpl implements SysFileService {
|
|||
long size = item.getSize()/1024/1024;
|
||||
file.setFileName(fileName);
|
||||
file.setFileUrl(url);
|
||||
file.setCreator(userId);
|
||||
file.setCreator(userId.toString());
|
||||
file.setType(type);
|
||||
file.setSize(size + "M");
|
||||
file.setWords(words);
|
||||
|
|
@ -97,7 +98,7 @@ public class SysFileServiceImpl implements SysFileService {
|
|||
String tmpName = multipartFile.getOriginalFilename();// 完整路径 IE
|
||||
tmpName = tmpName.substring(tmpName.lastIndexOf("\\") + 1);
|
||||
tmpName = IdUtil.fastSimpleUUID() + tmpName;
|
||||
String imageFiles="/data/sz/zstp/" + fileType + "/";
|
||||
String imageFiles="/data/sgzb/" + fileType + "/";
|
||||
String os = System.getProperty("os.name");
|
||||
if(os.toLowerCase().startsWith("win")){
|
||||
imageFiles="D://files/" + fileType + "/";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
package com.bonus.sgzb.system.util;
|
||||
|
||||
import com.bonus.sgzb.system.domain.TreeNode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* BuildTree 构建树形结构
|
||||
* @author 10488
|
||||
*/
|
||||
public class TreeBuild {
|
||||
|
||||
public List<TreeNode> nodeList = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @param nodeList 将数据集合赋值给nodeList,即所有数据作为所有节点。
|
||||
*/
|
||||
public TreeBuild(List<TreeNode> nodeList){
|
||||
this.nodeList = nodeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取需构建的所有根节点(顶级节点) "0"
|
||||
* @return 所有根节点List集合
|
||||
*/
|
||||
public List<TreeNode> getRootNode(){
|
||||
// 保存所有根节点(所有根节点的数据)
|
||||
List<TreeNode> rootNodeList = new ArrayList<>();
|
||||
// treeNode:查询出的每一条数据(节点)
|
||||
for (TreeNode treeNode : nodeList){
|
||||
// 判断当前节点是否为根节点,此处注意:若parentId类型是String,则要采用equals()方法判断。
|
||||
if (0 == treeNode.getParentId()) {
|
||||
// 是,添加
|
||||
rootNodeList.add(treeNode);
|
||||
}
|
||||
}
|
||||
return rootNodeList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据每一个顶级节点(根节点)进行构建树形结构
|
||||
* @return 构建整棵树
|
||||
*/
|
||||
public List<TreeNode> buildTree(){
|
||||
// treeNodes:保存一个顶级节点所构建出来的完整树形
|
||||
List<TreeNode> treeNodes = new ArrayList<TreeNode>();
|
||||
// getRootNode():获取所有的根节点
|
||||
for (TreeNode treeRootNode : getRootNode()) {
|
||||
// 将顶级节点进行构建子树
|
||||
treeRootNode = buildChildTree(treeRootNode);
|
||||
// 完成一个顶级节点所构建的树形,增加进来
|
||||
treeNodes.add(treeRootNode);
|
||||
}
|
||||
return treeNodes;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归-----构建子树形结构
|
||||
* @param pNode 根节点(顶级节点)
|
||||
* @return 整棵树
|
||||
*/
|
||||
public TreeNode buildChildTree(TreeNode pNode){
|
||||
List<TreeNode> childTree = new ArrayList<TreeNode>();
|
||||
// nodeList:所有节点集合(所有数据)
|
||||
for (TreeNode treeNode : nodeList) {
|
||||
// 判断当前节点的父节点ID是否等于根节点的ID,即当前节点为其下的子节点
|
||||
if (treeNode.getParentId() == pNode.getId()) {
|
||||
// 再递归进行判断当前节点的情况,调用自身方法
|
||||
childTree.add(buildChildTree(treeNode));
|
||||
}
|
||||
}
|
||||
// for循环结束,即节点下没有任何节点,树形构建结束,设置树结果
|
||||
pNode.setChildren(childTree);
|
||||
return pNode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.sgzb.system.mapper.SelectMapper">
|
||||
|
||||
<!--往来单位-->
|
||||
<select id="getUnitData" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
/*根据标段工程id关联协议查询往来单位*/
|
||||
<if test="id != null and id != ''">
|
||||
SELECT DISTINCT bui.unit_id AS id,
|
||||
bui.unit_name AS `name`
|
||||
FROM bm_project_lot bpl
|
||||
LEFT JOIN bm_agreement_info bai ON bpl.lot_id = bai.project_id AND bai.`status` = '1'
|
||||
LEFT JOIN bm_unit_info bui ON bai.unit_id = bui.unit_id AND bui.del_flag = '0'
|
||||
WHERE bpl.lot_id = #{id} AND bpl.del_flag = '0'
|
||||
</if>
|
||||
<if test="id == null or id == ''">
|
||||
SELECT unit_id AS id,
|
||||
unit_name AS `name`
|
||||
FROM bm_unit_info
|
||||
WHERE del_flag = '0'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--工程-->
|
||||
<select id="getProData" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
/*根据往来单位id关联协议查询工程*/
|
||||
<if test="id != null and id != ''">
|
||||
SELECT DISTINCT bpl.lot_id AS id,
|
||||
bpl.lot_name AS `name`
|
||||
FROM bm_unit_info bui
|
||||
LEFT JOIN bm_agreement_info bai ON bui.unit_id = bai.unit_id AND bai.`status` = '1'
|
||||
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id AND bpl.del_flag = '0'
|
||||
WHERE bui.unit_id = #{id} AND bui.del_flag = '0'
|
||||
</if>
|
||||
<if test="id == null or id == ''">
|
||||
SELECT lot_id AS id,
|
||||
lot_name AS `name`
|
||||
FROM bm_project_lot
|
||||
WHERE del_flag = '0'
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--机具类型-->
|
||||
<select id="getMaTypeData" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
SELECT type_id AS id,
|
||||
type_name AS `name`
|
||||
FROM ma_type
|
||||
WHERE `level` = #{type} AND del_flag = '0'
|
||||
</select>
|
||||
<!--数据字典下拉选-->
|
||||
<select id="getDictByPidCbx" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
SELECT sd2.id,sd2.`name`
|
||||
FROM sys_dic sd
|
||||
LEFT JOIN sys_dic sd2 ON sd.id = sd2.p_id
|
||||
WHERE sd.`value` = #{parentValue} AND sd.p_id = 0
|
||||
</select>
|
||||
<!--单位树/归属部门/所属上级-->
|
||||
<select id="getDeptTree" resultType="com.bonus.sgzb.system.domain.TreeNode">
|
||||
SELECT dept_id AS id,
|
||||
parent_id AS parentId,
|
||||
dept_name AS label
|
||||
FROM sys_dept
|
||||
WHERE del_flag = '0'
|
||||
ORDER BY order_num
|
||||
</select>
|
||||
<!--岗位下拉选-->
|
||||
<select id="getPostCbx" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
SELECT post_id AS id,
|
||||
post_name AS `name`
|
||||
FROM sys_post
|
||||
WHERE status = '0'
|
||||
ORDER BY post_sort
|
||||
</select>
|
||||
<!--角色下拉选-->
|
||||
<select id="getRoleCbx" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
SELECT role_id AS id,
|
||||
role_name AS `name`
|
||||
FROM sys_role
|
||||
WHERE status = '0'
|
||||
ORDER BY role_sort
|
||||
</select>
|
||||
<!--单位类型下拉选-->
|
||||
<select id="getUnitTypeCbx" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
SELECT sd2.id,sd2.`name`
|
||||
FROM sys_dic sd
|
||||
LEFT JOIN sys_dic sd2 ON sd.id = sd2.p_id
|
||||
WHERE sd.`value` = #{parentValue} AND sd.p_id = 0
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue