Merge remote-tracking branch 'origin/master'

This commit is contained in:
liang.chao 2024-10-29 15:25:39 +08:00
commit 577b25aeaa
16 changed files with 95 additions and 48 deletions

View File

@ -41,10 +41,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- sgzb Common Security-->
<dependency>

View File

@ -53,10 +53,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- SpringCloud Loadbalancer -->
<dependency>

View File

@ -43,10 +43,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- FastDFS -->
<dependency>

View File

@ -36,10 +36,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- Swagger UI -->
<dependency>

View File

@ -36,10 +36,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- Swagger UI -->
<dependency>

View File

@ -1402,7 +1402,7 @@ public class TmTaskServiceImpl implements TmTaskService {
log.info("dataString-=========:" + data);
resultDataHandler(data);
} catch (Exception e) {
log.error("请求失败!{}", e);
log.error("推送失败!{}", e);
return AjaxResult.error("推送失败!");
}
//更改推送的状态

View File

@ -20,6 +20,8 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static com.bonus.sgzb.common.core.web.page.TableSupport.PAGE_NUM;
import static com.bonus.sgzb.common.core.web.page.TableSupport.PAGE_SIZE;
@ -270,7 +272,11 @@ public class MaTypeController extends BaseController {
public AjaxResult edit(@RequestBody MaType maType) {
Long parentId = maType.getParentId();
List<MaType> subMas = maTypeMapper.getListByParentId(parentId, null);
boolean containsSameBrother = subMas.stream().anyMatch(o -> o.getTypeName().equals(maType.getTypeName()));
List<MaType> filteredItems = subMas.stream().collect(Collectors.toList());
if (Objects.nonNull(maType.getTypeId())) {
filteredItems = subMas.stream().filter(item -> !maType.getTypeId().equals(item.getTypeId())).collect(Collectors.toList());
}
boolean containsSameBrother = filteredItems.stream().anyMatch(o -> o.getTypeName().equals(maType.getTypeName()));
if (containsSameBrother) {
return AjaxResult.error("修改失败,同级存在相同名称");
}

View File

@ -5,12 +5,10 @@ import com.bonus.sgzb.base.service.IMaTypeKeeperService;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.system.api.domain.SysDept;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -56,11 +54,18 @@ public class MaTypeKeeperController extends BaseController {
return getDataTable(maTypeKeeperService.getListByMaType(userId, typeName));
}
@ApiOperation(value = "查询全部库管员信息")
@GetMapping("/getMaTypeKeeper")
public AjaxResult getMaTypeKeeper(){
List<MaKeeperUser> maTypeList = maTypeKeeperService.getMaTypeKeeper();
@ApiOperation(value = "查询库管员信息")
@PostMapping("/getMaTypeKeeper")
public AjaxResult getMaTypeKeeper(SysDept sysDept){
List<MaKeeperUser> maTypeList = maTypeKeeperService.getMaTypeKeeper(sysDept);
return AjaxResult.success(maTypeList);
}
@ApiOperation(value = "查询公司信息")
@PostMapping("/getEnterprise")
public AjaxResult getEnterprise(SysDept sysDept){
SysDept sysDeptRes = maTypeKeeperService.getEnterprise(sysDept);
return AjaxResult.success(sysDeptRes);
}
}

View File

@ -8,4 +8,6 @@ import java.util.List;
@Mapper
public interface DeptMapper {
public List<SysDept> getDeptList();
SysDept getDeptBySocialCreditCode(SysDept sysDept);
}

View File

@ -35,6 +35,6 @@ public interface MaTypeKeeperMapper {
* 查询全部库管员信息
* @return
*/
List<MaKeeperUser> getMaTypeKeeper();
List<MaKeeperUser> getMaTypeKeeper(Long deptId);
}

View File

@ -3,6 +3,7 @@ package com.bonus.sgzb.base.service;
import com.bonus.sgzb.base.domain.MaKeeperUser;
import com.bonus.sgzb.base.vo.DeptUser;
import com.bonus.sgzb.base.vo.MaTypeKeeperVO;
import com.bonus.sgzb.system.api.domain.SysDept;
import java.util.List;
@ -33,6 +34,13 @@ public interface IMaTypeKeeperService {
* 查询全部库管员信息
* @return
*/
List<MaKeeperUser> getMaTypeKeeper();
List<MaKeeperUser> getMaTypeKeeper(SysDept sysDept);
/**
* 查询企业信息
* @param sysDept
* @return
*/
SysDept getEnterprise(SysDept sysDept);
}

View File

@ -1,13 +1,17 @@
package com.bonus.sgzb.base.service.impl;
import com.bonus.sgzb.base.domain.MaKeeperUser;
import com.bonus.sgzb.base.mapper.DeptMapper;
import com.bonus.sgzb.base.mapper.MaTypeKeeperMapper;
import com.bonus.sgzb.base.service.IMaTypeKeeperService;
import com.bonus.sgzb.base.vo.DeptUser;
import com.bonus.sgzb.base.vo.MaTypeKeeperVO;
import com.bonus.sgzb.system.api.domain.SysDept;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
@ -16,12 +20,16 @@ import java.util.List;
* @author makejava
* @since 2023-11-28 15:34:03
*/
@Slf4j
@Service("maTypeKeeperService")
public class MaTypeKeeperServiceImpl implements IMaTypeKeeperService {
@Autowired
@Resource
private MaTypeKeeperMapper maTypeKeeperMapper;
@Resource
private DeptMapper deptMapper;
/**
* 根据人员名称查询左侧列表
* @param userName
@ -46,12 +54,24 @@ public class MaTypeKeeperServiceImpl implements IMaTypeKeeperService {
}
/**
* 查询全部库管员信息
* 查询库管员信息
* @return
*/
@Override
public List<MaKeeperUser> getMaTypeKeeper() {
return maTypeKeeperMapper.getMaTypeKeeper();
public List<MaKeeperUser> getMaTypeKeeper(SysDept sysDept) {
log.info("MaTypeKeeperServiceImpl getMaTypeKeeper {}", sysDept);
//根据企业机构代码统一社会信用代码获取企业信息
sysDept = deptMapper.getDeptBySocialCreditCode(sysDept);
//获取该企业下的库管员
return maTypeKeeperMapper.getMaTypeKeeper(sysDept.getDeptId());
}
@Override
public SysDept getEnterprise(SysDept sysDept) {
log.info("MaTypeKeeperServiceImpl getEnterprise {}", sysDept);
//根据企业机构代码统一社会信用代码获取企业信息
sysDept = deptMapper.getDeptBySocialCreditCode(sysDept);
return sysDept;
}
}

View File

@ -56,6 +56,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
* @return
*/
public String genderBackCode() {
log.info("enter method genderBackCode");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
@ -68,6 +69,7 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
} else {
code = "PD" + format + "-000" + taskNum;
}
log.info("end method genderBackCode" + code);
return code;
}
@ -97,7 +99,8 @@ public class InventoryAndWarehousingServiceImpl implements InventoryAndWarehousi
//判断提交表单中是否存在相同编码
for (int i = 0; i < machIneDtoList.size() - 1; i++) {
for (int j = i + 1; j < machIneDtoList.size(); j++) {
if (machIneDtoList.get(i).getMaCode().equals(machIneDtoList.get(j).getMaCode())) {
if (StringUtils.isNotEmpty(machIneDtoList.get(i).getMaCode()) && StringUtils.isNotEmpty(machIneDtoList.get(j).getMaCode())
&& machIneDtoList.get(i).getMaCode().equals(machIneDtoList.get(j).getMaCode())) {
throw new ServiceException("列表中包含以下相同的设备编码,请修改后重新提交:" + machIneDtoList.get(i).getMaCode());
}
}

View File

@ -40,7 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
create_by, create_time, update_by, update_time
from sys_dept
</select>
<select id="getDeptBySocialCreditCode" resultType="com.bonus.sgzb.system.api.domain.SysDept">
select * from sys_dept where social_credit_code = #{socialCreditCode}
</select>
<insert id="unitInfoAdd" parameterType="com.bonus.sgzb.base.domain.BmUnitInfo">

View File

@ -28,13 +28,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaTypeKeeper" resultType="com.bonus.sgzb.base.domain.MaKeeperUser">
SELECT
mtk.user_id AS userId,
su.user_id AS userId,
su.user_name AS userName,
su.nick_name AS nickName
FROM
ma_type_keeper mtk
LEFT JOIN sys_user su ON mtk.user_id = su.user_id
GROUP BY
mtk.user_id
sys_user su
left join sys_user_role sur on su.user_id = sur.user_id
left join sys_role sr on sur.role_id = sr.role_id
where
su.company_id = #{deptId} and sr.role_key = 'jjfgs'
</select>
</mapper>

View File

@ -43,10 +43,10 @@
</dependency>
<!-- SpringBoot Actuator -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-actuator</artifactId>-->
<!-- </dependency>-->
<!-- Swagger UI -->
<dependency>