吴健
2024-11-19 6fbc7b7b7e21b60c9c0f8e0559ae67bfe42ce477
Merge remote-tracking branch 'origin/master'

# Conflicts:
# billion-main/src/main/java/com/billion/main/service/impl/DaMaterialCollectionServiceImpl.java
已添加6个文件
已修改2个文件
466 ■■■■■ 文件已修改
billion-main/src/main/java/com/billion/main/controller/BsWorkshopController.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/domain/BsWorkshop.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/mapper/BsWorkshopMapper.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/service/IBsWorkshopService.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/service/impl/BsWorkshopServiceImpl.java 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/service/impl/DaMaterialCollectionServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/resources/mapper/BsWorkshopMapper.xml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sql/table.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
billion-main/src/main/java/com/billion/main/controller/BsWorkshopController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
package com.billion.main.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.billion.main.domain.BsWorkshop;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.billion.common.annotation.Log;
import com.billion.common.core.controller.BaseController;
import com.billion.common.core.domain.AjaxResult;
import com.billion.common.enums.BusinessType;
import com.billion.main.service.IBsWorkshopService;
import com.billion.common.utils.poi.ExcelUtil;
import com.billion.common.core.page.TableDataInfo;
/**
 * è½¦é—´ä¿¡æ¯Controller
 *
 * @author Billion-Yi
 * @date 2024-11-19
 */
@RestController
@RequestMapping("/bs/workshop")
public class BsWorkshopController extends BaseController
{
    @Autowired
    private IBsWorkshopService bsWorkshopService;
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:list')")
    @GetMapping("/list")
    public TableDataInfo list(BsWorkshop bsWorkshop)
    {
        startPage();
        List<BsWorkshop> list = bsWorkshopService.selectBsWorkshopList(bsWorkshop);
        return getDataTable(list);
    }
    /**
     * å¯¼å‡ºè½¦é—´ä¿¡æ¯åˆ—表
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:export')")
    @Log(title = "车间信息", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BsWorkshop bsWorkshop)
    {
        List<BsWorkshop> list = bsWorkshopService.selectBsWorkshopList(bsWorkshop);
        ExcelUtil<BsWorkshop> util = new ExcelUtil<BsWorkshop>(BsWorkshop.class);
        util.exportExcel(response, list, "车间信息数据");
    }
    /**
     * èŽ·å–车间信息详细信息
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(bsWorkshopService.selectBsWorkshopById(id));
    }
    /**
     * æ–°å¢žè½¦é—´ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:add')")
    @Log(title = "车间信息", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BsWorkshop bsWorkshop)
    {
        return toAjax(bsWorkshopService.insertBsWorkshop(bsWorkshop));
    }
    /**
     * ä¿®æ”¹è½¦é—´ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:edit')")
    @Log(title = "车间信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BsWorkshop bsWorkshop)
    {
        return toAjax(bsWorkshopService.updateBsWorkshop(bsWorkshop));
    }
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯
     */
    @PreAuthorize("@ss.hasPermi('bs:workshop:remove')")
    @Log(title = "车间信息", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(bsWorkshopService.deleteBsWorkshopByIds(ids));
    }
}
billion-main/src/main/java/com/billion/main/domain/BsWorkshop.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
package com.billion.main.domain;
import com.billion.common.annotation.Excel;
import com.billion.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
 * è½¦é—´ä¿¡æ¯å¯¹è±¡ bs_workshop
 *
 * @author Billion-Yi
 * @date 2024-11-19
 */
