二维码绑定和工地直转管理

This commit is contained in:
liang.chao 2024-03-05 16:53:10 +08:00
parent 2da530bc41
commit 87dcee911f
25 changed files with 595 additions and 13 deletions

View File

@ -0,0 +1,33 @@
package com.bonus.sgzb.base.api.domain;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import lombok.Data;
/**
* @Author梁超
* @date2024/3/4 - 15:24
*/
@Data
public class DirectApplyDetails extends BaseEntity {
/**
* id
*/
private int id;
/**
* 直转单号
*/
private int directId;
/**
* 退料单位协议
*/
private int typeId;
/**
* 退料人
*/
private int maId;
/**
* 手机号
*/
private String directNum;
}

View File

@ -0,0 +1,74 @@
package com.bonus.sgzb.base.api.domain;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import lombok.Data;
/**
* @Author梁超
* @date2024/3/4 - 15:17
* direct_apply_info 工地直转信息
*/
@Data
public class DirectApplyInfo extends BaseEntity{
/**
* id
*/
private int id;
/**
* 直转单号(ZZ20240226-1)
*/
private String code;
/**
* 退料单位协议
*/
private int backAgreementId;
/**
* 退料人
*/
private String backMan;
/**
* 手机号
*/
private String backPhone;
/**
* 退料备注
*/
private String backRemark;
/**
* 领料单位协议
*/
private int leaseAgreementId;
/**
* 领料人
*/
private String leaseMan;
/**
* 领料联系电话
*/
private String leasePhone;
/**
* 领料备注
*/
private String leaseRemark;
/**
* 直转附件
*/
private String dirUrl;
/**
* 0待审批1审批同意2驳回
*/
private String status;
/**
* 审核人
*/
private String auditor;
/**
* 审核时间
*/
private String auditTime;
/**
* 审核备注
*/
private String auditRemark;
}

View File

@ -218,5 +218,8 @@ public class MaMachine extends BaseEntity {
*/
private String backTime;
@ApiModelProperty(value = "1二维码绑定标识 2rfid绑定标识")
private Integer flag;
}

View File

@ -11,6 +11,7 @@ import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@ -37,7 +38,7 @@ public class LeaseOutDetailsController extends BaseController {
}
/**
* Rfid绑定
* 绑定设备
*/
@ApiOperation(value = "根据Rfid绑定设备-app")
@PostMapping("bindMachineByRfid")
@ -50,7 +51,20 @@ public class LeaseOutDetailsController extends BaseController {
} else {
return AjaxResult.error("该设备已绑定");
}
}
/**
* 根据二维码绑定设备
*/
@ApiOperation(value = "根据二维码绑定设备-app")
@PostMapping("bindMachineByQrCode")
public AjaxResult bindMachineByQrCode(@RequestBody MaMachine maMachine) {
int i = leaseOutDetailsService.bindMachineByQrCode(maMachine);
if (i == 0) {
return AjaxResult.success("绑定成功");
} else {
return AjaxResult.error("编号已存在,绑定失败");
}
}

View File

