已添加6个文件
已重命名19个文件
已修改16个文件
已删除5个文件
| | |
| | | @ApiImplicitParam(name = "formTime", value = "æ¥ææ¥æ", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "createTime", value = "æ¥æ£æ¥æ", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "insState", value = "æ£æµç¶æ: å
¨é¨é»è®¤2", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "judgeState", value = "åæ ¼ç¶æ: å
¨é¨é»è®¤2", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "judgeState", value = "åæ ¼ç¶æ: å
¨é¨é»è®¤2", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/selectRawInspectsList") |
| | | public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String createTime, Integer insState, Integer judgeState) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.StatisticsData; |
| | | import com.yuanchu.mom.service.ResportService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("/resport") |
| | | @Api(tags = "QMS管ç-->è´¨éç»è®¡") |
| | | public class ResportController { |
| | | |
| | | @Resource |
| | | ResportService resportService; |
| | | |
| | | |
| | | @ApiOperation("计ç®åæ ¼ä¸ä¸åæ ¼æ°éæ¥å£") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "begin", value = "ç»è®¡å¼å§æ¥æ", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "end", value = "ç»è®¡ç»ææ¥æ", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/qualifiedStatistics") |
| | | public Result turno(String begin, String end) { |
| | | StatisticsData statisticsData=resportService.turno(begin,end); |
| | | return Result.success(statisticsData); |
| | | } |
| | | |
| | | @ApiOperation("计ç®äº§åæ°éæ¥å£") |
| | | @GetMapping("/allNum") |
| | | public Result allNum() { |
| | | return Result.success(resportService.allNum()); |
| | | } |
| | | |
| | | @ApiOperation("计ç®äº§åè¾¾æ æ°éæ¥å£") |
| | | @GetMapping("/statisNum") |
| | | public Result statisNum() { |
| | | return Result.success(resportService.statisNum()); |
| | | } |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | public interface FinishedInspectMapper extends BaseMapper<FinishedInspect> { |
| | | |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername); |
| | | |
| | | //è®¡ç®æåæè
è¿ç¨æ£éªå¨æä¸ä¸ªæ¶é´æ®µçåæ ¼æ° |
| | | Integer selCountFin(String begin, String end, int type,int result); |
| | | |
| | | //è®¡ç®æäº§é |
| | | Long seAllCount(String begin, String end, int type); |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | List<RawInspect> selectRawInspectsByLimit(int pageSize, int countSize, String formTime, String createTime,int insState,int judgeState); |
| | | |
| | | |
| | | //计ç®åææå¨æä¸ªèå´å
çåæ ¼æä¸åæ ¼æ°é |
| | | Integer selCountRaw(String begin, String end,Integer judgeState); |
| | | |
| | | //è®¡ç®ææ»äº§é |
| | | Long seAllCount(String begin, String end); |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @Builder |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | public class ProReport implements Serializable { |
| | | |
| | | //æ¥æï¼ä»¥éå·åéï¼ä¾å¦ï¼2022-10-01,2022-10-02,2022-10-03 |
| | | private String dateList; |
| | | |
| | | //æåæ»éï¼ä»¥éå·åéï¼ä¾å¦ï¼200,210,220 |
| | | private String finishedList; |
| | | |
| | | //è¿ç¨æ»éï¼ä»¥éå·åéï¼ä¾å¦ï¼20,21,10 |
| | | private String processList; |
| | | |
| | | //åæææ»éï¼ä»¥éå·åéï¼ä¾å¦ï¼20,21,10 |
| | | private String materialList; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class StatisticsData { |
| | | private int material; //åææåæ ¼ |
| | | private int process; //è¿ç¨åæ ¼ |
| | | private int finished; //æååæ ¼ |
| | | private int unmaterial; //åææä¸åæ ¼ |
| | | private int unprocess; //è¿ç¨ä¸åæ ¼ |
| | | private int unfinished; //æåä¸åæ ¼ |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | import com.yuanchu.mom.pojo.StatisticsData; |
| | | import com.yuanchu.mom.pojo.ProReport; |
| | | |
| | | public interface ResportService { |
| | | |
| | | /** |
| | | * 计ç®åæ ¼ä¸ä¸åæ ¼æ°é |
| | | * @param begin |
| | | * @param end |
| | | * @return |
| | | */ |
| | | StatisticsData turno(String begin, String end); |
| | | |
| | | /** |
| | | * 计ç®äº§åæ»é |
| | | * @return |
| | | */ |
| | | ProReport allNum(); |
| | | |
| | | /** |
| | | * 计ç®è¾¾æ æ»é |
| | | * @return |
| | | */ |
| | | ProReport statisNum(); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.yuanchu.mom.mapper.FinishedInspectMapper; |
| | | import com.yuanchu.mom.mapper.RawInspectMapper; |
| | | import com.yuanchu.mom.pojo.ProReport; |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.yuanchu.mom.pojo.StatisticsData; |
| | | import com.yuanchu.mom.service.ResportService; |
| | | import lombok.Data; |
| | | import org.apache.tomcat.util.buf.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | |
| | | |
| | | @Service |
| | | public class ResportServiceImpl implements ResportService { |
| | | |
| | | @Resource |
| | | RawInspectMapper rawInspectMapper; |
| | | |
| | | @Resource |
| | | FinishedInspectMapper finishedInspectMapper; |
| | | |
| | | //计ç®åæ ¼ä¸ä¸åæ ¼æ°é |
| | | @Override |
| | | public StatisticsData turno(String begin, String end) { |
| | | StatisticsData statisticsData = new StatisticsData(); |
| | | //åææåæ ¼ |
| | | Integer material = rawInspectMapper.selCountRaw(begin, end, 1); |
| | | statisticsData.setMaterial(material); |
| | | //åææä¸åæ ¼ |
| | | Integer unmaterial = rawInspectMapper.selCountRaw(begin, end, 0); |
| | | statisticsData.setUnmaterial(unmaterial); |
| | | //è¿ç¨åæ ¼æ° |
| | | Integer process = finishedInspectMapper.selCountFin(begin, end, 1, 1); |
| | | statisticsData.setProcess(process); |
| | | //è¿ç¨ä¸åæ ¼ |
| | | Integer unprocess = finishedInspectMapper.selCountFin(begin, end, 1, 0); |
| | | statisticsData.setUnprocess(unprocess); |
| | | //æååæ ¼æ° |
| | | Integer finished = finishedInspectMapper.selCountFin(begin, end, 0, 1); |
| | | statisticsData.setFinished(finished); |
| | | //æåä¸åæ ¼ |
| | | Integer unfinished = finishedInspectMapper.selCountFin(begin, end, 0, 0); |
| | | statisticsData.setUnfinished(unfinished); |
| | | return statisticsData; |
| | | } |
| | | |
| | | //计ç®äº§åæ»é |
| | | @Override |
| | | public ProReport allNum() { |
| | | // è·åå½åæ¥æçå两个æçæ¥æ |
| | | ArrayList<String> dateList = new ArrayList<>(); |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDate oneAgo = now.minusMonths(1); |
| | | LocalDate twoAgo = now.minusMonths(2); |
| | | // æ ¼å¼åæ¥æå¯¹è±¡ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); |
| | | dateList.add(twoAgo.format(formatter)); |
| | | dateList.add(oneAgo.format(formatter)); |
| | | dateList.add(now.format(formatter)); |
| | | //è·ååæææäº§é |
| | | Long cLong = rawInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString()); |
| | | Long bLong = rawInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString()); |
| | | Long aLong = rawInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString()); |
| | | ArrayList<String> materialList = new ArrayList<>(); |
| | | materialList.add(aLong.toString()); |
| | | materialList.add(bLong.toString()); |
| | | materialList.add(cLong.toString()); |
| | | //è·åè¿ç¨æäº§é |
| | | Long c1Long = finishedInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | Long b1Long = finishedInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | Long a1Long = finishedInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | ArrayList<String> processList = new ArrayList<>(); |
| | | processList.add(a1Long.toString()); |
| | | processList.add(b1Long.toString()); |
| | | processList.add(c1Long.toString()); |
| | | //è·åæåæäº§é |
| | | Long c2Long = finishedInspectMapper.seAllCount(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0); |
| | | Long b2Long = finishedInspectMapper.seAllCount(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0); |
| | | Long a2Long = finishedInspectMapper.seAllCount(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0); |
| | | ArrayList<String> finishedList = new ArrayList<>(); |
| | | finishedList.add(a2Long.toString()); |
| | | finishedList.add(b2Long.toString()); |
| | | finishedList.add(c2Long.toString()); |
| | | return ProReport.builder() |
| | | .dateList(StringUtils.join(dateList, ',')) |
| | | .materialList(StringUtils.join(materialList, ',')) |
| | | .processList(StringUtils.join(processList, ',')) |
| | | .finishedList(StringUtils.join(finishedList, ',')) |
| | | .build(); |
| | | } |
| | | |
| | | //计ç®è¾¾æ æ»é |
| | | @Override |
| | | public ProReport statisNum() { |
| | | // è·åå½åæ¥æçå两个æçæ¥æ |
| | | ArrayList<String> dateList = new ArrayList<>(); |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDate oneAgo = now.minusMonths(1); |
| | | LocalDate twoAgo = now.minusMonths(2); |
| | | // æ ¼å¼åæ¥æå¯¹è±¡ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); |
| | | dateList.add(twoAgo.format(formatter)); |
| | | dateList.add(oneAgo.format(formatter)); |
| | | dateList.add(now.format(formatter)); |
| | | //è·ååæææè¾¾æ 产é |
| | | Integer c = rawInspectMapper.selCountRaw(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | Integer b = rawInspectMapper.selCountRaw(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | Integer a = rawInspectMapper.selCountRaw(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1); |
| | | ArrayList<String> materialList = new ArrayList<>(); |
| | | materialList.add(a.toString()); |
| | | materialList.add(b.toString()); |
| | | materialList.add(c.toString()); |
| | | //è·åè¿ç¨æè¾¾æ 产é |
| | | Integer c1 = finishedInspectMapper.selCountFin(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1); |
| | | Integer b1 = finishedInspectMapper.selCountFin(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1); |
| | | Integer a1 = finishedInspectMapper.selCountFin(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 1, 1); |
| | | ArrayList<String> processList = new ArrayList<>(); |
| | | processList.add(a1.toString()); |
| | | processList.add(b1.toString()); |
| | | processList.add(c1.toString()); |
| | | //è·åæåæè¾¾æ 产é |
| | | Integer c2 = finishedInspectMapper.selCountFin(now.withDayOfMonth(1).toString(), now.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1); |
| | | Integer b2 = finishedInspectMapper.selCountFin(oneAgo.withDayOfMonth(1).toString(), oneAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1); |
| | | Integer a2 = finishedInspectMapper.selCountFin(twoAgo.withDayOfMonth(1).toString(), twoAgo.plusMonths(1).withDayOfMonth(1).minusDays(1).toString(), 0, 1); |
| | | ArrayList<String> finishedList = new ArrayList<>(); |
| | | finishedList.add(a2.toString()); |
| | | finishedList.add(b2.toString()); |
| | | finishedList.add(c2.toString()); |
| | | return ProReport.builder() |
| | | .dateList(StringUtils.join(dateList, ',')) |
| | | .materialList(StringUtils.join(materialList, ',')) |
| | | .processList(StringUtils.join(processList, ',')) |
| | | .finishedList(StringUtils.join(finishedList, ',')) |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | <?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.yuanchu.mom.mapper.FinishedInspectMapper"> |
| | | |
| | | <select id="selectFinishedInspectPage" resultType="map"> |
| | | SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`, f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`, |
| | | SELECT f.`id`, f.`order_number`, f.`customer_name`, f.`project_name`, f.`quality_traceability`, |
| | | f.`material_code`, f.`material`, f.`specifications_model`, f.`unit`, |
| | | f.`quantity`, u.`name`, DATE_FORMAT(f.`create_time`, '%Y-%m-%d') detectionPeriod, f.`result` |
| | | FROM finished_inspect f, `user` u |
| | | WHERE f.`user_id` = u.`id` |
| | |
| | | AND u.`name` LIKE CONCAT('%',#{inspectUsername},'%') |
| | | </if> |
| | | </select> |
| | | <select id="selCountFin" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from mom_ocean.finished_inspect |
| | | where state=1 |
| | | and result=#{result} |
| | | and type=#{type} |
| | | <if test="begin != null and begin!=''"> |
| | | and finished_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and finished_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | <select id="seAllCount" resultType="java.lang.Long"> |
| | | select count(id) |
| | | from mom_ocean.finished_inspect |
| | | where state=1 |
| | | and type=#{type} |
| | | <if test="begin != null and begin!=''"> |
| | | and finished_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and finished_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | order by id desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | <select id="selCountRaw" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from mom_ocean.raw_inspect |
| | | where state=1 |
| | | and ins_state=1 |
| | | and judge_state=#{judgeState} |
| | | <if test="begin != null and begin!=''"> |
| | | and raw_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and raw_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | <select id="seAllCount" resultType="java.lang.Long"> |
| | | select count(id) |
| | | from mom_ocean.raw_inspect |
| | | where state=1 |
| | | <if test="begin != null and begin!=''"> |
| | | and raw_inspect.create_time >= #{begin} |
| | | </if> |
| | | <if test="end != null and end!=''"> |
| | | and raw_inspect.create_time <= #{end} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.yuanchu.mom; |
| | | |
| | | |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | |
| | | |
| | | @SpringBootTest |
| | | class InspectServerApplicationTests { |
| | |
| | | @Test |
| | | void contextLoads() { |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>sale-server</artifactId> |
| | | <version>1.0.0</version> |
| | | </dependency> |
| | | |
| | | <!--å·¥å
·æ¨¡å--> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/mom/controller/OrdersController.java ÐÞ¸Ä |
| | |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "orderCode", value = "订åç¼å·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "state", value = "ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "state", value = "ç¼å¶ç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "time", value = "ä¸åæ¶é´", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllOrder") |
| | |
| | | map.put("total", inspectionPage.getTotal()); |
| | | map.put("row", inspectionPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®è®¢åidæ¥è¯¢è®¢å详æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "订åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectOrderById") |
| | | public Result selectOrderById(Integer id) { |
| | | return Result.success(ordersService.getById(id)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ååid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/selReceDatil") |
| | | @GetMapping("/selReceDatil") |
| | | public ResponseEntity<byte[]> selReceDatil(Integer id) throws IOException { |
| | | return receiptService.selReceDatil(id); |
| | | } |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/controller/SaleController.java ÐÞ¸Ä |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.dto.vo.SaleVo; |
| | | import com.yuanchu.mom.pojo.vo.SaleVo; |
| | | import com.yuanchu.mom.service.RepertoryService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.lang.reflect.Array; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @Resource |
| | | RepertoryService repertoryService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢éå®åå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢éå®å-->æ·»å 产å-->æ¥è¯¢æååºå") |
| | | @PostMapping("/seleRepe") |
| | | public Result seleRepe() { |
| | | return Result.success(repertoryService.getSale()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢éå®å") |
| | | @PostMapping("/addSale") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody SaleDto saleDto) throws Exception { |
| | |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | //æ¥è¯¢ææåºåå表 |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | |
| | | //æ¥è¯¢åºåä¸ä¸ªåæ®µç»æ·»å éå®å |
| | | List<Map<String, Object>> getSale(); |
| | | |
| | | } |
| | | |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/mapper/SaleMapper.java ÐÞ¸Ä |
| | |
| | | //æ¥è¯¢éå®åå表 |
| | | IPage<Map<String, Object>> selectSaleList(Page<Object> page, String orderNumber, String name, Integer type, String delTime); |
| | | |
| | | |
| | | |
| | | //æ¥è¯¢è®¢åbomå表 |
| | | IPage<Map<String, Object>> selectAllOrder(Page<Object> page, String orderCode, String name, Integer state, String time); |
| | | } |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/pojo/Sale.java ÐÞ¸Ä |
| | |
| | | @ApiModelProperty(value = "ç¶æ 0:ä¸éè¿;1:éè¿") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "ç¼å¶ç¶æ0:å¾
ç¼å¶;1å·²ç¼å¶ éè¿å°±æ¯å·²ç¼å¶,没æç¶æå°±æ¯å¾
ç¼å¶") |
| | | private Integer bianzhiState; |
| | | |
| | | |
| | | } |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/pojo/dto/vo/SaleVo.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.mom.pojo.dto.vo; |
| | | package com.yuanchu.mom.pojo.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/mom/service/OrdersService.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Orders; |
| | | |
| | | import java.util.Map; |
| | | |
| | |
| | | * @author zss |
| | | * @since 2023-07-31 11:57:44 |
| | | */ |
| | | public interface OrdersService extends IService<Orders> { |
| | | public interface OrdersService { |
| | | /** |
| | | * æ¥è¯¢ææè®¢åå表 |
| | | * |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | |
| | | /** |
| | | * æ¥è¯¢åºåä¸ä¸ªåæ®µç»æ·»å éå®å |
| | | * @return |
| | | */ |
| | | List<Map<String,Object>> getSale(); |
| | | } |
| | | |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/service/SaleService.java ÐÞ¸Ä |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto1; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.pojo.dto.vo.SaleVo; |
| | | import com.yuanchu.mom.pojo.vo.SaleVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| ÎļþÃû´Ó standard-server/src/main/java/com/yuanchu/mom/service/impl/OrdersServiceImpl.java ÐÞ¸Ä |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.OrdersMapper; |
| | | import com.yuanchu.mom.pojo.Orders; |
| | | import com.yuanchu.mom.mapper.SaleMapper; |
| | | import com.yuanchu.mom.service.OrdersService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | * @since 2023-07-31 11:57:44 |
| | | */ |
| | | @Service("orderService") |
| | | public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService { |
| | | public class OrdersServiceImpl implements OrdersService { |
| | | |
| | | @Resource |
| | | OrdersMapper orderMapper; |
| | | SaleMapper saleMapper; |
| | | |
| | | //æ¥è¯¢ææè®¢åå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllOrder(Page<Object> page, String orderCode, String name, Integer state , String time) { |
| | | return orderMapper.selectAllOrder(page, orderCode,name,state, time); |
| | | return saleMapper.selectAllOrder(page, orderCode,name,state, time); |
| | | } |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type,checkState); |
| | | } |
| | | |
| | | //æ¥è¯¢åºåä¸ä¸ªåæ®µç»æ·»å éå®å |
| | | @Override |
| | | public List<Map<String, Object>> getSale() { |
| | | return repertoryMapper.getSale(); |
| | | } |
| | | } |
| | | |
| ÎļþÃû´Ó sale-server/src/main/java/com/yuanchu/mom/service/impl/SaleServiceImpl.java ÐÞ¸Ä |
| | |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto2; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | | import com.yuanchu.mom.pojo.dto.SaleMaterialDto; |
| | | import com.yuanchu.mom.pojo.dto.vo.SaleVo; |
| | | import com.yuanchu.mom.pojo.vo.SaleVo; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | BeanUtils.copyProperties(saleDto,sale); |
| | | sale.setSaleman(saleman); |
| | | saleMapper.insert(sale); |
| | | //妿saleMaterialListæå¼,éè¦æ·»å éå®äº§åå |
| | | //æ·»å éå®äº§åå |
| | | List<SaleMaterialDto> saleMaterialDtoList = saleDto.getSaleMaterialList(); |
| | | for (SaleMaterialDto saleMaterialDto : saleMaterialDtoList) { |
| | | SaleMaterial saleMaterial = new SaleMaterial(); |
| | |
| | | sale.setType(type); |
| | | sale.setCheckname(checkname); |
| | | sale.setCheckTime(new Date()); |
| | | if (type==1) { |
| | | //å¦æå®¡æ ¸éè¿ |
| | | sale.setBianzhiState(1); |
| | | }else { |
| | | //å¦æå®¡æ ¸ä¸éè¿ |
| | | sale.setBianzhiState(null); |
| | | } |
| | | saleMapper.updateById(sale); |
| | | } |
| | | |
| | |
| | | unit, |
| | | number, |
| | | user_name, |
| | | create_time |
| | | DATE_FORMAT(create_time, '%Y-%m-%d')'å
¥åºæ¥æ' |
| | | from mom_ocean.import_repertory |
| | | where state=1 |
| | | <if test="orderCode!=null and orderCode!=''"> |
| | |
| | | </if> |
| | | order by id desc |
| | | </where> |
| | | </select> |
| | | <!--æ¥è¯¢åºåä¸ä¸ªåæ®µç»æ·»å éå®å--> |
| | | <select id="getSale" resultType="java.util.Map"> |
| | | select id, name, specifications, unit |
| | | from mom_ocean.repertory |
| | | where state = 1 |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.yuanchu.mom.mapper.SaleMapper"> |
| | | <select id="selectSaleList" resultType="java.util.Map"> |
| | | select id, |
| | | order_number, |
| | | code, |
| | | name, |
| | | proname, |
| | | type, |
| | | DATE_FORMAT(delTime, '%Y-%m-%d') 'äº¤è´§æ¥æ' |
| | | from mom_ocean.sale |
| | | where state=1 |
| | | <if test="orderNumber!=null and orderNumber!=''"> |
| | | and order_number like concat('%',#{orderNumber},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="delTime!=null and delTime!=''"> |
| | | and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--æ¥è¯¢è®¢åBOMå表--> |
| | | <select id="selectAllOrder" resultType="java.util.Map"> |
| | | select s.id , |
| | | order_number, |
| | | saleman, |
| | | proname, |
| | | sm.name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | DATE_FORMAT(s.create_time, '%Y-%m-%d') 'ä¸åæ¥æ', |
| | | DATE_FORMAT(delTime, '%Y-%m-%d') 'äº¤è´§æ¥æ', |
| | | bianzhi_state |
| | | from mom_ocean.sale s ,mom_ocean.sale_material sm |
| | | where s.id=sm.sale_id |
| | | and s.state=1 |
| | | <if test="orderCode!=null and orderCode!=''"> |
| | | and order_number like concat('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and sm.name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="state!=null and state!=''"> |
| | | and bianzhi_state=#{state} |
| | | </if> |
| | | <if test="time!=null and time!=''"> |
| | | and s.create_time=#{time} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | <module>inspect-server</module> |
| | | <module>inventory-server</module> |
| | | <module>system-run</module> |
| | | <module>sale-server</module> |
| | | </modules> |
| | | |
| | | <properties> |
| | |
| | | <artifactId>user-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | </project> |
| | |
| | | <artifactId>inventory-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>inventory-server</artifactId> |
| | | <version>0.0.1-SNAPSHOT</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.yuanchu.mom</groupId> |
| | | <artifactId>sale-server</artifactId> |
| | | <version>1.0.0</version> |
| | | </dependency> |
| | | |
| | | <!--druid--> |
| | | <dependency> |