@Data
public class BsWorkshop extends BaseEntity
{
    private static final long serialVersionUID = 1L;
    /** id */
    private Long id;
    /** è½¦é—´ç¼–码 */
    @Excel(name = "车间编码")
    private String workshopCode;
    /** è½¦é—´åç§° */
    @Excel(name = "车间名称")
    private String workshopName;
    /** å¤‡ç”¨å­—段1 */
    private String spareField1;
    /** å¤‡ç”¨å­—段2 */
    private String spareField2;
    /** å¤‡æ³¨ */
    @Excel(name = "备注")
    private String remarks;
}
billion-main/src/main/java/com/billion/main/mapper/BsWorkshopMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.billion.main.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.billion.main.domain.BsWorkshop;
import java.util.List;
/**
 * è½¦é—´ä¿¡æ¯Mapper接口
 *
 * @author Billion-Yi
 * @date 2024-11-19
 */
public interface BsWorkshopMapper extends BaseMapper<BsWorkshop>
{
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return è½¦é—´ä¿¡æ¯
     */
    public BsWorkshop selectBsWorkshopById(Long id);
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯åˆ—表
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return è½¦é—´ä¿¡æ¯é›†åˆ
     */
    public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop);
    /**
     * æ–°å¢žè½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int insertBsWorkshop(BsWorkshop bsWorkshop);
    /**
     * ä¿®æ”¹è½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int updateBsWorkshop(BsWorkshop bsWorkshop);
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteBsWorkshopById(Long id);
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param ids éœ€è¦åˆ é™¤çš„数据主键集合
     * @return ç»“æžœ
     */
    public int deleteBsWorkshopByIds(Long[] ids);
}
billion-main/src/main/java/com/billion/main/service/IBsWorkshopService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,64 @@
package com.billion.main.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.billion.main.domain.BsWorkshop;
import java.util.List;
/**
 * è½¦é—´ä¿¡æ¯Service接口
 *
 * @author Billion-Yi
 * @date 2024-11-19
 */
public interface IBsWorkshopService extends IService<BsWorkshop>
{
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return è½¦é—´ä¿¡æ¯
     */
    public BsWorkshop selectBsWorkshopById(Long id);
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯åˆ—表
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return è½¦é—´ä¿¡æ¯é›†åˆ
     */
    public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop);
    /**
     * æ–°å¢žè½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int insertBsWorkshop(BsWorkshop bsWorkshop);
    /**
     * ä¿®æ”¹è½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    public int updateBsWorkshop(BsWorkshop bsWorkshop);
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param ids éœ€è¦åˆ é™¤çš„车间信息主键集合
     * @return ç»“æžœ
     */
    public int deleteBsWorkshopByIds(Long[] ids);
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return ç»“æžœ
     */
    public int deleteBsWorkshopById(Long id);
}
billion-main/src/main/java/com/billion/main/service/impl/BsWorkshopServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,98 @@
package com.billion.main.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.billion.common.utils.DateUtils;
import com.billion.main.domain.BsWorkshop;
import com.billion.main.mapper.BsWorkshopMapper;
import com.billion.main.service.IBsWorkshopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * è½¦é—´ä¿¡æ¯Service业务层处理
 *
 * @author Billion-Yi
 * @date 2024-11-19
 */
