计划模块(白坯订单管理)

highway
wws 2 years ago
parent 9229c77301
commit 87bb08a360

@ -0,0 +1,96 @@
package com.op.plan.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.plan.service.IProWhiteOrderService;
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.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.plan.domain.ProOrder;
import com.op.plan.service.IProOrderService;
import com.op.common.core.web.controller.BaseController;
import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* controller
*/
@RestController
@RequestMapping("/whiteOrder")
public class ProWhiteOrderController {
@Autowired
private IProWhiteOrderService proWhiteOrderService;
/**
*
*/
@RequiresPermissions("plan:whiteOrder:list")
@GetMapping("/list")
public AjaxResult list(ProOrder proOrder) {
List<ProOrder> list = proWhiteOrderService.selectProOrderList(proOrder);
return success(list);
}
/**
*
*/
@RequiresPermissions("plan:whiteOrder:export")
@Log(title = "白坯订单管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, ProOrder proOrder) {
List<ProOrder> list = proWhiteOrderService.selectProOrderList(proOrder);
ExcelUtil<ProOrder> util = new ExcelUtil<ProOrder>(ProOrder.class);
util.exportExcel(response, list, "白坯订单管理数据");
}
/**
*
*/
@RequiresPermissions("plan:whiteOrder:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) {
return success(proWhiteOrderService.selectProOrderById(id));
}
/**
*
*/
@RequiresPermissions("plan:whiteOrder:add")
@Log(title = "白坯订单管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody ProOrder proOrder) {
return success(proWhiteOrderService.insertProOrder(proOrder));
}
/**
*
*/
@RequiresPermissions("plan:whiteOrder:edit")
@Log(title = "白坯订单管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody ProOrder proOrder) {
return success(proWhiteOrderService.updateProOrder(proOrder));
}
/**
*
*/
@RequiresPermissions("plan:whiteOrder:remove")
@Log(title = "白坯订单管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) {
return success(proWhiteOrderService.deleteProOrderByIds(ids));
}
}

@ -0,0 +1,61 @@
package com.op.plan.mapper;
import com.op.plan.domain.ProOrder;
import java.util.List;
/**
* Mapper
*
* @author Open Platform
* @date 2023-09-12
*/
public interface ProWhiteOrderMapper {
/**
*
*
* @param id
* @return
*/
public ProOrder selectProOrderById(String id);
/**
*
*
* @param proOrder
* @return
*/
public List<ProOrder> selectProOrderList(ProOrder proOrder);
/**
*
*
* @param proOrder
* @return
*/
public int insertProOrder(ProOrder proOrder);
/**
*
*
* @param proOrder
* @return
*/
public int updateProOrder(ProOrder proOrder);
/**
*
*
* @param id
* @return
*/
public int deleteProOrderById(String id);
/**
*
*
* @param ids
* @return
*/
public int deleteProOrderByIds(String[] ids);
}

