Merge branch 'master' of https://gitee.com/kutangguo/ktg-mes
This commit is contained in:
commit
afc92b8bf6
3
.gitignore
vendored
3
.gitignore
vendored
@ -47,3 +47,6 @@ nbdist/
|
|||||||
!*/build/*.xml
|
!*/build/*.xml
|
||||||
application-druid.yml
|
application-druid.yml
|
||||||
application-pro.yml
|
application-pro.yml
|
||||||
|
#忽略所有target目录
|
||||||
|
target/
|
||||||
|
.vscode
|
||||||
|
@ -134,7 +134,7 @@ public class CalTeamshiftServiceImpl implements ICalTeamshiftService
|
|||||||
CalPlanTeam p2 = new CalPlanTeam();
|
CalPlanTeam p2 = new CalPlanTeam();
|
||||||
p2.setPlanId(plandId);
|
p2.setPlanId(plandId);
|
||||||
List<CalPlanTeam> teams = calPlanTeamMapper.selectCalPlanTeamList(p2);
|
List<CalPlanTeam> teams = calPlanTeamMapper.selectCalPlanTeamList(p2);
|
||||||
Long days = CalendarUtil.getDateDiff(plan.getStartDate(),plan.getEndDate());
|
Long days = CalendarUtil.getDateDiff(plan.getStartDate(),plan.getEndDate()) + 1;
|
||||||
|
|
||||||
int shiftIndex =0;
|
int shiftIndex =0;
|
||||||
Date nowDate =null;
|
Date nowDate =null;
|
||||||
|
@ -4,6 +4,7 @@ import com.ktg.common.annotation.Log;
|
|||||||
import com.ktg.common.constant.UserConstants;
|
import com.ktg.common.constant.UserConstants;
|
||||||
import com.ktg.common.core.controller.BaseController;
|
import com.ktg.common.core.controller.BaseController;
|
||||||
import com.ktg.common.core.domain.AjaxResult;
|
import com.ktg.common.core.domain.AjaxResult;
|
||||||
|
import com.ktg.common.core.domain.entity.SysUser;
|
||||||
import com.ktg.common.core.page.TableDataInfo;
|
import com.ktg.common.core.page.TableDataInfo;
|
||||||
import com.ktg.common.enums.BusinessType;
|
import com.ktg.common.enums.BusinessType;
|
||||||
import com.ktg.common.utils.SecurityUtils;
|
import com.ktg.common.utils.SecurityUtils;
|
||||||
@ -117,4 +118,11 @@ public class DvMachineryController extends BaseController
|
|||||||
return AjaxResult.success(message);
|
return AjaxResult.success(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/importTemplate")
|
||||||
|
public void importTemplate(HttpServletResponse response)
|
||||||
|
{
|
||||||
|
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
|
||||||
|
util.importTemplateExcel(response, "设备台账");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class DvSubjectServiceImpl implements IDvSubjectService
|
|||||||
public String checkSubjectCodeUnique(DvSubject dvSubject) {
|
public String checkSubjectCodeUnique(DvSubject dvSubject) {
|
||||||
DvSubject subject = dvSubjectMapper.checkSubjectCodeUnique(dvSubject);
|
DvSubject subject = dvSubjectMapper.checkSubjectCodeUnique(dvSubject);
|
||||||
Long subjectId = dvSubject.getSubjectId()==null?-1L:dvSubject.getSubjectId();
|
Long subjectId = dvSubject.getSubjectId()==null?-1L:dvSubject.getSubjectId();
|
||||||
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() == subjectId.longValue()){
|
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() != subjectId.longValue()){
|
||||||
return UserConstants.NOT_UNIQUE;
|
return UserConstants.NOT_UNIQUE;
|
||||||
}
|
}
|
||||||
return UserConstants.UNIQUE;
|
return UserConstants.UNIQUE;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.ktg.mes.md.controller;
|
package com.ktg.mes.md.controller;
|
||||||
|
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||||
import com.ktg.common.annotation.Log;
|
import com.ktg.common.annotation.Log;
|
||||||
import com.ktg.common.core.controller.BaseController;
|
import com.ktg.common.core.controller.BaseController;
|
||||||
@ -86,6 +87,9 @@ public class MdUnitMeasureController extends BaseController
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody MdUnitMeasure mdUnitMeasure)
|
public AjaxResult add(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||||
{
|
{
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(mdUnitMeasureService.checkMeasureUnitCodeUnique(mdUnitMeasure))){
|
||||||
|
return AjaxResult.error("单位编码已存在!");
|
||||||
|
}
|
||||||
return toAjax(mdUnitMeasureService.insertMdUnitMeasure(mdUnitMeasure));
|
return toAjax(mdUnitMeasureService.insertMdUnitMeasure(mdUnitMeasure));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +101,9 @@ public class MdUnitMeasureController extends BaseController
|
|||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody MdUnitMeasure mdUnitMeasure)
|
public AjaxResult edit(@RequestBody MdUnitMeasure mdUnitMeasure)
|
||||||
{
|
{
|
||||||
|
if(UserConstants.NOT_UNIQUE.equals(mdUnitMeasureService.checkMeasureUnitCodeUnique(mdUnitMeasure))){
|
||||||
|
return AjaxResult.error("单位编码已存在!");
|
||||||
|
}
|
||||||
return toAjax(mdUnitMeasureService.updateMdUnitMeasure(mdUnitMeasure));
|
return toAjax(mdUnitMeasureService.updateMdUnitMeasure(mdUnitMeasure));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,13 @@ public interface MdUnitMeasureMapper
|
|||||||
* @return 单位
|
* @return 单位
|
||||||
*/
|
*/
|
||||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||||
|
/**
|
||||||
|
* 计量单位唯一校验
|
||||||
|
*
|
||||||
|
* @param mdUnitMeasure 单位主键
|
||||||
|
* @return 单位
|
||||||
|
*/
|
||||||
|
public MdUnitMeasure checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单位列表
|
* 查询单位列表
|
||||||
|
@ -19,6 +19,13 @@ public interface IMdUnitMeasureService
|
|||||||
* @return 单位
|
* @return 单位
|
||||||
*/
|
*/
|
||||||
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
public MdUnitMeasure selectMdUnitMeasureByMeasureId(Long measureId);
|
||||||
|
/**
|
||||||
|
* 计量单位唯一校验
|
||||||
|
*
|
||||||
|
* @param mdUnitMeasure 单位主键
|
||||||
|
* @return 单位
|
||||||
|
*/
|
||||||
|
public String checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单位列表
|
* 查询单位列表
|
||||||
|
@ -2,6 +2,9 @@ package com.ktg.mes.md.service.impl;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.ktg.common.constant.UserConstants;
|
||||||
|
import com.ktg.common.utils.StringUtils;
|
||||||
|
import com.ktg.mes.md.domain.MdClient;
|
||||||
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
import com.ktg.mes.md.service.IMdUnitMeasureService;
|
||||||
import com.ktg.common.utils.DateUtils;
|
import com.ktg.common.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -33,6 +36,16 @@ public class MdUnitMeasureServiceImpl implements IMdUnitMeasureService
|
|||||||
return mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(measureId);
|
return mdUnitMeasureMapper.selectMdUnitMeasureByMeasureId(measureId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String checkMeasureUnitCodeUnique(MdUnitMeasure mdUnitMeasure) {
|
||||||
|
MdUnitMeasure unitMeasure = mdUnitMeasureMapper.checkMeasureUnitCodeUnique(mdUnitMeasure);
|
||||||
|
Long subjectId = mdUnitMeasure.getMeasureId()==null?-1L:mdUnitMeasure.getMeasureId();
|
||||||
|
if(StringUtils.isNotNull(unitMeasure)&& unitMeasure.getMeasureId().longValue() != subjectId.longValue()){
|
||||||
|
return UserConstants.NOT_UNIQUE;
|
||||||
|
}
|
||||||
|
return UserConstants.UNIQUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询单位列表
|
* 查询单位列表
|
||||||
*
|
*
|
||||||
|
@ -43,6 +43,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="checkMeasureUnitCodeUnique" parameterType="MdUnitMeasure" resultMap="MdUnitMeasureResult">
|
||||||
|
<include refid="selectMdUnitMeasureVo"/>
|
||||||
|
where measure_code = #{measureCode} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectMdUnitMeasureByMeasureId" parameterType="Long" resultMap="MdUnitMeasureResult">
|
<select id="selectMdUnitMeasureByMeasureId" parameterType="Long" resultMap="MdUnitMeasureResult">
|
||||||
<include refid="selectMdUnitMeasureVo"/>
|
<include refid="selectMdUnitMeasureVo"/>
|
||||||
where measure_id = #{measureId}
|
where measure_id = #{measureId}
|
||||||
|
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
|
||||||
<include refid="selectDeptVo"/>
|
<include refid="selectDeptVo"/>
|
||||||
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
|
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertDept" parameterType="SysDept">
|
<insert id="insertDept" parameterType="SysDept">
|
||||||
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND post_name like concat('%', #{postName}, '%')
|
AND post_name like concat('%', #{postName}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by post_sort asc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPostAll" resultMap="SysPostResult">
|
<select id="selectPostAll" resultMap="SysPostResult">
|
||||||
|
@ -85,12 +85,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
|
|
||||||
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_name=#{roleName} limit 1
|
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_key=#{roleKey} limit 1
|
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
||||||
|
@ -135,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
<select id="checkUserNameUnique" parameterType="String" resultType="int">
|
||||||
select count(1) from sys_user where user_name = #{userName} limit 1
|
select count(1) from sys_user where user_name = #{userName} and del_flag='0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
@ -145,6 +145,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
|
||||||
select user_id, email from sys_user where email = #{email} limit 1
|
select user_id, email from sys_user where email = #{email} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="checkUserNickNameUnique" resultType="java.lang.Integer">
|
<select id="checkUserNickNameUnique" resultType="java.lang.Integer">
|
||||||
select count(1) from sys_user where nick_name = #{nickName} limit 1
|
select count(1) from sys_user where nick_name = #{nickName} limit 1
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
Reference in New Issue
Block a user