Merge branch 'master' of http://8.140.179.55:20000/r/pms-SV
| | |
| | | @Mapper |
| | | public interface PltStationMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(PltStation record); |
| | | |
| | | int insertSelective(PltStation record); |
| | | |
| | | PltStation selectByPrimaryKey(Long id); |
| | |
| | | long selectByCodeId(Long id,String code); |
| | | |
| | | int updateByPrimaryKeySelective(PltStation record); |
| | | |
| | | int updateByPrimaryKey(PltStation record); |
| | | |
| | | Long selectSomeCount(Map<String,Object> params); |
| | | |
| | |
| | | public Long id; |
| | | |
| | | /** |
| | | * 生产线id |
| | | */ |
| | | @JSONField(serializeUsing= ObjectWriterImplToString.class) |
| | | public Long lineId; |
| | | |
| | | @TableField(exist = false) |
| | | public String lineName; |
| | | |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @NotEmpty(message = "编号不能为空") |
| | |
| | | |
| | | <resultMap id="BaseResultMap" type="com.dy.pmsGlobal.pojoPlt.PltStation"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="lineId" column="line_id" jdbcType="BIGINT"/> |
| | | <result property="code" column="code" jdbcType="VARCHAR"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="dt" column="dt" jdbcType="TIMESTAMP"/> |
| | | <result column="disabled" property="disabled" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> |
| | | <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.BooleanTypeHandler"/> |
| | | <association property="lineName" column="line_id" javaType="java.lang.Long" |
| | | select="selectLineNameById" fetchType="eager" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,code,name,disabled, |
| | | id,line_id,code,name,disabled, |
| | | remark,dt,deleted |
| | | </sql> |
| | | |
| | | <select id="selectLineNameById" parameterType="java.lang.Long" resultType="String"> |
| | | select name from plt_production_line where id = #{lineId} |
| | | </select> |
| | | <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from plt_station |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation" useGeneratedKeys="true"> |
| | | insert into plt_station |
| | | ( id,code,name |
| | | ,remark,deleted |
| | | ) |
| | | values (#{id,jdbcType=BIGINT},#{code,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR} |
| | | ,#{remark,jdbcType=VARCHAR},#{deleted,jdbcType=TINYINT} |
| | | ) |
| | | </insert> |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation" useGeneratedKeys="true"> |
| | | insert into plt_station |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="lineId != null">line_id,</if> |
| | | <if test="code != null">code,</if> |
| | | <if test="name != null">name,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="disabled != null">disabled,</if> |
| | | <if test="deleted != null">deleted,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="lineId != null">#{lineId,jdbcType=VARCHAR},</if> |
| | | <if test="code != null">#{code,jdbcType=VARCHAR},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="disabled != null">#{disabled,jdbcType=TINYINT},</if> |
| | | <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation"> |
| | | update plt_station |
| | | <set> |
| | | <if test="code != null"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="code != null"> |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="name != null"> |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="remark != null"> |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="disabled != null"> |
| | | disabled = #{disabled,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="deleted != null"> |
| | | deleted = #{deleted,jdbcType=TINYINT}, |
| | | </if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="com.dy.pmsGlobal.pojoPlt.PltStation"> |
| | | update plt_station |
| | | set |
| | | code = #{code,jdbcType=VARCHAR}, |
| | | name = #{name,jdbcType=VARCHAR}, |
| | | remark = #{remark,jdbcType=VARCHAR}, |
| | | deleted = #{deleted,jdbcType=TINYINT} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | |
| | | type:类型,长度为4位,是编码的前4位 |
| | | --> |
| | | <privileges> |
| | | <!-- 基础权 --> |
| | | <privilege num="10100010" name="系统查询" type="1010" typeName="基础权"></privilege> |
| | | <privilege num="10100011" name="系统管理" type="1010" typeName="基础权"></privilege> |
| | | <!-- 系统管理 --> |
| | | <privilege num="10100000" name="用户查询" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100001" name="用户管理" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100002" name="角色查询" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100003" name="角色管理" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100004" name="权限查询" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100006" name="日志查询" type="1010" typeName="系统管理"></privilege> |
| | | <privilege num="10100007" name="编码查询" type="1010" typeName="系统管理"></privilege> |
| | | |
| | | <!-- 生产管理 --> |
| | | <privilege num="10200000" name="产品查询" type="1020" typeName="生产管理"></privilege> |
| | | <privilege num="10200001" name="产品管理" type="1020" typeName="生产管理"></privilege> |
| | | <privilege num="10200000" name="生产查询" type="1020" typeName="生产管理"></privilege> |
| | | <privilege num="10200001" name="生产管理" type="1020" typeName="生产管理"></privilege> |
| | | |
| | | <!-- 平台信息 --> |
| | | <privilege num="10300000" name="平台查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300001" name="平台管理" type="1030" typeName="平台信息"></privilege> |
| | | |
| | | <privilege num="10300000" name="产品查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300001" name="产品管理" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300002" name="质检项目查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300003" name="质检项目管理" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300004" name="生产线查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300005" name="生产线管理" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300006" name="工站查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300007" name="工站管理" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300008" name="不合格原因查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300009" name="不合格原因管理" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300010" name="报废原因查询" type="1030" typeName="平台信息"></privilege> |
| | | <privilege num="10300011" name="报废原因管理" type="1030" typeName="平台信息"></privilege> |
| | | </privileges> |
| | | |
| | | </config> |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "one") |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100006") //登录与权限同时验证 |
| | | @Log("查询单条日志") |
| | | public BaseResponse<BaLog> one(String id){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100006") //登录与权限同时验证 |
| | | @Log("查询日志") |
| | | public BaseResponse<QueryResultVo<List<BaLog>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="getByType") |
| | | @SsoPowerAop(power = "10100010") |
| | | @SsoPowerAop(power = "10100004") |
| | | public BaseResponse<List<Map<String, Object>>> getByType(){ |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.selectByType()); |
| | |
| | | * @return |
| | | */ |
| | | @RequestMapping(path="some") |
| | | @SsoPowerAop(power = "10100010") |
| | | @SsoPowerAop(power = "10100004") |
| | | @Log("查询权限信息") |
| | | public BaseResponse<QueryResultVo<List<BaPrivilege>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 角色管理 |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10100003") |
| | | @Log("保存角色信息") |
| | | public BaseResponse<BaRole> save(@RequestBody @Valid BaRole role,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid BaRole role,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | role.setDeleted(false); |
| | | role.setDisabled(false); |
| | | return BaseResponseUtils.buildSuccess(roleSv.save(role)); |
| | | count = roleSv.save(role); |
| | | }catch (Exception e){ |
| | | log.error("保存角色异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10100003") |
| | | @Log("更新角色信息") |
| | | public BaseResponse<BaRole> update(@RequestBody @Valid BaRole role,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(roleSv.update(role)); |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | count = roleSv.update(role); |
| | | }catch (Exception e){ |
| | | log.error("更新角色异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10100003") |
| | | @Log("删除角色信息") |
| | | public BaseResponse<BaRole> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(roleSv.delete(Long.parseLong(id))); |
| | | count = roleSv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除角色异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10100003") |
| | | @Log("禁用或启用角色信息") |
| | | public BaseResponse<BaRole> disabled(@RequestBody BaRole role){ |
| | | public BaseResponse<Boolean> disabled(@RequestBody BaRole role){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(roleSv.disabled(role.id,role.disabled)); |
| | | count = roleSv.disabled(role.id,role.disabled); |
| | | }catch (Exception e){ |
| | | log.error("禁用角色异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100004") //登录与权限同时验证 |
| | | @Log("根据ID查询角色信息") |
| | | public BaseResponse<BaRole> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="all") |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100004") //登录与权限同时验证 |
| | | @Log("查询所有角色") |
| | | public BaseResponse<List<BaRole>> all(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10100010") |
| | | @SsoPowerAop(power = "10100004") |
| | | @Log("查询角色信息") |
| | | public BaseResponse<QueryResultVo<List<BaRole>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | */ |
| | | @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@SsoAop() //只有登录验证,没有权限验证 |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100000") //登录与权限同时验证 |
| | | @Log("查询用户") |
| | | public BaseResponse<QueryResultVo<List<BaUser>>> some(@RequestBody QueryVo vo) { |
| | | try { |
| | |
| | | //@GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)//指前端向后传的参数类型 |
| | | @GetMapping(path = "one") |
| | | //@SsoAop() //只有登录验证,没有权限验证 |
| | | @SsoPowerAop(power = "10100010") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100000") //登录与权限同时验证 |
| | | @Log("查询单个用户") |
| | | public BaseResponse<BaUser> one(String id) { |
| | | try { |
| | |
| | | */ |
| | | @PostMapping(path = "save", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@SsoAop() //只有登录验证,没有权限验证 |
| | | @SsoPowerAop(power = "10100011") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100001") //登录与权限同时验证 |
| | | @Log("保存用户信息") |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid BaUser po, BindingResult bindingResult) { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | |
| | | */ |
| | | @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@SsoAop() //只有登录验证,没有权限验证 |
| | | @SsoPowerAop(power = "10100011") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100001") //登录与权限同时验证 |
| | | @Log("更新用户信息") |
| | | public BaseResponse<Boolean> update(@RequestBody @Validated BaUser po, BindingResult bindingResult) { |
| | | int count; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10100001") |
| | | @Log("禁用或启用用户信息") |
| | | public BaseResponse<BaRole> disabled(@RequestBody BaUser po){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path = "delete") |
| | | @SsoPowerAop(power = "10100011") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100001") //登录与权限同时验证 |
| | | @Log("删除用户") |
| | | public BaseResponse<Boolean> delete(Long id) { |
| | | int count; |
| | |
| | | */ |
| | | @PostMapping(path = "resetPassword", consumes = MediaType.APPLICATION_JSON_VALUE) |
| | | //@SsoAop() //只有登录验证,没有权限验证 |
| | | @SsoPowerAop(power = "10100011") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10100001") //登录与权限同时验证 |
| | | @Log("重置密码") |
| | | public BaseResponse<Boolean> resetPassword(@RequestBody @Validated ResetPasswordVo vo, BindingResult bindingResult) { |
| | | int count; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300003") |
| | | @Log("保存产品品质检查项目信息") |
| | | public BaseResponse<PltProductParams> save(@RequestBody @Valid PltProductQualityInspectionItems item, BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PltProductQualityInspectionItems item, BindingResult bindingResult){ |
| | | int count = 0; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | item.deleted = false; |
| | | item.disabled = false; |
| | | return BaseResponseUtils.buildSuccess(sv.save(item)); |
| | | count =sv.save(item); |
| | | }catch (Exception e){ |
| | | log.error("保存产品品质检查项目异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300003") |
| | | @Log("更新产品品质检查项目信息") |
| | | public BaseResponse<PltProductParams> update(@RequestBody @Valid PltProductQualityInspectionItems item,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PltProductQualityInspectionItems item,BindingResult bindingResult){ |
| | | int count ; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(sv.update(item)); |
| | | count = sv.update(item); |
| | | }catch (Exception e){ |
| | | log.error("更新产品品质检查项目异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300003") |
| | | @Log("删除产品品质检查项目信息") |
| | | public BaseResponse<PltProductQualityInspectionItems> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id))); |
| | | count = sv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除产品品质检查项目异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10300000") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10300002") //登录与权限同时验证 |
| | | @Log("根据ID查询产品品质检查项目信息") |
| | | public BaseResponse<PltProductQualityInspectionItems> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300002") |
| | | @Log("查询产品品质检查项目信息") |
| | | public BaseResponse<QueryResultVo<List<PltProductQualityInspectionItems>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @Log("禁用或启用质检项目") |
| | | public BaseResponse<BaRole> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.disabled(reason.id,reason.disabled)); |
| | | count = sv.disabled(reason.id,reason.disabled); |
| | | }catch (Exception e){ |
| | | log.error("禁用或启用质检项目异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | public Object disabled(Long id, Boolean disabled) { |
| | | public int disabled(Long id, Boolean disabled) { |
| | | PltProductQualityInspectionItems item = new PltProductQualityInspectionItems(); |
| | | item.setId(id); |
| | | item.setDisabled(disabled); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300005") |
| | | @Log("保存生产线") |
| | | public BaseResponse<PltProductionLine> save(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | line.disabled = false; |
| | | line.deleted = false; |
| | | return BaseResponseUtils.buildSuccess(sv.save(line)); |
| | | count = sv.save(line); |
| | | }catch (Exception e){ |
| | | log.error("保存生产线异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300005") |
| | | @Log("更新生产线") |
| | | public BaseResponse<PltProductionLine> update(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PltProductionLine line,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(sv.update(line)); |
| | | count = sv.update(line); |
| | | }catch (Exception e){ |
| | | log.error("更新生产线异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300005") |
| | | @Log("删除生产线") |
| | | public BaseResponse<PltProductionLine> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id))); |
| | | count = sv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除生产线异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10300000") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10300004") //登录与权限同时验证 |
| | | @Log("根据ID查询生产线") |
| | | public BaseResponse<PltProductionLine> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300004") |
| | | @Log("分页查询生产线") |
| | | public BaseResponse<QueryResultVo<List<PltProductionLine>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="all") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300004") |
| | | @Log("查询所有生产线") |
| | | public BaseResponse<List<PltProductionLine>> all(){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300011") |
| | | @Log("保存产品设备报废原因") |
| | | public BaseResponse<PltProductScrappingReason> save(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | reason.disabled = false; |
| | | reason.deleted = false; |
| | | return BaseResponseUtils.buildSuccess(sv.save(reason)); |
| | | count = sv.save(reason); |
| | | }catch (Exception e){ |
| | | log.error("保存产品设备报废原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300011") |
| | | @Log("更新产品设备报废原因") |
| | | public BaseResponse<PltProductScrappingReason> update(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PltProductScrappingReason reason,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(sv.update(reason)); |
| | | count = sv.update(reason); |
| | | }catch (Exception e){ |
| | | log.error("更新产品设备报废原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300011") |
| | | @Log("删除产品设备报废原因") |
| | | public BaseResponse<PltProductScrappingReason> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id))); |
| | | count = sv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除产品设备报废原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10300000") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10300010") //登录与权限同时验证 |
| | | @Log("根据ID查询产品设备报废原因") |
| | | public BaseResponse<PltProductScrappingReason> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300010") |
| | | @Log("查询产品设备报废原因") |
| | | public BaseResponse<QueryResultVo<List<PltProductScrappingReason>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @Log("禁用或启用报废原因") |
| | | public BaseResponse<BaRole> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.disabled(reason.id,reason.disabled)); |
| | | count = sv.disabled(reason.id,reason.disabled); |
| | | }catch (Exception e){ |
| | | log.error("禁用或启用报废原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | public Object disabled(Long id, Boolean disabled) { |
| | | public int disabled(Long id, Boolean disabled) { |
| | | PltProductScrappingReason reason = new PltProductScrappingReason(); |
| | | reason.setId(id); |
| | | reason.setDisabled(disabled); |
| | |
| | | import com.dy.common.webUtil.BaseResponseUtils; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pmsGlobal.aop.Log; |
| | | import com.dy.pmsGlobal.pojoBa.BaRole; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductParams; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductUnqualifiedReason; |
| | | import jakarta.validation.Valid; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300009") |
| | | @Log("保存产品生产不合格原因") |
| | | public BaseResponse<PltProductParams> save(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | reason.deleted = false; |
| | | reason.disabled = false; |
| | | return BaseResponseUtils.buildSuccess(sv.save(reason)); |
| | | count = sv.save(reason); |
| | | }catch (Exception e){ |
| | | log.error("保存产品生产不合格原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300009") |
| | | @Log("更新产品生产不合格原因") |
| | | public BaseResponse<PltProductUnqualifiedReason> update(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PltProductUnqualifiedReason reason,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(sv.update(reason)); |
| | | count = sv.update(reason); |
| | | }catch (Exception e){ |
| | | log.error("更新产品生产不合格原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300009") |
| | | @Log("删除产品生产不合格原因") |
| | | public BaseResponse<PltProductUnqualifiedReason> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id))); |
| | | count = sv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除产品生产不合格原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10300000") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10300008") //登录与权限同时验证 |
| | | @Log("根据ID查询产品生产不合格原因") |
| | | public BaseResponse<PltProductUnqualifiedReason> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300008") |
| | | @Log("查询产品生产不合格原因") |
| | | public BaseResponse<QueryResultVo<List<PltProductUnqualifiedReason>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @SsoPowerAop(power = "10300009") |
| | | @Log("禁用或启用不合格原因") |
| | | public BaseResponse<BaRole> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | public BaseResponse<Boolean> disabled(@RequestBody PltProductUnqualifiedReason reason){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.disabled(reason.id,reason.disabled)); |
| | | count = sv.disabled(reason.id,reason.disabled); |
| | | }catch (Exception e){ |
| | | log.error("禁用或启用不合格原因异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | public Object disabled(Long id, Boolean disabled) { |
| | | public int disabled(Long id, Boolean disabled) { |
| | | PltProductUnqualifiedReason reason = new PltProductUnqualifiedReason(); |
| | | reason.setId(id); |
| | | reason.setDisabled(disabled); |
| | |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @Log("删除产品信息") |
| | | public BaseResponse<PltProduct> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(proSv.delete(Long.parseLong(id))); |
| | | count = proSv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除产品异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="save") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300007") |
| | | @Log("保存工站") |
| | | public BaseResponse<PltStation> save(@RequestBody @Valid PltStation station,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> save(@RequestBody @Valid PltStation station,BindingResult bindingResult){ |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | station.deleted = false; |
| | | return BaseResponseUtils.buildSuccess(sv.save(station)); |
| | | count = sv.save(station); |
| | | }catch (Exception e){ |
| | | log.error("保存工站异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="update") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300007") |
| | | @Log("更新工站") |
| | | public BaseResponse<PltStation> update(@RequestBody @Valid PltStation station,BindingResult bindingResult){ |
| | | public BaseResponse<Boolean> update(@RequestBody @Valid PltStation station,BindingResult bindingResult){ |
| | | int count; |
| | | try { |
| | | if (bindingResult != null && bindingResult.hasErrors()) { |
| | | return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage()); |
| | | } |
| | | return BaseResponseUtils.buildSuccess(sv.update(station)); |
| | | count = sv.update(station); |
| | | }catch (Exception e){ |
| | | log.error("更新工站异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping(path="delete") |
| | | @SsoPowerAop(power = "10300001") |
| | | @SsoPowerAop(power = "10300007") |
| | | @Log("删除工站") |
| | | public BaseResponse<PltStation> delete(String id){ |
| | | public BaseResponse<Boolean> delete(String id){ |
| | | int count; |
| | | try { |
| | | return BaseResponseUtils.buildSuccess(sv.delete(Long.parseLong(id))); |
| | | count = sv.delete(Long.parseLong(id)); |
| | | }catch (Exception e){ |
| | | log.error("删除工站异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @return |
| | | */ |
| | | @GetMapping(path="one") |
| | | @SsoPowerAop(power = "10300000") //登录与权限同时验证 |
| | | @SsoPowerAop(power = "10300006") //登录与权限同时验证 |
| | | @Log("根据ID查询工站") |
| | | public BaseResponse<PltStation> one(String id){ |
| | | try{ |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping(path="some") |
| | | @SsoPowerAop(power = "10300000") |
| | | @SsoPowerAop(power = "10300006") |
| | | @Log("分页查询工站") |
| | | public BaseResponse<QueryResultVo<List<PltStation>>> some(@RequestBody QueryVo vo){ |
| | | try { |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping(path="disabled") |
| | | @SsoPowerAop(power = "10100011") |
| | | @Log("禁用或启用工站") |
| | | public BaseResponse<Boolean> disabled(@RequestBody PltStation station){ |
| | | int count; |
| | | try { |
| | | count = sv.disabled(station.id,station.disabled); |
| | | }catch (Exception e){ |
| | | log.error("禁用或启用工站异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()); |
| | | } |
| | | if (count <= 0) { |
| | | return BaseResponseUtils.buildFail("数据库存储失败"); |
| | | } else { |
| | | return BaseResponseUtils.buildSuccess(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | return rsVo ; |
| | | } |
| | | |
| | | public int disabled(Long id, Boolean disabled) { |
| | | PltStation station = new PltStation(); |
| | | station.setId(id); |
| | | station.setDisabled(disabled); |
| | | return dao.updateByPrimaryKeySelective(station); |
| | | } |
| | | } |
| | | |