@ -0,0 +1,61 @@
package com.op.plan.service;
import com.op.plan.domain.ProOrder;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-09-12
*/
public interface IProWhiteOrderService {
/**
*
*
* @param id
* @return
*/
public ProOrder selectProOrderById(String id);
/**
*
*
* @param proOrder
* @return
*/
public List<ProOrder> selectProOrderList(ProOrder proOrder);
/**
*
*
* @param proOrder
* @return
*/
public int insertProOrder(ProOrder proOrder);
/**
*
*
* @param proOrder
* @return
*/
public int updateProOrder(ProOrder proOrder);
/**
*
*
* @param ids
* @return
*/
public int deleteProOrderByIds(String[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteProOrderById(String id);
}

@ -584,7 +584,6 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
@Override
@DS("#header.poolName")
public AjaxResult checkWorkOrder(String id) {
// 判断工单状态1.活动不可以2.已报工不可以
ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(id);
if (!(proOrderWorkorder.getStatus().equals("w0") ||proOrderWorkorder.getStatus().equals("w1"))) {
return error("工单已生产,不可变更!");

@ -0,0 +1,95 @@
package com.op.plan.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.plan.domain.ProOrder;
import com.op.plan.mapper.ProOrderMapper;
import com.op.plan.mapper.ProWhiteOrderMapper;
import com.op.plan.service.IProWhiteOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Service
*
* @author Open Platform
* @date 2023-09-12
*/
@Service
public class ProWhiteOrderServiceImpl implements IProWhiteOrderService {
@Autowired
private ProWhiteOrderMapper proWhiteOrderMapper;
/**
*
*
* @param id
* @return
*/
@Override
public ProOrder selectProOrderById(String id) {
return proWhiteOrderMapper.selectProOrderById(id);
}
/**
*
*
* @param proOrder
* @return
*/
@Override
@DS("#header.poolName")
public List<ProOrder> selectProOrderList(ProOrder proOrder) {
return proWhiteOrderMapper.selectProOrderList(proOrder);
}
/**
*
*
* @param proOrder
* @return
*/
@Override
public int insertProOrder(ProOrder proOrder) {
proOrder.setCreateTime(DateUtils.getNowDate());
return proWhiteOrderMapper.insertProOrder(proOrder);
}
/**
*
*
* @param proOrder
* @return
*/
@Override
public int updateProOrder(ProOrder proOrder) {
proOrder.setUpdateTime(DateUtils.getNowDate());
return proWhiteOrderMapper.updateProOrder(proOrder);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteProOrderByIds(String[] ids) {
return proWhiteOrderMapper.deleteProOrderByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteProOrderById(String id) {
return proWhiteOrderMapper.deleteProOrderById(id);
}
}

@ -0,0 +1,154 @@
<?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.op.plan.mapper.ProWhiteOrderMapper">
<resultMap type="ProOrder" id="ProOrderResult">
<result property="id" column="id" />
<result property="factoryCode" column="factory_code" />
<result property="orderType" column="order_type" />
<result property="orderCode" column="order_code" />
<result property="prodCode" column="prod_code" />
<result property="prodDesc" column="prod_desc" />
<result property="quantity" column="quantity" />
<result property="quantitySplit" column="quantity_split" />
<result property="unit" column="unit" />
<result property="workerOrder" column="worker_order" />
<result property="planProDate" column="plan_pro_date" />
<result property="planComplete" column="plan_complete" />
<result property="atrr1" column="atrr1" />
<result property="atrr2" column="atrr2" />
<result property="atrr3" column="atrr3" />
<result property="status" column="status" />
<result property="parentOrder" column="parent_order" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="prodType" column="prod_type" />
</resultMap>
<sql id="selectProOrderVo">
select id, factory_code, order_type, order_code, prod_code, prod_desc, quantity, quantity_split, unit, worker_order, plan_pro_date, plan_complete, atrr1, atrr2, atrr3, status, parent_order, create_by, create_time, update_by, update_time, prod_type from pro_order
</sql>
<select id="selectProOrderList" parameterType="ProOrder" resultMap="ProOrderResult">
<include refid="selectProOrderVo"/>
<where>
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
<if test="orderCode != null and orderCode != ''"> and order_code = #{orderCode}</if>
<if test="prodCode != null and prodCode != ''"> and prod_code = #{prodCode}</if>
<if test="prodDesc != null and prodDesc != ''"> and prod_desc like concat('%', #{prodDesc}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="quantitySplit != null "> and quantity_split = #{quantitySplit}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="workerOrder != null and workerOrder != ''"> and worker_order = #{workerOrder}</if>
<if test="planProDate != null "> and plan_pro_date = #{planProDate}</if>
<if test="planComplete != null "> and plan_complete = #{planComplete}</if>
<if test="atrr1 != null and atrr1 != ''"> and atrr1 = #{atrr1}</if>
<if test="atrr2 != null and atrr2 != ''"> and atrr2 = #{atrr2}</if>
<if test="atrr3 != null and atrr3 != ''"> and atrr3 = #{atrr3}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="parentOrder != null and parentOrder != ''"> and parent_order = #{parentOrder}</if>
and order_type = 'white' and prod_type = 'white'
</where>
ORDER BY plan_pro_date DESC
</select>
<select id="selectProOrderById" parameterType="String" resultMap="ProOrderResult">
<include refid="selectProOrderVo"/>
where id = #{id}
</select>
<insert id="insertProOrder" parameterType="ProOrder">
insert into pro_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="orderType != null">order_type,</if>
<if test="orderCode != null">order_code,</if>
<if test="prodCode != null">prod_code,</if>
<if test="prodDesc != null">prod_desc,</if>
<if test="quantity != null">quantity,</if>
<if test="quantitySplit != null">quantity_split,</if>
<if test="unit != null">unit,</if>
<if test="workerOrder != null">worker_order,</if>
<if test="planProDate != null">plan_pro_date,</if>
<if test="planComplete != null">plan_complete,</if>
<if test="atrr1 != null">atrr1,</if>
<if test="atrr2 != null">atrr2,</if>
<if test="atrr3 != null">atrr3,</if>
<if test="status != null">status,</if>
<if test="parentOrder != null">parent_order,</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>
<if test="prodType != null">prod_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="orderType != null">#{orderType},</if>
<if test="orderCode != null">#{orderCode},</if>
<if test="prodCode != null">#{prodCode},</if>
<if test="prodDesc != null">#{prodDesc},</if>
<if test="quantity != null">#{quantity},</if>
<if test="quantitySplit != null">#{quantitySplit},</if>
<if test="unit != null">#{unit},</if>
<if test="workerOrder != null">#{workerOrder},</if>
<if test="planProDate != null">#{planProDate},</if>
<if test="planComplete != null">#{planComplete},</if>
<if test="atrr1 != null">#{atrr1},</if>
<if test="atrr2 != null">#{atrr2},</if>
<if test="atrr3 != null">#{atrr3},</if>
<if test="status != null">#{status},</if>
<if test="parentOrder != null">#{parentOrder},</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>
<if test="prodType != null">#{prodType},</if>
</trim>
</insert>
<update id="updateProOrder" parameterType="ProOrder">
update pro_order
<trim prefix="SET" suffixOverrides=",">
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderCode != null">order_code = #{orderCode},</if>
<if test="prodCode != null">prod_code = #{prodCode},</if>
<if test="prodDesc != null">prod_desc = #{prodDesc},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="quantitySplit != null">quantity_split = #{quantitySplit},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="workerOrder != null">worker_order = #{workerOrder},</if>
<if test="planProDate != null">plan_pro_date = #{planProDate},</if>
<if test="planComplete != null">plan_complete = #{planComplete},</if>
<if test="atrr1 != null">atrr1 = #{atrr1},</if>
<if test="atrr2 != null">atrr2 = #{atrr2},</if>
<if test="atrr3 != null">atrr3 = #{atrr3},</if>
<if test="status != null">status = #{status},</if>
<if test="parentOrder != null">parent_order = #{parentOrder},</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>
<if test="prodType != null">prod_type = #{prodType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteProOrderById" parameterType="String">
delete from pro_order where id = #{id}
</delete>
<delete id="deleteProOrderByIds" parameterType="String">
delete from pro_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save