@ -25,6 +25,7 @@ public interface LeaseOutDetailsService {
List<LeaseOutDetails> selectListByParentId(String parentId);
int bindMachineByRfid(MaMachine maMachine);
int bindMachineByQrCode(MaMachine maMachine);
/**
* 领料出库对库存处理

View File

@ -6,17 +6,18 @@ import com.bonus.sgzb.app.domain.LeaseApplyInfo;
import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper;
import com.bonus.sgzb.app.mapper.LeaseOutDetailsMapper;
import com.bonus.sgzb.app.service.LeaseOutDetailsService;
import com.bonus.sgzb.base.api.domain.LeaseOutDetails;
import com.bonus.sgzb.base.api.domain.MaMachine;
import com.bonus.sgzb.base.api.domain.MaType;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.*;
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.vo.MaLabelBindVO;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -37,6 +38,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
@Resource
private MaMachineMapper maMachineMapper;
@Resource
private MaLabelBindMapper maLabelBindMapper;
/**
* 根据任务id查询出库数据
@ -50,6 +53,7 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
}
@Override
@Transactional
public int bindMachineByRfid(MaMachine maMachine) {
List<MaMachine> maMachineByMaIdAndMaCode = maMachineMapper.getMaMachineByMaIdAndMaCode(maMachine);
if (CollUtil.isNotEmpty(maMachineByMaIdAndMaCode)) {
@ -66,6 +70,38 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
return 1;
}
@Override
@Transactional
public int bindMachineByQrCode(MaMachine maMachine) {
List<MaMachine> maMachineByMaIdAndMaCode = maMachineMapper.getMaMachineByMaTypeAndMaCode(maMachine);
if (CollUtil.isEmpty(maMachineByMaIdAndMaCode)) {
maMachine.setCreateTime(new Date());
int i = maMachineMapper.maMachineAdd(maMachine);
MaLabelBind maLabelBinds = maLabelBindMapper.selectMaLabelBindByMaCode(maMachine);
if (maLabelBinds != null) {
MaLabelBindVO maLabelBind = new MaLabelBindVO();
maLabelBind.setTypeId(maMachine.getTypeId());
maLabelBind.setBindTime(new Date().toString());
maLabelBind.setBinder(SecurityUtils.getLoginUser().getUsername());
maLabelBindMapper.updateMaLabelBind(maLabelBind);
return 0;
} else {
MaLabelBind maLabelBind = new MaLabelBind();
maLabelBind.setLabelCode(maMachine.getQrCode());
maLabelBind.setMaId(maMachine.getMaId());
maLabelBind.setTypeId(maMachine.getTypeId());
maLabelBind.setBindTime(new Date());
maLabelBind.setBinder(SecurityUtils.getLoginUser().getUsername());
maLabelBind.setStatus("1");
maLabelBind.setLabelType(9);
maLabelBindMapper.insertLabelBind(maLabelBind);
return 0;
}
} else {
return 1;
}
}
@Override
@Transactional
public AjaxResult submitOutRfid(List<LeaseOutDetails> recordList) {

View File

@ -88,4 +88,6 @@ public interface MaLabelBindMapper
MaLabelBindVO selectMaMachineMaId(String maCode);
int insertLabelBind(MaLabelBind maLabelBind);
MaLabelBind selectMaLabelBindByMaCode(MaMachine maMachine);
}

View File

@ -13,6 +13,7 @@ public interface MaMachineMapper {
public List<MaMachine> getMaMachineByCode(String maCode);
public List<MaMachine> getMaMachineByMaIdAndMaCode(MaMachine maMachine);
public List<MaMachine> getMaMachineByMaTypeAndMaCode(MaMachine maMachine);
public List<MaMachine> getMaMachineByQrCode(String qrCode);

View File

@ -173,6 +173,9 @@
from ma_machine
where ma_code = #{maCode}
</select>
<select id="selectMaLabelBindByMaCode" resultType="com.bonus.sgzb.base.api.domain.MaLabelBind">
select * from ma_label_bind where label_code = #{qrCode}
</select>
<update id="updateMaLabelBindMaIds" parameterType="com.bonus.sgzb.base.vo.MaLabelBindVO">
update ma_machine_label set
ma_id = #{maId},is_bind =#{isBind}

View File

@ -184,7 +184,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="maMachineAdd" parameterType="com.bonus.sgzb.base.api.domain.MaMachine" useGeneratedKeys="true" keyProperty="maId">
insert into ma_machine (
insert into ma_machine
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="typeId != null and typeId != '' ">type_id,</if>
<if test="maCode != null and maCode != '' ">ma_code,</if>
<if test="preCode != null and preCode != '' ">pre_code,</if>
@ -206,7 +207,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="buyTask != null and buyTask != ''">buy_task,</if>
<if test="ownHouse != null and ownHouse != ''">own_house,</if>
<if test="companyId != null and companyId != ''">company_id</if>
)values(
<if test="companyId != null and companyId != ''">create_time</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="typeId != null and typeId != ''">#{typeId},</if>
<if test="maCode != null and maCode != ''">#{maCode},</if>
<if test="preCode != null and preCode != ''">#{preCode},</if>
@ -228,7 +231,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="buyTask != null and buyTask != ''">#{buyTask},</if>
<if test="ownHouse != null and ownHouse != ''">#{ownHouse},</if>
<if test="companyId != null and companyId != ''">#{companyId}</if>
)
<if test="companyId != null and companyId != ''">#{createTime}</if>
</trim>
</insert>
<update id="updateMaMachine" parameterType="com.bonus.sgzb.base.api.domain.MaMachine">
@ -348,4 +352,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
WHERE a.parentId is not null
</select>
<select id="getMaMachineByMaTypeAndMaCode" resultType="com.bonus.sgzb.base.api.domain.MaMachine">
select * from ma_machine where qr_code = #{qrCode}
</select>
</mapper>

View File

@ -35,8 +35,7 @@ public class ReturnOfMaterialsInfoController extends BaseController {
*/
@ApiOperation(value = "获取机具退料入库列表")
@GetMapping("/getReturnOfMaterialsInfoAll")
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean)
{
public TableDataInfo getReturnOfMaterialsInfoAll(ReturnOfMaterialsInfo bean) {
startPage();
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getReturnOfMaterialsInfoAll(bean);
return getDataTable(list);
@ -53,14 +52,32 @@ public class ReturnOfMaterialsInfoController extends BaseController {
return AjaxResult.success(list);
}
/**
* 获取设备信息
*/
@ApiOperation(value = "获取设备类型-app")
@GetMapping("/getMaTypeList")
public AjaxResult getMaTypeList(String level) {
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getMaTypeList(level);
return AjaxResult.success(list);
}
/**
* 获取设备信息
*/
@ApiOperation(value = "根据设备规格-app")
@GetMapping("/getInfoListByType")
public AjaxResult getInfoListByType(String level, String parentId) {
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.getInfoListByType(level, parentId);
return AjaxResult.success(list);
}
/**
* 退料入库导出
*/
@ApiOperation("退料入库导出")
@Log(title = "退料入库导出", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ReturnOfMaterialsInfo bean)
{
public void export(HttpServletResponse response, ReturnOfMaterialsInfo bean) {
List<ReturnOfMaterialsInfo> list = returnOfMaterialsInfoService.exportList(bean);
ExcelUtil<ReturnOfMaterialsInfo> util = new ExcelUtil<ReturnOfMaterialsInfo>(ReturnOfMaterialsInfo.class);
util.exportExcel(response, list, "退料入库数据");

View File

@ -0,0 +1,105 @@
package com.bonus.sgzb.material.controller;
import cn.hutool.core.collection.CollUtil;
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
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.material.domain.DirectApplyInfoDetails;
import com.bonus.sgzb.material.service.TaskService;
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author梁超
* @date2024/3/4 - 14:45
* 工地直转管理
*/
@Api(tags = " 工地直转管理")
@RestController
@RequestMapping("/workSite")
public class WorkSiteDirectManageController extends BaseController {
@Resource
private WorkSiteDirectManageService workSiteDirectManageService;
@Resource
private TaskService tmTaskService;
/**
* 根据协议Id查询在用数据
*/
@ApiOperation(value = "根据协议Id查询在用数据")
@GetMapping("/getUseringData")
public TableDataInfo getUseringData(String agreementId) {
startPage();
List<SltAgreementInfo> useringData = workSiteDirectManageService.getUseringData(agreementId);
return getDataTable(useringData);
}
/**
* 存储退料领料数据
*/
@ApiOperation(value = "保存直转方和接收方数据(提交)")
@PostMapping("/submit")
public AjaxResult submit(@RequestBody List<DirectApplyInfoDetails> directApplyInfoDetails) {
if (CollUtil.isNotEmpty(directApplyInfoDetails)) {
for (DirectApplyInfoDetails directApplyInfoDetail : directApplyInfoDetails) {
if (directApplyInfoDetail.getDirectApplyInfos() != null) {
DirectApplyInfo directApplyInfos = directApplyInfoDetail.getDirectApplyInfos();
int i = workSiteDirectManageService.saveDirectApplyInfo(directApplyInfos);
if (i < 0) {
return AjaxResult.success("保存失败");
}
}
if (directApplyInfoDetail.getDirectApplyInfoDetails() != null) {
DirectApplyDetails directApplyDetails = directApplyInfoDetail.getDirectApplyInfoDetails();
int i = workSiteDirectManageService.saveDirectApplyDetails(directApplyDetails);
if (i < 0) {
return AjaxResult.success("保存失败");
}
}
}
}
return AjaxResult.success("保存成功");
}
/**
* 通过
*/
@ApiOperation(value = "通过")
@PostMapping("/pass")
public AjaxResult pass(@RequestBody DirectApplyInfoDetails directApplyInfoDetails) {
if (directApplyInfoDetails.getDirectApplyInfos() != null) {
DirectApplyInfo directApplyInfos = directApplyInfoDetails.getDirectApplyInfos();
directApplyInfos.setStatus("1");
workSiteDirectManageService.refuseDirectApplyInfo(directApplyInfos);
}
return AjaxResult.success("审核未通过");
}
/**
* 不通过
*/
@ApiOperation(value = "不通过")
@PostMapping("/refuse")
public AjaxResult refuse(@RequestBody DirectApplyInfo directApplyInfo) {
if (directApplyInfo != null) {
directApplyInfo.setStatus("2");
workSiteDirectManageService.refuseDirectApplyInfo(directApplyInfo);
}else {
return AjaxResult.error("参数为空,审核失败");
}
return AjaxResult.success("审核通过");
}
}

View File

@ -0,0 +1,25 @@
package com.bonus.sgzb.material.domain;
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
import com.bonus.sgzb.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.List;
/**
* @Author梁超
* @date2024/3/4 - 16:10
*/
@Data
public class DirectApplyInfoDetails extends BaseEntity {
private static final long serialVersionUID = 1L;
private DirectApplyDetails directApplyInfoDetails;
private DirectApplyInfo directApplyInfos;
private TmTask task;
}

View File

@ -19,11 +19,16 @@ public class ReturnOfMaterialsInfo {
@ApiModelProperty(value = "退料单号")
@Excel(name = "退料单号")
private String code;
@ApiModelProperty(value = "规格编号")
private String modelCode;
/** 退料单位 */
@ApiModelProperty(value = "退料单位")
@Excel(name = "退料单位")
private String unitName;
/** 上级ID */
@ApiModelProperty(value = "上级ID")
private String parentId;
/** 退料工程 */
@ApiModelProperty(value = "退料工程")

View File

@ -3,6 +3,7 @@ package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -26,4 +27,7 @@ public interface ReturnOfMaterialsInfoMapper {
*/
List<ReturnOfMaterialsInfo> getTypeList(String level);
List<ReturnOfMaterialsInfo> getInfoListByType(@Param("level")String level, @Param("parentId")String parentId);
List<ReturnOfMaterialsInfo> getMaTypeList(String level);
}

View File

@ -0,0 +1,32 @@
package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author梁超
* @date2024/3/4 - 14:49
*/
@Mapper
public interface WorkSiteDirectManageMapper {
/**
* 根据协议id查询在用数据
*
* @param agreementId
* @return
*/
List<SltAgreementInfo> getUseringData(String agreementId);
int saveDirectApplyInfo(DirectApplyInfo directApplyInfo);
int saveDirectApplyDetails(DirectApplyDetails directApplyInfo);
int refuseDirectApplyInfo(DirectApplyInfo directApplyInfos);
}

View File

@ -22,6 +22,9 @@ public interface ReturnOfMaterialsInfoService {
* @return
*/
List<ReturnOfMaterialsInfo> getTypeList(String level);
List<ReturnOfMaterialsInfo> getMaTypeList(String level);
List<ReturnOfMaterialsInfo> getInfoListByType(String level,String parentId);
/**
* 退料入库导出

View File

@ -60,4 +60,6 @@ public interface TaskService
* @return 结果
*/
public int deleteTmTaskByTaskId(Long taskId);
String genderLeaseCode();
}

View File

@ -0,0 +1,21 @@
package com.bonus.sgzb.material.service;
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementRelation;
import java.util.List;
/**
* @Author梁超
* @date2024/3/4 - 14:49
*/
public interface WorkSiteDirectManageService {
List<SltAgreementInfo> getUseringData(String agreementId);
int saveDirectApplyInfo(DirectApplyInfo directApplyInfos);
int saveDirectApplyDetails(DirectApplyDetails directApplyInfos);
int refuseDirectApplyInfo(DirectApplyInfo directApplyInfos);
}

View File

@ -27,6 +27,16 @@ public class ReturnOfMaterialsInfoServiceImpl implements ReturnOfMaterialsInfoSe
return returnOfMaterialsInfoMapper.getTypeList(level);
}
@Override
public List<ReturnOfMaterialsInfo> getMaTypeList(String level) {
return returnOfMaterialsInfoMapper.getMaTypeList(level);
}
@Override
public List<ReturnOfMaterialsInfo> getInfoListByType(String level, String parentId) {
return returnOfMaterialsInfoMapper.getInfoListByType(level, parentId);
}
@Override
public List<ReturnOfMaterialsInfo> exportList(ReturnOfMaterialsInfo bean) {
return returnOfMaterialsInfoMapper.getReturnOfMaterialsInfoAll(bean);

View File

@ -1,5 +1,7 @@
package com.bonus.sgzb.material.service.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import com.bonus.sgzb.common.core.utils.DateUtils;
@ -94,4 +96,23 @@ public class TaskServiceImpl implements TaskService
{
return tmTaskMapper.deleteTmTaskByTaskId(taskId);
}
@Override
public String genderLeaseCode() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date nowDate = DateUtils.getNowDate();
String format = dateFormat.format(nowDate);
String result = format.replace("-", "");
int num = tmTaskMapper.selectTaskNumByMonth(nowDate,29);
num = num + 1;
String code = "";
if (num > 9 && num < 100) {
code = "L" + result + "-00" + num;
} else if (num > 99 && num < 1000) {
code = "L" + result + "-0" + num;
} else {
code = "L" + result + "-000" + num;
}
return code;
}
}

View File

@ -0,0 +1,48 @@
package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.base.api.domain.DirectApplyDetails;
import com.bonus.sgzb.base.api.domain.DirectApplyInfo;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.material.mapper.WorkSiteDirectManageMapper;
import com.bonus.sgzb.material.service.WorkSiteDirectManageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author梁超
* @date2024/3/4 - 14:50
*/
@Service
@Slf4j
public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
@Resource
private WorkSiteDirectManageMapper workSiteDirectManageMapper;
@Override
public List<SltAgreementInfo> getUseringData(String agreementId) {
return workSiteDirectManageMapper.getUseringData(agreementId);
}
@Override
@Transactional
public int saveDirectApplyInfo(DirectApplyInfo directApplyInfo) {
return workSiteDirectManageMapper.saveDirectApplyInfo(directApplyInfo);
}
@Override
@Transactional
public int saveDirectApplyDetails(DirectApplyDetails directApplyDetail) {
return workSiteDirectManageMapper.saveDirectApplyDetails(directApplyDetail);
}
@Override
public int refuseDirectApplyInfo(DirectApplyInfo directApplyInfos) {
return workSiteDirectManageMapper.refuseDirectApplyInfo(directApplyInfos);
}
}

View File

@ -45,4 +45,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE `level` = #{level}
</select>
<select id="getInfoListByType" resultType="com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo">
SELECT type_id as typeId,code,model_code as modelCode,type_name as typeName FROM `ma_type`
WHERE `level` = #{level} and parent_id = #{parentId}
</select>
<select id="getMaTypeList" resultType="com.bonus.sgzb.material.domain.ReturnOfMaterialsInfo">
SELECT mt.type_id as typeId,mt.type_name as typeName ,mt.manage_type FROM `ma_type` mt
LEFT JOIN ma_type mt2 on mt2.parent_id = mt.type_id
WHERE mt.`level` = #{level} and mt2.manage_type = 0
GROUP BY mt.type_id
</select>
</mapper>

View File

@ -0,0 +1,103 @@
<?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.material.mapper.WorkSiteDirectManageMapper">
<insert id="saveDirectApplyInfo" parameterType="com.bonus.sgzb.base.api.domain.DirectApplyInfo">
insert into direct_apply_info
(
<if test="code != null and code != ''">
code,
</if>
<if test="backAgreementId != null">
back_agreement_id,
</if>
<if test="backMan != null and backMan != ''">
back_man,
</if>
<if test="backPhone != null and backPhone != ''">
back_phone,
</if>
<if test="backRemark != null and backRemark != ''">
back_remark,
</if>
<if test="leaseAgreementId != null">
lease_agreement_id,
</if>
<if test="leaseMan != null and leaseMan != ''">
lease_man,
</if>
<if test="leasePhone != null and leasePhone != ''">
lease_phone,
</if>
<if test="dirUrl != null and dirUrl != ''">
dir_url,
</if>
<if test="status != null and status != ''">
status,
</if>
<if test="auditor != null and auditor != ''">
auditor,
</if>
<if test="auditTime != null and auditTime != ''">
audit_time,
</if>
<if test="auditRemark != null and auditRemark != ''">
audit_remark,
</if>
create_time
) values (
<if test="code != null and code != ''">
#{code},
</if>
<if test="backAgreementId != null">
#{backAgreementId},
</if>
<if test="backMan != null and backMan != ''">
#{backMan},
</if>
<if test="backPhone != null and backPhone != ''">
#{backPhone},
</if>
<if test="backRemark != null and backRemark != ''">
#{backRemark},
</if>
<if test="leaseAgreementId != null">
#{leaseAgreementId},
</if>
<if test="leaseMan != null and leaseMan != ''">
#{leaseMan},
</if>
<if test="leasePhone != null and leasePhone != ''">
#{leasePhone},
</if>
<if test="dirUrl != null and dirUrl != ''">
#{dirUrl},
</if>
<if test="status != null and status != ''">
#{status},
</if>
<if test="auditor != null and auditor != ''">
#{auditor},
</if>
<if test="auditTime != null and auditTime != ''">
#{auditTime},
</if>
<if test="auditRemark != null and auditRemark != ''">
#{auditRemark},
</if>
NOW()
)
</insert>
<insert id="saveDirectApplyDetails" parameterType="com.bonus.sgzb.base.api.domain.DirectApplyDetails">
insert into direct_apply_info(direct_id,type_id,ma_id,direct_num)
values (#{directId},#{typeId},#{maId}, #{directNum})
</insert>
<update id="refuseDirectApplyInfo">
update direct_apply_info set status = #{status} where id = #{id}
</update>
<select id="getUseringData" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
select * from slt_agreement_info where agreement_id = #{agreementId} and status = '0';
</select>
</mapper>

View File

@ -45,6 +45,7 @@ public class ResourcesConfig implements WebMvcConfigurer
registry.addMapping( "/**")
// 设置允许跨域请求的域名
.allowedOrigins("*")
.allowCredentials(true)
// 设置允许的方法
.allowedMethods("*");
}