@Service
public class BsWorkshopServiceImpl extends ServiceImpl<BsWorkshopMapper, BsWorkshop> implements IBsWorkshopService
{
    @Autowired
    private BsWorkshopMapper bsWorkshopMapper;
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return è½¦é—´ä¿¡æ¯
     */
    @Override
    public BsWorkshop selectBsWorkshopById(Long id)
    {
        return bsWorkshopMapper.selectBsWorkshopById(id);
    }
    /**
     * æŸ¥è¯¢è½¦é—´ä¿¡æ¯åˆ—表
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return è½¦é—´ä¿¡æ¯
     */
    @Override
    public List<BsWorkshop> selectBsWorkshopList(BsWorkshop bsWorkshop)
    {
        return bsWorkshopMapper.selectBsWorkshopList(bsWorkshop);
    }
    /**
     * æ–°å¢žè½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public int insertBsWorkshop(BsWorkshop bsWorkshop)
    {
        bsWorkshop.setCreateTime(DateUtils.getNowDate());
        return bsWorkshopMapper.insertBsWorkshop(bsWorkshop);
    }
    /**
     * ä¿®æ”¹è½¦é—´ä¿¡æ¯
     *
     * @param bsWorkshop è½¦é—´ä¿¡æ¯
     * @return ç»“æžœ
     */
    @Override
    public int updateBsWorkshop(BsWorkshop bsWorkshop)
    {
        bsWorkshop.setUpdateTime(DateUtils.getNowDate());
        return bsWorkshopMapper.updateBsWorkshop(bsWorkshop);
    }
    /**
     * æ‰¹é‡åˆ é™¤è½¦é—´ä¿¡æ¯
     *
     * @param ids éœ€è¦åˆ é™¤çš„车间信息主键
     * @return ç»“æžœ
     */
    @Override
    public int deleteBsWorkshopByIds(Long[] ids)
    {
        return bsWorkshopMapper.deleteBsWorkshopByIds(ids);
    }
    /**
     * åˆ é™¤è½¦é—´ä¿¡æ¯ä¿¡æ¯
     *
     * @param id è½¦é—´ä¿¡æ¯ä¸»é”®
     * @return ç»“æžœ
     */
    @Override
    public int deleteBsWorkshopById(Long id)
    {
        return bsWorkshopMapper.deleteBsWorkshopById(id);
    }
}
billion-main/src/main/java/com/billion/main/service/impl/DaMaterialCollectionServiceImpl.java
@@ -19,7 +19,6 @@
    implements DaMaterialCollectionService{
}
billion-main/src/main/resources/mapper/BsWorkshopMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,91 @@
<?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.billion.main.mapper.BsWorkshopMapper">
    <resultMap type="BsWorkshop" id="BsWorkshopResult">
        <result property="id"    column="id"    />
        <result property="workshopCode"    column="workshop_code"    />
        <result property="workshopName"    column="workshop_name"    />
        <result property="spareField1"    column="spare_field1"    />
        <result property="spareField2"    column="spare_field2"    />
        <result property="remarks"    column="remarks"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
    <sql id="selectBsWorkshopVo">
        select id, workshop_code, workshop_name, spare_field1, spare_field2, remarks, create_by, create_time, update_by, update_time from bs_workshop
    </sql>
    <select id="selectBsWorkshopList" parameterType="BsWorkshop" resultMap="BsWorkshopResult">
        <include refid="selectBsWorkshopVo"/>
        <where>
            <if test="workshopCode != null  and workshopCode != ''"> and workshop_code = #{workshopCode}</if>
            <if test="workshopName != null  and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
        </where>
    </select>
    <select id="selectBsWorkshopById" parameterType="Long" resultMap="BsWorkshopResult">
        <include refid="selectBsWorkshopVo"/>
        where id = #{id}
    </select>
    <insert id="insertBsWorkshop" parameterType="BsWorkshop">
        insert into bs_workshop
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="workshopCode != null">workshop_code,</if>
            <if test="workshopName != null">workshop_name,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="remarks != null">remarks,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="workshopCode != null">#{workshopCode},</if>
            <if test="workshopName != null">#{workshopName},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
    <update id="updateBsWorkshop" parameterType="BsWorkshop">
        update bs_workshop
        <trim prefix="SET" suffixOverrides=",">
            <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
            <if test="workshopName != null">workshop_name = #{workshopName},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <delete id="deleteBsWorkshopById" parameterType="Long">
        delete from bs_workshop where id = #{id}
    </delete>
    <delete id="deleteBsWorkshopByIds" parameterType="String">
        delete from bs_workshop where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
sql/table.sql
@@ -20,7 +20,7 @@
-- ----------------------------
-- 2、参数采集配置
-- ----------------------------
drop table if exists sc_opc_conf;
drop table if exists sc_collection_param_conf;
create table sc_collection_param_conf (
    id           bigint(20)      not null auto_increment    comment '主键id',
    product_code         varchar(64)     default ''                 comment '产品编码',