租赁协议以及数据隔离

This commit is contained in:
liang.chao 2024-12-13 17:09:37 +08:00
parent 44191194b3
commit 3ef1f51584
7 changed files with 26 additions and 9 deletions

View File

@ -66,6 +66,9 @@ public class MaDevQc extends BaseEntity implements Serializable {
@ApiModelProperty(value = "上传人")
private String nickName;
@ApiModelProperty(value = "创建人所属公司")
private String qcCom;
@ApiModelProperty(value = "质检次数")
private Integer minNum;
private Integer maxNum;

View File

@ -52,4 +52,7 @@ public class SafeBookInfo {
@ApiModelProperty(value = "上传人")
private String nickName;
@ApiModelProperty(value = "上传人所属公司")
private Integer uploadCom;
}

View File

@ -44,6 +44,7 @@ public class MaDevQcServiceImpl implements MaDevQcService {
*/
@Override
public List<MaDevQc> selectDevQcList(MaDevQc maDevQc) {
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
return maDevQcMapper.selectDevQcList(maDevQc);
}
@ -62,6 +63,7 @@ public class MaDevQcServiceImpl implements MaDevQcService {
maDevQc.setQcCode(code);
maDevQc.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
maDevQc.setCreateTime(DateUtils.getNowDate());
maDevQc.setQcCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().toString());
int result = maDevQcMapper.insertDevQc(maDevQc);
devInfoMapper.updateDevInfoIsQc(maDevQc);
if (result > 0 && maDevQc.getId() != null) {

View File

@ -37,6 +37,7 @@ public class SafeBookServiceImpl implements SafeBookService {
@Override
public List<SafeBookInfo> getSafeBookByMaId(SafeBookInfo safeBookInfo) {
safeBookInfo.setUploadCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
return safeBookMapper.getSafeBookByMaId(safeBookInfo);
}
@ -44,6 +45,7 @@ public class SafeBookServiceImpl implements SafeBookService {
public Integer addSafeBook(SafeBookInfo safeBookInfo) {
safeBookInfo.setCode(getString());
safeBookInfo.setUploadPerson(SecurityUtils.getLoginUser().getUserid());
safeBookInfo.setUploadCom(SecurityUtils.getLoginUser().getSysUser().getCompanyId().intValue());
Integer i = safeBookMapper.addSafeBook(safeBookInfo);
devInfoMapper.updateDevInfoIsSafeBook(safeBookInfo);
if (i > 0) {

View File

@ -164,18 +164,19 @@ public class OrderController extends BaseController {
}
@ApiOperation(value = "租赁协议(查看)")
@GetMapping("/leaseAgreement")
public ResponseEntity<byte[]> getleaseAgreement(String orderId,
Map<String, String> replacements) throws IOException {
@PostMapping("/leaseAgreement")
public ResponseEntity<byte[]> getleaseAgreement(@RequestParam String orderId,
@RequestParam("file") MultipartFile file,
@RequestParam Map<String, String> replacements) throws IOException {
OrderInfoDto orderInfoDto = orderService.getAgreementByOrderId(orderId);
BmContract bmContract = new BmContract();
/* BmContract bmContract = new BmContract();
bmContract.setStatus(1);
List<BmContract> list = bmContractService.list(bmContract);
String wordUrl = list.get(0).getBmFileInfoList().get(0).getFileUrl();
RestTemplate restTemplate = new RestTemplate();
InputStream inputStream = restTemplate.getForObject(wordUrl, InputStream.class);
InputStream inputStream = new URL(wordUrl).openStream();
XWPFDocument document = new XWPFDocument(inputStream);
XWPFDocument document = new XWPFDocument(inputStream);*/
XWPFDocument document = new XWPFDocument(file.getInputStream());
//订单日期
replacements.put("${orderTime}", orderInfoDto.getOrderTime().toString());
//装备所属公司

View File

@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qcName != null and qcName != ''">qc_name,</if>
<if test="qcCode != null and qcCode != ''">qc_code,</if>
<if test="qcUser != null and qcUser != ''">qc_user,</if>
<if test="qcCom != null and qcCom != ''">qc_com,</if>
<if test="qcTime != null">qc_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qcName != null and qcName != ''">#{qcName},</if>
<if test="qcCode != null and qcCode != ''">#{qcCode},</if>
<if test="qcUser != null and qcUser != ''">#{qcUser},</if>
<if test="qcCom != null and qcCom != ''">#{qcCom},</if>
<if test="qcTime != null">#{qcTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
@ -78,6 +80,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createStartTime != null and createStartTime != '' and createEndTime != null and createEndTime != ''">
and DATE_FORMAT(m1.create_time,'%Y-%m-%d') between #{createStartTime} and #{createEndTime}
</if>
<if test="qcCom != null and qcCom != ''">
and m1.qc_com = #{qcCom}
</if>
</where>
</select>
<select id="selectQcList" resultType="com.bonus.material.device.domain.MaDevQc">

View File

@ -4,8 +4,8 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.material.device.mapper.SafeBookMapper">
<insert id="addSafeBook" useGeneratedKeys="true" keyProperty="id">
insert into safe_book(code,ma_id,upload_person,create_time)
values(#{code},#{maId},#{uploadPerson},now())
insert into safe_book(code,ma_id,upload_person,create_time,upload_com)
values(#{code},#{maId},#{uploadPerson},now(),#{uploadCom})
</insert>
<update id="updateTime">
update safe_book set update_time = now() where ma_id = #{maId}
@ -30,6 +30,7 @@
WHERE
bfi.task_type = 17
AND bfi.file_type = 5
AND sb.upload_com = #{uploadCom}
<if test="code != null and code != ''">
and mdi.code like concat('%',#{code},'%')
</if>