Merge remote-tracking branch 'origin/master'
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.exception; |
| | | |
| | | public class MyFileException extends RuntimeException{ |
| | | public MyFileException() { |
| | | } |
| | | |
| | | public MyFileException(String message) { |
| | | super(message); |
| | | } |
| | | |
| | | public MyFileException(Throwable cause) { |
| | | super(cause); |
| | | } |
| | | |
| | | public MyFileException(String message, Throwable cause) { |
| | | super(message, cause); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.handler; |
| | | |
| | | import com.yuanchu.mom.exception.MyFileException; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; |
| | | import org.apache.tomcat.util.http.fileupload.impl.SizeLimitExceededException; |
| | | import org.springframework.beans.ConversionNotSupportedException; |
| | | import org.springframework.beans.TypeMismatchException; |
| | | import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | | import org.springframework.http.converter.HttpMessageNotReadableException; |
| | | import org.springframework.http.converter.HttpMessageNotWritableException; |
| | |
| | | import org.springframework.web.bind.MethodArgumentNotValidException; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.RestControllerAdvice; |
| | | import org.springframework.web.multipart.MultipartException; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.FileNotFoundException; |
| | |
| | | return Result.fail(message); |
| | | } |
| | | |
| | | @Value("${spring.servlet.multipart.max-file-size}") |
| | | private String maxFileSize; |
| | | |
| | | @Value("${spring.servlet.multipart.max-request-size}") |
| | | private String maxRequestSize; |
| | | |
| | | /** |
| | | *æä»¶è¿å¤§æ¥éæç¤º |
| | | */ |
| | | @ExceptionHandler({MultipartException.class}) |
| | | public Result<?> fileUploadExceptionHandler(MultipartException e) { |
| | | String msg; |
| | | Throwable rootCause = e.getRootCause(); |
| | | if (rootCause instanceof FileSizeLimitExceededException) { |
| | | msg="ä¸ä¼ æä»¶è¿å¤§ãå个æä»¶å¤§å°ä¸å¾è¶
è¿" + maxFileSize + "ã"; |
| | | }else if(rootCause instanceof SizeLimitExceededException){ |
| | | msg="ä¸ä¼ æä»¶è¿å¤§ãæ»ä¸ä¼ 大å°ä¸å¾è¶
è¿" + maxRequestSize + "ã"; |
| | | }else { |
| | | msg="æä»¶ä¸ä¼ 失败ãæå¡å¨å¼å¸¸ã"; |
| | | } |
| | | return Result.fail(msg); |
| | | } |
| | | |
| | | /** æä»¶åç¼åä¸éè¿è¿åæç¤º */ |
| | | @ExceptionHandler({MyFileException.class}) |
| | | public Result<?> myFileException(Exception e) { |
| | | return Result.fail("æ±æä¸æ¯æã" + e.getMessage() +"ãåç¼çæä»¶ï¼"); |
| | | } |
| | | |
| | | /** å
¶ä»é误 */ |
| | | /** |
| | | * å
¶ä»é误 |
| | |
| | | package com.yuanchu.mom.utils; |
| | | |
| | | import com.yuanchu.mom.exception.MyFileException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.tomcat.util.http.fileupload.IOUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import org.springframework.util.FileSystemUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import javax.annotation.PostConstruct; |
| | | import java.io.ByteArrayInputStream; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | |
| | |
| | | public class FileSaveUtil { |
| | | |
| | | // åymlä¸çè·¯å¾ + / |
| | | // @Value("${file.path}") |
| | | private String FILE_PATH; |
| | | private static String FILE_PATH; |
| | | |
| | | private static String[] ALLOWED; |
| | | |
| | | @Value("${file.path}") |
| | | private String file; |
| | | |
| | | @Value("${file.allowed}") |
| | | private String[] allowed; |
| | | |
| | | @PostConstruct |
| | | public void getFile() { |
| | | FILE_PATH = this.file; |
| | | } |
| | | |
| | | @PostConstruct |
| | | public void getAllowed(){ |
| | | ALLOWED = this.allowed; |
| | | } |
| | | /** |
| | | * å卿件䏻彿° |
| | | * @param content æä»¶äºè¿å¶æµ |
| | | * @param originalFilename æä»¶åç§° |
| | | * @param file æä»¶äºè¿å¶æµ |
| | | * @return è¿åæä»¶åç§°ç¨äºå卿°æ®åº |
| | | */ |
| | | public String StoreFile(byte[] content, String originalFilename) { |
| | | public static String StoreFile(MultipartFile file) { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | // çæéæºåç§°ï¼æ¶é´_éæº6使°å |
| | | String FileName = System.currentTimeMillis() + "_" + MyUtil.getNumber(6); |
| | | String suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); |
| | | String suffix = null; |
| | | if (originalFilename != null) { |
| | | suffix = originalFilename.substring(originalFilename.lastIndexOf(".")); |
| | | // 妿åç¼åä¸éè¿æåºå¼å¸¸ |
| | | if (!isFileAllowed(suffix)){ |
| | | throw new MyFileException(suffix); |
| | | } |
| | | } |
| | | // åç§°æ¼æ¥ |
| | | String fileName = FileName + suffix; |
| | | // è¿è¡åå¨ |
| | | storeFileWithFileName(content, fileName); |
| | | try { |
| | | storeFileWithFileName(file.getBytes(), fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | public static Boolean DeleteFile(String fileName) { |
| | | return FileSystemUtils.deleteRecursively(new File(FILE_PATH + "/" + fileName)); |
| | | } |
| | | /** |
| | | * å卿件彿° |
| | | * @param content æä»¶äºè¿å¶æµ |
| | | * @param fileName æä»¶åç§° |
| | | */ |
| | | private void storeFileWithFileName(byte[] content, String fileName) { |
| | | private static void storeFileWithFileName(byte[] content, String fileName) { |
| | | // åå¨è·¯å¾ |
| | | String path = FILE_PATH + java.io.File.separatorChar; |
| | | String path = FILE_PATH + File.separatorChar; |
| | | // ç®å½ä¸åå¨åå建 |
| | | java.io.File file = new java.io.File(path); |
| | | File file = new File(path); |
| | | if (!file.exists()) { |
| | | file.mkdirs(); |
| | | } |
| | |
| | | MyUtil.PrintLog("å卿件å¼å¸¸ï¼" + e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 夿æä»¶æ¯å¦è¢«å
许ä¸ä¼ |
| | | * |
| | | * @param fileName æä»¶å |
| | | * @return å
许true, å¦åfalse |
| | | */ |
| | | private static boolean isFileAllowed(String fileName) { |
| | | // è·ååç¼å |
| | | String suffixName = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); |
| | | for (String allow : ALLOWED) { |
| | | if (allow.equals(suffixName)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | <artifactId>standard-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.vaadin.external.google</groupId> |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private MaterialService materialService; |
| | | |
| | | @Autowired |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æé®-->1ãæ°å¢æåæ£éªå") |
| | | @PostMapping("/add_process_inspection_sheet") |
| | |
| | | @ApiImplicitParam(name = "result",value = "æ£éªç»è®º",dataTypeClass = Integer.class,required = true), |
| | | }) |
| | | @PostMapping("/inspection_conclusion") |
| | | public Result<?> inspectionConclusion(Integer finishedInspectId, Integer result){ |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(finishedInspectId, result); |
| | | public Result<?> inspectionConclusion(@RequestHeader("token") String token,Integer finishedInspectId, Integer result) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | Integer isInsertSuccess = finishedInspectService.inspectionConclusion(data.get("name").replaceAll("\"", ""),finishedInspectId, result); |
| | | if (isInsertSuccess == 1){ |
| | | return Result.success("䏿¥æåï¼"); |
| | | } |
| | |
| | | |
| | | import com.yuanchu.mom.pojo.RawInspect; |
| | | import com.yuanchu.mom.service.*; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.*; |
| | |
| | | |
| | | @ApiOperation(value = "æ°å¢æ£éªå") |
| | | @PostMapping("/addRawInspects") |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspect rawInspect) throws JSONException { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | String userName = jsonObject.getString("name"); |
| | | return Result.success(rawInspectService.addRawInspects(userName, rawInspect)); |
| | | public Result addRawInspects(@RequestHeader("token") String token, @RequestBody RawInspect rawInspect) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(rawInspectService.addRawInspects(data.get("name").replaceAll("\"", ""), rawInspect)); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date dealTime; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | /** |
| | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | |
| | | */ |
| | | private String userName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | /** |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer addProcessInspectionSheet(FinishedInspect finishedInspect); |
| | | |
| | | Integer inspectionConclusion(Integer finishedInspectId, Integer result); |
| | | Integer inspectionConclusion(String username,Integer finishedInspectId, Integer result); |
| | | |
| | | IPage<Map<String, Object>> selectFinishedInspectPage(Page<Object> page, Integer inspectResult, String inspectDate, String inspectUsername); |
| | | } |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.mapper.InspectUnacceptedMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.FinishedInspect; |
| | | import com.yuanchu.mom.mapper.FinishedInspectMapper; |
| | | import com.yuanchu.mom.pojo.InspectUnaccepted; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.service.FinishedInspectService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.service.InspectionItemService; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @Resource |
| | | InspectUnacceptedMapper inspectUnacceptedMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | @Override |
| | | public Integer addProcessInspectionSheet(FinishedInspect finishedInspect) { |
| | | finishedInspect.setType(0); |
| | | int insert = finishedInspectMapper.insert(finishedInspect); |
| | | if (insert == 1){ |
| | | if (insert == 1) { |
| | | List<Map<String, Object>> maps = productService.selectProductList(finishedInspect.getSpecificationsId()); |
| | | inspectionItemService.insertList(finishedInspect.getId(), maps); |
| | | return insert; |
| | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer inspectionConclusion(Integer finishedInspectId, Integer result) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Integer inspectionConclusion(String username, Integer finishedInspectId, Integer result) { |
| | | //æ´æ°æ£éªåéé¢çæ£éªç»è®º |
| | | LambdaUpdateWrapper<FinishedInspect> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(FinishedInspect::getId, finishedInspectId); |
| | | updateWrapper.set(FinishedInspect::getResult, result); |
| | | finishedInspectMapper.update(new FinishedInspect(), updateWrapper); |
| | | //妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå |
| | | //妿æ£éªç»è®ºä¸ºä¸åæ ¼,åéè¦æ°å¢ä¸åæ ¼æ£éªå,è¿éè¦æ°å¢åæååºå |
| | | FinishedInspect finishedInspect = finishedInspectMapper.selectById(finishedInspectId); |
| | | if (result == 0) { |
| | | /*æ°å¢ä¸åæ ¼æ£éªå*/ |
| | | InspectUnaccepted inspectUnaccepted = InspectUnaccepted.builder() |
| | | .reason(finishedInspect.getProjectName() + "ä¸åæ ¼") //æä¸å®ä¹ä¸ºå·¥ç¨åç§°ä¸åæ ¼ |
| | | .rawInspectId(finishedInspectId) |
| | | .type(finishedInspect.getType()) |
| | | .build(); |
| | | inspectUnacceptedMapper.insert(inspectUnaccepted); |
| | | /*æ°å¢åæå(1)åºå*/ |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getCode, finishedInspect.getMaterialCode()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 1); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState()==1) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡åæååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .code(finishedInspect.getMaterialCode()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(1) |
| | | .checkState(1) |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | //妿æ£éªåæ ¼,éè¦æ°å¢æå(0)åºå |
| | | if (result == 1) { |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, finishedInspect.getOrderNumber()) |
| | | .eq(Repertory::getCode, finishedInspect.getMaterialCode()) |
| | | .eq(Repertory::getName, finishedInspect.getMaterial()) |
| | | .eq(Repertory::getSpecifications, finishedInspect.getSpecificationsModel()) |
| | | .eq(Repertory::getUnit, finishedInspect.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState()==1) { |
| | | rep.setNumber(rep.getNumber() + finishedInspect.getQuantity()); |
| | | rep.setUserName(username); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = Repertory.builder() |
| | | .orderCode(finishedInspect.getOrderNumber()) |
| | | .code(finishedInspect.getMaterialCode()) |
| | | .name(finishedInspect.getMaterial()) |
| | | .specifications(finishedInspect.getSpecificationsModel()) |
| | | .unit(finishedInspect.getUnit()) |
| | | .number(finishedInspect.getQuantity()) |
| | | .userName(username) |
| | | .type(0) |
| | | .checkState(1) |
| | | .build(); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | return 1; |
| | | } |
| | |
| | | rawInsProductService.saveBatch(list); |
| | | return rawInspect.getId(); |
| | | } |
| | | |
| | | //夿æ°ç»æ¯å¦å
å«0 |
| | | private static boolean containsZero(Object[] array) { |
| | | for (Object num : array) { |
| | | if (num.equals(0)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | //夿æ°ç»æ¯å¦å
¨é¨ä¸º1 |
| | | private static boolean allOnes(Object[] array) { |
| | | for (Object num : array) { |
| | | if (!num.equals(1)) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.InspectUnacceptedMapper"> |
| | | <select id="selectUnRawInspectsList" resultType="java.util.Map"> |
| | | select DATE_FORMAT(form_time, '%Y-%m-%d') 'æ¥ææ¥æ', |
| | | select ru.id |
| | | DATE_FORMAT(form_time, '%Y-%m-%d') 'æ¥ææ¥æ', |
| | | reason, |
| | | code, |
| | | name, |
| | |
| | | DATE_FORMAT(deal_time, '%Y-%m-%d') 'å¤çæ¥æ' |
| | | from mom_ocean.raw_inspect ri inner join mom_ocean.inspect_unaccepted ru on ri.id = ru.raw_inspect_id |
| | | <where> |
| | | <if test="dealState!=null"> |
| | | <if test="dealState!=null and dealState!=''"> |
| | | and deal_state=#{dealState} |
| | | </if> |
| | | <if test="formTime!=null"> |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and form_time=#{formTime} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and ru.type=#{type} |
| | | </if> |
| | | and ru.state=1 |
| | | </where> |
| | | order by ru.id desc |
| | | </select> |
| | | <select id="selectInsList" resultType="java.util.Map"> |
| | | select DATE_FORMAT(fi.create_time, '%Y-%m-%d') 'æ¥ææ¥æ', |
| | | select ru.id |
| | | DATE_FORMAT(fi.create_time, '%Y-%m-%d') 'æ¥ææ¥æ', |
| | | reason, |
| | | material_code, |
| | | name, |
| | |
| | | mom_ocean.user u |
| | | where fi.id = ru.raw_inspect_id |
| | | and fi.user_id=u.id |
| | | <if test="dealState!=null"> |
| | | <if test="dealState!=null and dealState!=''"> |
| | | and deal_state=#{dealState} |
| | | </if> |
| | | <if test="formTime!=null"> |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and fi.create_time=#{formTime} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and ru.type=#{type} |
| | | </if> |
| | | and ru.state=1 |
| | | order by ru.id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.RawInspectMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.RawInspect"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="code" column="code" jdbcType="VARCHAR"/> |
| | |
| | | <result property="formTime" column="form_time" jdbcType="DATE"/> |
| | | </resultMap> |
| | | <select id="selectRawInspectsByLimit" resultType="com.yuanchu.mom.pojo.RawInspect"> |
| | | select id, code, name, specifications, unit, number, ins_state, judge_state, ins_time, user_name, create_time, form_time |
| | | from raw_inspect |
| | | select id, code, name, specifications, unit, number, ins_state, judge_state, ins_time, user_name, create_time, |
| | | form_time |
| | | from mom_ocean.raw_inspect |
| | | where state = 1 |
| | | <if test="formTime!=null and formTime!=''"> |
| | | and form_time = #{formTime} |
| | |
| | | <if test="judgeState!=2"> |
| | | and judge_state = #{judgeState} |
| | | </if> |
| | | order by id desc |
| | | limit #{pageSize},#{countSize} |
| | | </select> |
| | | </mapper> |
| | |
| | | <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> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ConsignmentService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Api(tags = "WMS管ç-->æååè´§") |
| | | @RestController |
| | | @RequestMapping("/consignment") |
| | | public class ConsignmentController { |
| | | |
| | | @Autowired |
| | | private ConsignmentService consignmentService; |
| | | |
| | | @Resource |
| | | SaleService saleService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æååè´§-->æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "orderNumber", value = "订åç¼å·", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @GetMapping("/selSale") |
| | | public Result selSale(String orderNumber) { |
| | | return Result.success(saleService.selSale(orderNumber)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ°å¢æååè´§") |
| | | @PostMapping("/addCon") |
| | | public Result addCon(@RequestHeader("token") String token, @RequestBody ConsignmentDto consignmentDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(consignmentService.addCon(data.get("name").replaceAll("\"", ""), consignmentDto)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢åè´§è®°å½å表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specifications", value = "产ååå·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "time", value = "åè´§æ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllCon") |
| | | public Result selectAllCon(int pageSize, int countSize, String name, String specifications, String time) { |
| | | IPage<Map<String, Object>> consignmentPage = consignmentService.selectAllCon(new Page<Object>(pageSize, countSize), name, specifications, time); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", consignmentPage.getTotal()); |
| | | map.put("row", consignmentPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | @ApiOperation(value = "æ ¹æ®åè´§idå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "åè´§id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delCon") |
| | | public Result delCon(Integer id) { |
| | | consignmentService.delCon(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllCon") |
| | | public Result delAllCon(@RequestParam("ids") List<Integer> ids) { |
| | | consignmentService.delAllCon(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | import com.yuanchu.mom.utils.JackSonUtil; |
| | | import com.yuanchu.mom.utils.Jwt; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ImportRepertoryService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | @Api(tags = "WMS管ç-->æåå
¥åº") |
| | | @RestController |
| | | @RequestMapping("/importRepertory") |
| | | public class ImportRepertoryController { |
| | | |
| | | @Autowired |
| | | private ImportRepertoryService importRepertoryService; |
| | | |
| | | @Resource |
| | | Jwt jwt; |
| | | |
| | | @ApiOperation(value = "æ°å¢æåå
¥åº") |
| | | @PostMapping("/addImpRep") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody ImportRepertoryDto importRepertoryDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | importRepertoryService.addImpRep(data.get("name").replaceAll("\"", ""), importRepertoryDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | | @ApiOperation("æ¥è¯¢ææå
¥åºå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @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 = "time", value = "å
¥åºæ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllImpRep") |
| | | public Result selectAllImpRep(int pageSize, int countSize, String orderCode, String name, String time) { |
| | | IPage<Map<String, Object>> importRepertoryPage = importRepertoryService.selectAllImpRep(new Page<Object>(pageSize, countSize), orderCode, name, time); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", importRepertoryPage.getTotal()); |
| | | map.put("row", importRepertoryPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®idæ¥çå
¥åºè¯¦æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å
¥åºid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/selectImpRepById") |
| | | public Result selectImpRepById(Integer id) { |
| | | return Result.success(importRepertoryService.getById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®å
¥åºidå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å
¥åºid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delImpRep") |
| | | public Result delImpRep(Integer id) { |
| | | importRepertoryService.delImpRep(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllImpRep") |
| | | public Result delAllImpRep(@RequestParam("ids") List<Integer> ids) { |
| | | importRepertoryService.delAllImpRep(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.ReceiptService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * åå表(Receipt)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-11 10:08:54 |
| | | */ |
| | | @Api(tags = "WMS管ç-->åå管ç") |
| | | @RestController |
| | | @RequestMapping("/receipt") |
| | | public class ReceiptController { |
| | | |
| | | @Autowired |
| | | private ReceiptService receiptService; |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ååå表") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "pageSize", value = "页æ°", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "countSize", value = "æ¡æ°/页", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "orderCode", value = "订åç¼å·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=å
¨é¨)", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "deliverTime", value = "åè´§æ¥æ", dataTypeClass = String.class) |
| | | }) |
| | | @GetMapping("/selectAllRece") |
| | | public Result selectAllRece(int pageSize, int countSize, String name, String orderCode, String type, String deliverTime) { |
| | | IPage<Map<String, Object>> receiptPage = receiptService.selectAllRece(new Page<Object>(pageSize, countSize), name, orderCode, type, deliverTime); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", receiptPage.getTotal()); |
| | | map.put("row", receiptPage.getRecords()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æ ¸é") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ååid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delRece") |
| | | public Result delRece(Integer id) { |
| | | receiptService.delRece(id); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éæ ¸é") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllRece") |
| | | public Result delAllRece(@RequestParam("ids") List<Integer> ids) { |
| | | receiptService.delAllRece(ids); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ éä»¶") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ååid", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "file", value = "ååæä»¶", dataTypeClass = MultipartFile.class, required = true) |
| | | }) |
| | | @PostMapping("/updRece") |
| | | public Result updRece(Integer id,@RequestPart MultipartFile file) { |
| | | receiptService.updRece(id, file); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥çåå") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "ååid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/selReceDatil") |
| | | public ResponseEntity<byte[]> selReceDatil(Integer id) throws IOException { |
| | | return receiptService.selReceDatil(id); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "name", value = "产ååç§°", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "specifications", value = "产ååå·", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "time", value = "å
¥åºæ¥æ", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | @ApiImplicitParam(name = "type", value = "ç±»å(为空=å
¨é¨)", dataTypeClass = Integer.class), |
| | | @ApiImplicitParam(name = "checkState", value = "æ£éªç¶æ(为空=å
¨é¨)", dataTypeClass = Integer.class) |
| | | }) |
| | | @GetMapping("/selectAllRepertory") |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type); |
| | | public Result selectAllRepertory(int pageSize, int countSize, String name, String specifications, String time, Integer type,Integer checkState) { |
| | | IPage<Map<String, Object>> repertoryPage = repertoryService.selectAllRepertory(new Page<Object>(pageSize, countSize), name, specifications, time, type,checkState); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("total", repertoryPage.getTotal()); |
| | | map.put("row", repertoryPage.getRecords()); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Consignment; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | public interface ConsignmentMapper extends BaseMapper<Consignment> { |
| | | |
| | | //æ¥è¯¢ææåè´§è®°å½ |
| | | List<Consignment> selectAll(); |
| | | |
| | | //æ¥è¯¢åè´§è®°å½å表 |
| | | IPage<Map<String, Object>> selectAllCon(Page<Object> page, String name, String specifications, String time); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | public interface ImportRepertoryMapper extends BaseMapper<ImportRepertory> { |
| | | |
| | | //æ¥è¯¢å
¥åºå表 |
| | | IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Receipt; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åå表(Receipt)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-11 10:08:54 |
| | | */ |
| | | public interface ReceiptMapper extends BaseMapper<Receipt> { |
| | | |
| | | //æ¥è¯¢ååå表 |
| | | IPage<Map<String, Object>> selectAllRece(Page<Object> page, String name, String orderCode, String type, String deliverTime); |
| | | |
| | | } |
| | | |
| | |
| | | public interface RepertoryMapper extends BaseMapper<Repertory> { |
| | | |
| | | //æ¥è¯¢ææåºåå表 |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("consignment") |
| | | public class Consignment implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * ååç¼å· |
| | | **/ |
| | | private String customerCode; |
| | | |
| | | /** |
| | | * æ¼è¿åç¼å· |
| | | **/ |
| | | private String escortCode; |
| | | |
| | | /** |
| | | * 订åç¼å· |
| | | **/ |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer number; |
| | | |
| | | /** |
| | | * ç¼å¶äººãå货人ï¼å½åç¨æ·åï¼ |
| | | **/ |
| | | private String userName; |
| | | |
| | | /** |
| | | * æ£æ¥äººå |
| | | **/ |
| | | private String checkName; |
| | | |
| | | /** |
| | | * è£
é
人å |
| | | **/ |
| | | private String fitName; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * åè´§æ¥æ |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:02 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("import_repertory") |
| | | public class ImportRepertory implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 订åç¼ç |
| | | **/ |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | private Integer number; |
| | | |
| | | /** |
| | | * å
¥åºäººï¼å½åç¨æ·åï¼ |
| | | **/ |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | | * å
¥åºæ¥æ |
| | | **/ |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | private String note; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * åå表(Receipt)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-11 10:08:55 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("receipt") |
| | | public class Receipt implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * id |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 订åç¼å· |
| | | **/ |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ååç¼å·(客æ·è®¢åå·) |
| | | **/ |
| | | private String customerCode; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | **/ |
| | | private String proname; |
| | | |
| | | /** |
| | | * å°è´§å°å |
| | | **/ |
| | | private String adress; |
| | | |
| | | /** |
| | | * å°è´§è系人 |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * ææºå· |
| | | **/ |
| | | private String phone; |
| | | |
| | | /** |
| | | * æ¼è¿åç¼å· |
| | | **/ |
| | | private String escortCode; |
| | | |
| | | /** |
| | | * åè´§æ¥æ |
| | | **/ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date deliverTime; |
| | | |
| | | /** |
| | | * å货人 |
| | | **/ |
| | | private String userName; |
| | | |
| | | /** |
| | | * ç¶æ0:å¾
åå;1:å·²åå |
| | | **/ |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * ååç
§çurl |
| | | **/ |
| | | private String url; |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | **/ |
| | | private String specifications; |
| | | |
| | | /** |
| | | * è¯éªè¦æ± |
| | | **/ |
| | | private String requirements; |
| | | |
| | | /** |
| | | * å·¥èºæä»¶ç¼å· |
| | | **/ |
| | | private String documentNumber; |
| | | |
| | | /** |
| | | * åºä½å· |
| | | **/ |
| | | private Integer seat; |
| | | |
| | | /** |
| | | * åä½ |
| | |
| | | **/ |
| | | private String userName; |
| | | |
| | | /** |
| | | * ${column.comment} |
| | | **/ |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | /** |
| | |
| | | * ç±»å 0:æå;1:åæå |
| | | **/ |
| | | private Integer type; |
| | | |
| | | /** |
| | | *æ£éªç¶æ0:æªæ£éª;1:å·²æ£éª |
| | | **/ |
| | | private Integer checkState; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @AllArgsConstructor |
| | | @Builder |
| | | public class ConsignmentDto { |
| | | |
| | | //订åç¼å· |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | //ååç¼å· |
| | | @JsonSerialize |
| | | private String customerCode; |
| | | |
| | | //客æ·åç§° |
| | | @JsonSerialize |
| | | private String proname; |
| | | |
| | | //å°è´§å°å |
| | | @JsonSerialize |
| | | private String adress; |
| | | |
| | | //æ¶è´§è系人 |
| | | @JsonSerialize |
| | | private String username; |
| | | |
| | | //ææºå· |
| | | @JsonSerialize |
| | | private String phone ; |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private List<ConsignmentDto2> messages; |
| | | |
| | | //æ£æ¥äººå |
| | | @JsonSerialize |
| | | private String checkName; |
| | | |
| | | //è£
é
人å |
| | | @JsonSerialize |
| | | private String fitName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class ImportRepertoryDto { |
| | | /** |
| | | * 订åç¼ç |
| | | **/ |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | /** |
| | | * ææç¼ç |
| | | **/ |
| | | @JsonSerialize |
| | | private String code; |
| | | |
| | | /** |
| | | * ææåç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * åå·è§æ ¼ |
| | | **/ |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | /** |
| | | * åä½ |
| | | **/ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | /** |
| | | * æ°é |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer number; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | @JsonSerialize |
| | | private String note; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | 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.Consignment; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | public interface ConsignmentService extends IService<Consignment> { |
| | | |
| | | /** |
| | | * æ°å¢æååè´§ |
| | | * @param name |
| | | * @param consignmentDto |
| | | */ |
| | | String addCon(String name, ConsignmentDto consignmentDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢åè´§è®°å½å表 |
| | | * @param page |
| | | * @param name |
| | | * @param specifications |
| | | * @param time |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllCon(Page<Object> page, String name, String specifications, String time); |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤ |
| | | * @param id |
| | | */ |
| | | void delCon(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllCon(List<Integer> ids); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | 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.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | public interface ImportRepertoryService extends IService<ImportRepertory> { |
| | | |
| | | //æ°å¢æåå
¥åº |
| | | void addImpRep(String name, ImportRepertoryDto importRepertoryDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¥åºå表 |
| | | * @param page |
| | | * @param orderCode |
| | | * @param name |
| | | * @param time |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time); |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤ |
| | | * @param id |
| | | */ |
| | | void delImpRep(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllImpRep(List<Integer> ids); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | 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.Receipt; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åå表(Receipt)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-11 10:08:54 |
| | | */ |
| | | public interface ReceiptService extends IService<Receipt> { |
| | | |
| | | /** |
| | | * æ¥è¯¢ååå表 |
| | | * @param page |
| | | * @param name |
| | | * @param orderCode |
| | | * @param type |
| | | * @param deliverTime |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllRece(Page<Object> page, String name, String orderCode, String type, String deliverTime); |
| | | |
| | | /** |
| | | * æ ¹æ®ååidå é¤ |
| | | * @param id |
| | | */ |
| | | void delRece(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllRece(List<Integer> ids); |
| | | |
| | | /** |
| | | * æ ¹æ®idä¿®æ¹ç¶æ |
| | | * @param id |
| | | */ |
| | | void updRece(Integer id, MultipartFile file); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥çåå |
| | | * @param id |
| | | */ |
| | | ResponseEntity<byte[]> selReceDatil(Integer id) throws IOException; |
| | | |
| | | } |
| | | |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type); |
| | | IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type,Integer checkState); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.ConsignmentMapper; |
| | | import com.yuanchu.mom.mapper.ReceiptMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.Consignment; |
| | | import com.yuanchu.mom.pojo.Receipt; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto2; |
| | | import com.yuanchu.mom.service.ConsignmentService; |
| | | import com.yuanchu.mom.utils.MyUtil; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå货表(Consignment)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 15:08:02 |
| | | */ |
| | | @Service |
| | | public class ConsignmentServiceImpl extends ServiceImpl<ConsignmentMapper, Consignment> implements ConsignmentService { |
| | | |
| | | @Resource |
| | | ConsignmentMapper consignmentMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | @Resource |
| | | ReceiptMapper receiptMapper; |
| | | |
| | | //æ°å¢æååè´§ |
| | | @Override |
| | | public String addCon(String name, ConsignmentDto consignmentDto) { |
| | | //çæä¸ä¸ªæ¼è¿åç¼å· |
| | | String escortCode = MyUtil.getTimeSixNumberCode("YY"); |
| | | //å¦æè¯¥è®¢åå·²ç»åè¿è´§äºä¸è½ååè´§ |
| | | List<Consignment> consignments = consignmentMapper.selectAll(); |
| | | //å¦ææ²¡æåè´§è¡¨ä¸æ²¡ææ°æ®ä¹å¯ä»¥åè´§ |
| | | if (consignments.size()==0) { |
| | | /*æ°å¢æååè´§*/ |
| | | String mes1 = addConsign(name, consignmentDto, escortCode); |
| | | return mes1; |
| | | } else { |
| | | for (Consignment consignment : consignments) { |
| | | if (consignment.getCustomerCode().equals(consignmentDto.getCustomerCode())) { |
| | | return "该åå订åå·²åè¿è´§,æ æ³å次åè´§!"; |
| | | } else { |
| | | /*æ°å¢æååè´§*/ |
| | | String mes2 = addConsign(name, consignmentDto, escortCode); |
| | | return mes2; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | //æ¥è¯¢åè´§è®°å½å表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllCon(Page<Object> page, String name, String specifications, String time) { |
| | | return consignmentMapper.selectAllCon(page, name, specifications, time); |
| | | } |
| | | |
| | | //æ ¹æ®idå é¤ |
| | | @Override |
| | | public void delCon(Integer id) { |
| | | //å é¤åè´§è®°å½ |
| | | Consignment consignment = consignmentMapper.selectById(id); |
| | | consignment.setState(0); |
| | | consignmentMapper.updateById(consignment); |
| | | //åºåä¹è¦æ°å¢ |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getCode, consignment.getCode()) |
| | | .eq(Repertory::getName, consignment.getName()) |
| | | .eq(Repertory::getSpecifications, consignment.getSpecifications()) |
| | | .eq(Repertory::getUnit, consignment.getUnit()) |
| | | .eq(Repertory::getType, 0) //æååè´§ |
| | | .eq(Repertory::getCheckState, 1); //åªæå·²æ£éªæè½åè´§ |
| | | Repertory repertory = repertoryMapper.selectOne(queryWrapper); |
| | | repertory.setNumber(repertory.getNumber() + consignment.getNumber()); |
| | | repertoryMapper.updateById(repertory); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllCon(List<Integer> ids) { |
| | | List<Consignment> consignments = consignmentMapper.selectBatchIds(ids); |
| | | for (Consignment consignment : consignments) { |
| | | consignment.setState(0); |
| | | //å é¤åè´§è®°å½ |
| | | consignmentMapper.updateById(consignment); |
| | | //åºåæ°å¢ |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getCode, consignment.getCode()) |
| | | .eq(Repertory::getName, consignment.getName()) |
| | | .eq(Repertory::getSpecifications, consignment.getSpecifications()) |
| | | .eq(Repertory::getUnit, consignment.getUnit()) |
| | | .eq(Repertory::getType, 0) //æååè´§ |
| | | .eq(Repertory::getCheckState, 1); //åªæå·²æ£éªæè½åè´§ |
| | | Repertory repertory = repertoryMapper.selectOne(queryWrapper); |
| | | repertory.setNumber(repertory.getNumber() + consignment.getNumber()); |
| | | repertoryMapper.updateById(repertory); |
| | | } |
| | | } |
| | | |
| | | |
| | | //æ°å¢åè´§ä¸ç³»åæä½ |
| | | private String addConsign(String name, ConsignmentDto consignmentDto, String escortCode) { |
| | | /*æ°å¢æååè´§*/ |
| | | List<ConsignmentDto2> messages = consignmentDto.getMessages(); |
| | | for (ConsignmentDto2 message : messages) { |
| | | //æ¥è¯¢äº§åç¼ç (éè¿å¨æååºå表ä¸ç产ååç§°,è§æ ¼åå·ä»¥ååä½è¿è¡æ¥æ¾) |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getName, message.getName()) |
| | | .eq(Repertory::getSpecifications, message.getSpecifications()) |
| | | .eq(Repertory::getUnit, message.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory repertory = repertoryMapper.selectOne(queryWrapper); |
| | | //该æåçæ£éªç¶ææ¯å·²æ£éª1æè½è¿è¡åè´§ |
| | | if (repertory.getCheckState() == 1) { |
| | | //该æååºåçæ°é大äºçäºåè´§çæ°éæè½è¿è¡åè´§ |
| | | if (repertory.getNumber() >= message.getNumber()) { |
| | | //æé æååè´§å®ä½ç±» |
| | | Consignment consig = Consignment.builder() |
| | | .customerCode(consignmentDto.getCustomerCode()) |
| | | .escortCode(escortCode) |
| | | .orderCode(consignmentDto.getOrderCode()) |
| | | .userName(name) |
| | | .checkName(consignmentDto.getCheckName()) |
| | | .fitName(consignmentDto.getFitName()) |
| | | .name(message.getName()) |
| | | .specifications(message.getSpecifications()) |
| | | .unit(message.getUnit()) |
| | | .number(message.getNumber()) |
| | | .code(repertory.getCode()) |
| | | .build(); |
| | | consignmentMapper.insert(consig); |
| | | /*åå°å¯¹åºçåºå*/ |
| | | repertory.setNumber(repertory.getNumber() - consig.getNumber()); |
| | | repertoryMapper.updateById(repertory); |
| | | } else return "åºåä¸è¶³,æ æ³åè´§!"; |
| | | } else return "该产åè¿æªæ£éª,ä¸è½åè´§!"; |
| | | } |
| | | /*åè´§æåä¹åéè¦æ°å¢ä¸å¼ åå*/ |
| | | Receipt receipt = new Receipt(); |
| | | BeanUtils.copyProperties(consignmentDto, receipt); |
| | | receipt.setName(consignmentDto.getUsername());//æ¶è´§è系人 |
| | | receipt.setUserName(name);//å货人 |
| | | receipt.setEscortCode(escortCode);//æ¼è¿åç¼å· |
| | | receipt.setDeliverTime(new Date());//åè´§æ¥æ |
| | | receiptMapper.insert(receipt); |
| | | return "åè´§æå!"; |
| | | } |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.ImportRepertoryMapper; |
| | | import com.yuanchu.mom.mapper.RepertoryMapper; |
| | | import com.yuanchu.mom.pojo.ImportRepertory; |
| | | import com.yuanchu.mom.pojo.Repertory; |
| | | import com.yuanchu.mom.pojo.dto.ImportRepertoryDto; |
| | | import com.yuanchu.mom.service.ImportRepertoryService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æåå
¥åºè¡¨(ImportRepertory)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-10 10:27:01 |
| | | */ |
| | | @Service |
| | | public class ImportRepertoryServiceImpl extends ServiceImpl<ImportRepertoryMapper, ImportRepertory> implements ImportRepertoryService { |
| | | |
| | | @Resource |
| | | ImportRepertoryMapper importRepertoryMapper; |
| | | |
| | | @Resource |
| | | RepertoryMapper repertoryMapper; |
| | | |
| | | //æ°å¢æåå
¥åº |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addImpRep(String name, ImportRepertoryDto importRepertoryDto) { |
| | | //æ°å¢æåå
¥åº |
| | | ImportRepertory importRepertory = new ImportRepertory(); |
| | | BeanUtils.copyProperties(importRepertoryDto, importRepertory); |
| | | importRepertory.setUserName(name); |
| | | importRepertoryMapper.insert(importRepertory); |
| | | //æ°å¢æååºå |
| | | //妿å
¥åºçä¿¡æ¯ä¸æ ·åªæåºåä¸ä¸æ ·,åå¨åæ¥çåºåæ°éä¸å ä¸ç¸åºçæ°é |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertoryDto.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertoryDto.getCode()) |
| | | .eq(Repertory::getName, importRepertoryDto.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertoryDto.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertoryDto.getUnit()) |
| | | .eq(Repertory::getType, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | if (rep != null && rep.getCheckState() == 0) { |
| | | rep.setNumber(rep.getNumber() + importRepertoryDto.getNumber()); |
| | | rep.setUserName(name); |
| | | repertoryMapper.updateById(rep); |
| | | } else { |
| | | //妿é¤äºåºåå«çä¿¡æ¯æä»»ä½ä¸ä¸ªä¸ä¸æ ·,åæ°å¢ä¸æ¡æååºå |
| | | Repertory repertory = new Repertory(); |
| | | BeanUtils.copyProperties(importRepertoryDto, repertory); |
| | | repertory.setUserName(name); |
| | | repertory.setType(0); |
| | | repertory.setCheckState(0); |
| | | repertoryMapper.insert(repertory); |
| | | } |
| | | } |
| | | |
| | | //æ¥è¯¢å
¥åºå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllImpRep(Page<Object> page, String orderCode, String name, String time) { |
| | | return importRepertoryMapper.selectAllImpRep(page, orderCode, name, time); |
| | | } |
| | | |
| | | //æ ¹æ®idå é¤ |
| | | @Override |
| | | public void delImpRep(Integer id) { |
| | | //å é¤å
¥åºè®°å½ |
| | | ImportRepertory importRepertory = importRepertoryMapper.selectById(id); |
| | | importRepertory.setState(0); |
| | | importRepertoryMapper.updateById(importRepertory); |
| | | //åºåä¹è¦åå° |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertory.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertory.getCode()) |
| | | .eq(Repertory::getName, importRepertory.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertory.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertory.getUnit()) |
| | | .eq(Repertory::getType, 0) |
| | | .eq(Repertory::getCheckState, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | rep.setNumber(rep.getNumber() - importRepertory.getNumber()); |
| | | repertoryMapper.updateById(rep); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllImpRep(List<Integer> ids) { |
| | | List<ImportRepertory> importRepertories = importRepertoryMapper.selectBatchIds(ids); |
| | | for (ImportRepertory importRepertory : importRepertories) { |
| | | importRepertory.setState(0); |
| | | //å é¤å
¥åºè®°å½ |
| | | importRepertoryMapper.updateById(importRepertory); |
| | | //åå°åºå |
| | | LambdaQueryWrapper<Repertory> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Repertory::getOrderCode, importRepertory.getOrderCode()) |
| | | .eq(Repertory::getCode, importRepertory.getCode()) |
| | | .eq(Repertory::getName, importRepertory.getName()) |
| | | .eq(Repertory::getSpecifications, importRepertory.getSpecifications()) |
| | | .eq(Repertory::getUnit, importRepertory.getUnit()) |
| | | .eq(Repertory::getType, 0) |
| | | .eq(Repertory::getCheckState, 0); |
| | | Repertory rep = repertoryMapper.selectOne(queryWrapper); |
| | | rep.setNumber(rep.getNumber() - importRepertory.getNumber()); |
| | | repertoryMapper.updateById(rep); |
| | | } |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.ReceiptMapper; |
| | | import com.yuanchu.mom.pojo.Receipt; |
| | | import com.yuanchu.mom.service.ReceiptService; |
| | | import com.yuanchu.mom.utils.FileSaveUtil; |
| | | import io.swagger.models.Response; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springframework.core.io.FileSystemResource; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.nio.file.Files; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åå表(Receipt)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-11 10:08:55 |
| | | */ |
| | | @Service |
| | | public class ReceiptServiceImpl extends ServiceImpl<ReceiptMapper, Receipt> implements ReceiptService { |
| | | |
| | | @Resource |
| | | ReceiptMapper receiptMapper; |
| | | |
| | | //æ¥è¯¢ååå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllRece(Page<Object> page, String name, String orderCode, String type, String deliverTime) { |
| | | return receiptMapper.selectAllRece(page, name, orderCode, type, deliverTime); |
| | | } |
| | | |
| | | //æ ¹æ®idå é¤ |
| | | @Override |
| | | public void delRece(Integer id) { |
| | | Receipt receipt = receiptMapper.selectById(id); |
| | | receipt.setState(0); |
| | | receiptMapper.updateById(receipt); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllRece(List<Integer> ids) { |
| | | List<Receipt> receipts = receiptMapper.selectBatchIds(ids); |
| | | for (Receipt receipt : receipts) { |
| | | receipt.setState(0); |
| | | receiptMapper.updateById(receipt); |
| | | } |
| | | } |
| | | |
| | | //ä¸ä¼ éä»¶ä¿®æ¹ç¶æ |
| | | @Override |
| | | public void updRece(Integer id, MultipartFile file) { |
| | | if (ObjectUtils.isNotEmpty(file)) { |
| | | Receipt receipt = receiptMapper.selectById(id); |
| | | receipt.setUrl(FileSaveUtil.StoreFile(file)); |
| | | receipt.setType(1); |
| | | receiptMapper.updateById(receipt); |
| | | } |
| | | } |
| | | |
| | | //æ ¹æ®idæ¥çååç
§ç |
| | | @Override |
| | | public ResponseEntity<byte[]> selReceDatil(Integer id) throws IOException { |
| | | String url = receiptMapper.selectById(id).getUrl(); |
| | | String path = "D:\\webapp\\images\\" + url; |
| | | //è·åå¾çæ ¼å¼åç¼å |
| | | String extension = getImageExtension(url); |
| | | // è¯»åæ¬å°å¾çæä»¶ï¼å¹¶å°å
¶è½¬æ¢ä¸ºåèæ°ç» |
| | | FileSystemResource imageResource = new FileSystemResource(path); |
| | | byte[] bytes = Files.readAllBytes(imageResource.getFile().toPath()); |
| | | // 设置HTTP头信æ¯ï¼åè¯æµè§å¨è¿åçæ¯å¾çæ°æ® |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(new MediaType("image", extension)); |
| | | return new ResponseEntity<>(bytes, headers, HttpStatus.OK); |
| | | } |
| | | |
| | | private String getImageExtension(String imageName) { |
| | | // æ ¹æ®å¾çæä»¶åè·åæ©å±å |
| | | int dotIndex = imageName.lastIndexOf('.'); |
| | | if (dotIndex > 0 && dotIndex < imageName.length() - 1) { |
| | | return imageName.substring(dotIndex + 1); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | //æ¥è¯¢ææåºåå表 |
| | | @Override |
| | | public IPage<Map<String, Object>> selectAllRepertory(Page<Object> page, String name, String specifications, String time, Integer type) { |
| | | return repertoryMapper.selectAllRepertory(page,name,specifications,time,type); |
| | | 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); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.ConsignmentMapper"> |
| | | <select id="selectAll" resultType="com.yuanchu.mom.pojo.Consignment"> |
| | | select * |
| | | from mom_ocean.consignment |
| | | where state = 1 |
| | | </select> |
| | | <select id="selectAllCon" resultType="java.util.Map"> |
| | | select id, |
| | | name, |
| | | specifications, |
| | | code, |
| | | customer_code, |
| | | unit, |
| | | number, |
| | | check_name, |
| | | fit_name, |
| | | user_name |
| | | from mom_ocean.consignment |
| | | where state=1 |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="specifications!=null and specifications!=''"> |
| | | and specifications like concat('%',#{specifications},'%') |
| | | </if> |
| | | <if test="time!=null and time!=''"> |
| | | and DATE_FORMAT(create_time, '%Y-%m-%d')=#{time} |
| | | </if> |
| | | order by id desc |
| | | </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.ImportRepertoryMapper"> |
| | | <select id="selectAllImpRep" resultType="java.util.Map"> |
| | | select id, |
| | | order_code, |
| | | code, |
| | | name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | user_name, |
| | | create_time |
| | | from mom_ocean.import_repertory |
| | | where state=1 |
| | | <if test="orderCode!=null and orderCode!=''"> |
| | | and order_code like concat('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="time!=null and time!=''"> |
| | | and create_time=#{time} |
| | | </if> |
| | | order by id desc |
| | | </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.ReceiptMapper"> |
| | | <select id="selectAllRece" resultType="java.util.Map"> |
| | | select id, |
| | | order_code, |
| | | customer_code, |
| | | proname, |
| | | adress, |
| | | name, |
| | | phone, |
| | | escort_code, |
| | | DATE_FORMAT(deliver_time,'%Y-%m-%d'), |
| | | user_name, |
| | | type |
| | | from mom_ocean.receipt |
| | | where state=1 |
| | | <if test="name!=null and name!=''"> |
| | | and name like concat('%',#{name},'%') |
| | | </if> |
| | | <if test="orderCode!=null and orderCode!=''"> |
| | | and order_code like concat('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="deliverTime!=null and deliverTime!=''"> |
| | | and deliver_time=#{deliverTime} |
| | | </if> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.RepertoryMapper"> |
| | | <select id="selectAllRepertory" resultType="java.util.Map"> |
| | | select name, |
| | | select id, |
| | | name, |
| | | specifications, |
| | | code, |
| | | requirements, |
| | | order_code, |
| | | seat, |
| | | check_state, |
| | | user_name, |
| | | DATE_FORMAT(create_time, '%Y-%m-%d') 'å
¥åºæ¥æ', |
| | | note |
| | | from mom_ocean.repertory |
| | | <where> |
| | | and state=1 |
| | | <if test="name!=null"> |
| | | and name =#{name} |
| | | <if test="name!=null and name!=''"> |
| | | and name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="specifications!=null "> |
| | | and specifications=#{specifications} |
| | | <if test="specifications!=null and specifications!=''"> |
| | | and specifications LIKE CONCAT('%',#{specifications},'%') |
| | | </if> |
| | | <if test="time!=null "> |
| | | <if test="time!=null and time!=''"> |
| | | and create_time=#{time} |
| | | </if> |
| | | <if test="type!=null"> |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="checkState!=null and checkState!=''"> |
| | | and check_state=#{checkState} |
| | | </if> |
| | | order by id desc |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | <artifactId>standard-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>user-server</artifactId> |
| | |
| | | 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.utils.JackSonUtil; |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | | import com.yuanchu.mom.pojo.dto.SaleDto; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.lang.reflect.Array; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | @ApiOperation(value = "æ°å¢éå®å") |
| | | @PostMapping("/addSale") |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody SaleDto saleDto) throws JSONException { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | String saleman = jsonObject.getString("name"); |
| | | saleService.addSale(saleman, saleDto); |
| | | public Result addSale(@RequestHeader("token") String token, @RequestBody SaleDto saleDto) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.addSale(data.get("name").replaceAll("\"", ""), saleDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "id", value = "éå®åid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/updateSaleById") |
| | | public Result updateSaleById(@RequestHeader("token") String token, Integer id, @RequestBody SaleVo saleVo) throws JSONException { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | String saleman = jsonObject.getString("name"); |
| | | saleService.updateSaleById(saleman,id, saleVo); |
| | | public Result updateSaleById(@RequestHeader("token") String token, Integer id, @RequestBody SaleVo saleVo) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.updateSaleById(data.get("name").replaceAll("\"", ""),id, saleVo); |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "éå®åid", dataTypeClass = String.class, dataType = "List", required = true) |
| | | @ApiImplicitParam(name = "ids", value = "ids", dataTypeClass = Integer.class, dataType = "List",required = true) |
| | | }) |
| | | @PostMapping("/delAllSale") |
| | | public Result delAllSale( List<Integer> ids) { |
| | | public Result delAllSale( @RequestParam("ids") List<Integer> ids) { |
| | | saleService.delAllSale(ids); |
| | | return Result.success(); |
| | | } |
| | |
| | | @ApiImplicitParam(name = "type", value = "ç¶æ", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/check") |
| | | public Result check(@RequestHeader("token") String token,Integer id,Integer type) throws JSONException { |
| | | Map<String, String> map = jwt.readJWT(token); |
| | | String data = map.get("data"); |
| | | JSONObject jsonObject = new JSONObject(data); |
| | | String checkname = jsonObject.getString("name"); |
| | | saleService.check(checkname,id,type); |
| | | public Result check(@RequestHeader("token") String token,Integer id,Integer type) throws Exception { |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | saleService.check(data.get("name").replaceAll("\"", ""),id,type); |
| | | return Result.success("å®¡æ ¸æå"); |
| | | } |
| | | |
| | |
| | | |
| | | //æ¥è¯¢éå®åå表 |
| | | IPage<Map<String, Object>> selectSaleList(Page<Object> page, String orderNumber, String name, Integer type, String delTime); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | private Date checkTime; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | |
| | | @ApiModelProperty(value = "åä»·") |
| | | private String price; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @Builder |
| | | public class ConsignmentDto1 { |
| | | |
| | | //订åç¼å· |
| | | @JsonSerialize |
| | | private String orderCode; |
| | | |
| | | //ååç¼å· |
| | | @JsonSerialize |
| | | private String customerCode; |
| | | |
| | | //客æ·åç§° |
| | | @JsonSerialize |
| | | private String proname; |
| | | |
| | | //å°è´§å°å |
| | | @JsonSerialize |
| | | private String adress; |
| | | |
| | | //æ¶è´§è系人 |
| | | @JsonSerialize |
| | | private String username; |
| | | |
| | | //ææºå· |
| | | @JsonSerialize |
| | | private String phone ; |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private List<ConsignmentDto2> messages; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | public class ConsignmentDto2 { |
| | | |
| | | //产åä¿¡æ¯ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //è§æ ¼åå· |
| | | @JsonSerialize |
| | | private String specifications; |
| | | |
| | | //åä½ |
| | | @JsonSerialize |
| | | private String unit; |
| | | |
| | | //åè´§æ°é |
| | | @JsonSerialize |
| | | private Integer number; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.Sale; |
| | | 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 org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @param id |
| | | */ |
| | | void check(String checkname,Integer id,Integer type); |
| | | |
| | | /** |
| | | *æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯ |
| | | * @param orderNumber |
| | | * @return |
| | | */ |
| | | ConsignmentDto1 selSale(String orderNumber); |
| | | } |
| | |
| | | import com.yuanchu.mom.pojo.Sale; |
| | | import com.yuanchu.mom.mapper.SaleMapper; |
| | | import com.yuanchu.mom.pojo.SaleMaterial; |
| | | import com.yuanchu.mom.pojo.dto.ConsignmentDto1; |
| | | 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.service.SaleMaterialService; |
| | | import com.yuanchu.mom.service.SaleService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | sale.setCheckTime(new Date()); |
| | | saleMapper.updateById(sale); |
| | | } |
| | | |
| | | //æ ¹æ®è®¢åå·æ¥è¯¢éå®ä¿¡æ¯ |
| | | @Override |
| | | public ConsignmentDto1 selSale(String orderNumber) { |
| | | Sale sale = saleMapper.selectOne(Wrappers.<Sale>query().eq("order_number", orderNumber)); |
| | | List<SaleMaterial> saleMaterials = saleMaterialMapper.selectList(Wrappers.<SaleMaterial>query().eq("sale_id", sale.getId())); |
| | | List<ConsignmentDto2> dto2List = saleMaterials.stream().map(saleMaterial -> { |
| | | ConsignmentDto2 consignmentDto2 = new ConsignmentDto2(); |
| | | BeanUtils.copyProperties(saleMaterial, consignmentDto2); |
| | | return consignmentDto2; |
| | | }).collect(Collectors.toList()); |
| | | ConsignmentDto1 consignmentDto1 = ConsignmentDto1.builder() |
| | | .orderCode(orderNumber) |
| | | .customerCode(sale.getCode()) |
| | | .proname(sale.getProname()) |
| | | .adress(sale.getAdress()) |
| | | .username(sale.getUsername()) |
| | | .phone(sale.getPhone()) |
| | | .messages(dto2List) |
| | | .build(); |
| | | return consignmentDto1; |
| | | } |
| | | } |
| | |
| | | <!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 order_number, |
| | | 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 order_number=#{orderNumber} |
| | | </if> |
| | | <if test="name!=null"> |
| | | and name=#{name} |
| | | </if> |
| | | <if test="type!=null"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="delTime!=null"> |
| | | and DATE_FORMAT(delTime, '%Y-%m-%d')=#{delTime} |
| | | </if> |
| | | </where> |
| | | 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> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.yuanchu.mom.mapper.SaleMaterialMapper"> |
| | | <select id="selectSaleDatil" resultType="com.yuanchu.mom.pojo.SaleMaterial"> |
| | | select id, name, specifications, unit, number, price, state, create_time, update_time, sale_id |
| | | select id, |
| | | name, |
| | | specifications, |
| | | unit, |
| | | number, |
| | | price, |
| | | state, |
| | | create_time, |
| | | update_time, |
| | | sale_id |
| | | from mom_ocean.sale_material |
| | | where state=1 |
| | | <if test="id!=null"> |
| | | and sale_id=#{id} |
| | | </if> |
| | | where state = 1 |
| | | and sale_id = #{id} |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto; |
| | | import com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1; |
| | | 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.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.TechnologyTemplateService; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * å·¥èºæ¨¡ç表(TechnologyTemplate)表æ§å¶å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-09 11:20:20 |
| | | */ |
| | | @Api(tags = "åºç¡æ°æ®-->å·¥åº") |
| | | @RestController |
| | | @RequestMapping("/technologyTemplate") |
| | | public class TechnologyTemplateController { |
| | | |
| | | @Autowired |
| | | private TechnologyTemplateService technologyTemplateService; |
| | | |
| | | @ApiOperation(value = "æ°å¢å·¥åºæ¨¡ç") |
| | | @PostMapping("/addTech") |
| | | public Result addTech(@RequestBody TechnologyTemplateDto technologyTemplateDto){ |
| | | technologyTemplateService.addTech(technologyTemplateDto); |
| | | return Result.success("æ°å¢æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢ææç±»å") |
| | | @GetMapping("/seleType") |
| | | public Result seleType(){ |
| | | return Result.success(technologyTemplateService.seleType()); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å·¥åºæ¨¡çå表(äºçº§æ )") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "element", value = "å
ä»¶", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "father", value = "å·¥åº(ç¶ç±»)", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "type", value = "ç±»å", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/selTech") |
| | | public Result selTech(String element,String father,Integer type){ |
| | | List<TechnologyTemplateVo1> map = technologyTemplateService.selTech(element, father, type); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¥è¯¢å·¥åºæ¨¡ç详æ
") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥åºid", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @GetMapping("/selTechById") |
| | | public Result selTechById(Integer id){ |
| | | return Result.success(technologyTemplateService.selTechById(id)); |
| | | } |
| | | |
| | | @ApiOperation(value = "ç¼è¾") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥åºid", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/updaTechById") |
| | | public Result updaTechById(Integer id,@RequestBody TechnologyTemplateDto technologyTemplateDto){ |
| | | technologyTemplateService.updaTechById(id,technologyTemplateDto); |
| | | return Result.success("ä¿®æ¹æå!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ ¹æ®éå®åidå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "å·¥åºid", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delTech") |
| | | public Result delTech(Integer id) { |
| | | technologyTemplateService.delTech(id); |
| | | return Result.success("å 餿å!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "æ¹éå é¤") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "éå®åid", dataTypeClass = Integer.class, dataType = "List", required = true) |
| | | }) |
| | | @PostMapping("/delAllTech") |
| | | public Result delAllTech(@RequestParam("ids") List<Integer> ids) { |
| | | technologyTemplateService.delAllTech(ids); |
| | | return Result.success("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.pojo.TechnologyTemplate; |
| | | import com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å·¥èºæ¨¡ç表(TechnologyTemplate)è¡¨æ°æ®åºè®¿é®å± |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-09 11:20:20 |
| | | */ |
| | | public interface TechnologyTemplateMapper extends BaseMapper<TechnologyTemplate> { |
| | | |
| | | |
| | | //æ¥è¯¢ææç±»å |
| | | List<Integer> seleType(); |
| | | |
| | | //æ¥è¯¢å·¥åºæ¨¡çå表 |
| | | List<TechnologyTemplateVo1> selTech(String element, String father, Integer type); |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | **/ |
| | | private Integer testState; |
| | | |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | @TableLogic(value = "1", delval = "0") |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.*; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * å·¥èºæ¨¡ç表(TechnologyTemplate)表å®ä½ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-09 11:20:20 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Builder |
| | | @TableName("technology_template") |
| | | public class TechnologyTemplate implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * å·¥åºid |
| | | **/ |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | /** |
| | | * å·¥åºåç§° |
| | | **/ |
| | | private String name; |
| | | |
| | | /** |
| | | * å·¥åºç¶çº§ |
| | | **/ |
| | | private String father; |
| | | |
| | | /** |
| | | * 0ï¼æ©¡è¶è¿æ¥å¨ï¼1ï¼éå±è¿æ¥å¨ï¼2ï¼æ¹¿ææçµè¿æ¥å¨ï¼3ï¼åæ¯ç»ä»¶ |
| | | **/ |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "é»è¾å é¤ æ£å¸¸>=1,å é¤<=0", hidden = true) |
| | | private Integer state; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value = "å建æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date createTime; |
| | | |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´", hidden = true) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * å
ä»¶ |
| | | **/ |
| | | private String element; |
| | | |
| | | /** |
| | | * æ§å¶è¦ç¹ |
| | | **/ |
| | | private String control; |
| | | |
| | | /** |
| | | * åºæ¬è¦æ± |
| | | **/ |
| | | private String base; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | private String note; |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.dto; |
| | | |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.*; |
| | | import java.io.Serializable; |
| | | |
| | | |
| | | |
| | | @Data |
| | | @JsonSerialize |
| | | //æ°å¢æè
ä¿®æ¹å·¥åºæ¨¡ç |
| | | public class TechnologyTemplateDto { |
| | | |
| | | /** |
| | | * å·¥åºåç§° |
| | | **/ |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | /** |
| | | * å·¥åºç¶çº§ |
| | | **/ |
| | | @JsonSerialize |
| | | private String father; |
| | | |
| | | /** |
| | | * 0ï¼æ©¡è¶è¿æ¥å¨ï¼1ï¼éå±è¿æ¥å¨ï¼2ï¼æ¹¿ææçµè¿æ¥å¨ï¼3ï¼åæ¯ç»ä»¶ |
| | | **/ |
| | | @JsonSerialize |
| | | private Integer type; |
| | | |
| | | /** |
| | | * å
ä»¶ |
| | | **/ |
| | | @JsonSerialize |
| | | private String element; |
| | | |
| | | /** |
| | | * æ§å¶è¦ç¹ |
| | | **/ |
| | | @JsonSerialize |
| | | private String control; |
| | | |
| | | /** |
| | | * åºæ¬è¦æ± |
| | | **/ |
| | | @JsonSerialize |
| | | private String base; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | **/ |
| | | @JsonSerialize |
| | | private String note; |
| | | |
| | | |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.vo; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ProductDto2; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class TechnologyTemplateVo1 { |
| | | |
| | | /** |
| | | * 项ç®åç§° |
| | | */ |
| | | private String father; |
| | | |
| | | List<TechnologyTemplateVo2> children; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.pojo.vo; |
| | | |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TechnologyTemplateVo2 { |
| | | |
| | | @JsonSerialize |
| | | private Integer id; |
| | | |
| | | //å·¥åºåç§° |
| | | @JsonSerialize |
| | | private String name; |
| | | |
| | | //å
ä»¶ |
| | | @JsonSerialize |
| | | private String element; |
| | | |
| | | //åºæ¬è¦æ± |
| | | @JsonSerialize |
| | | private String base; |
| | | |
| | | //æ§å¶è¦ç¹ |
| | | @JsonSerialize |
| | | private String control; |
| | | |
| | | //夿³¨ |
| | | @JsonSerialize |
| | | private String note; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service; |
| | | |
| | | 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.TechnologyTemplate; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto; |
| | | import com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * å·¥èºæ¨¡ç表(TechnologyTemplate)表æå¡æ¥å£ |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-09 11:20:20 |
| | | */ |
| | | public interface TechnologyTemplateService extends IService<TechnologyTemplate> { |
| | | |
| | | |
| | | /** |
| | | * æ°å¢å·¥åºæ¨¡ç |
| | | * @param technologyTemplateDto |
| | | */ |
| | | void addTech(TechnologyTemplateDto technologyTemplateDto); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææç±»å |
| | | * @return |
| | | */ |
| | | List<Integer> seleType(); |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥åºæ¨¡çå表 |
| | | * @param page |
| | | * @param element |
| | | * @param father |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<TechnologyTemplateVo1> selTech(String element, String father, Integer type); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | * @param id |
| | | * @return |
| | | */ |
| | | TechnologyTemplateDto selTechById(Integer id); |
| | | |
| | | /** |
| | | * æ ¹æ®idä¿®æ¹ |
| | | * @param id |
| | | * @param technologyTemplateDto |
| | | */ |
| | | void updaTechById(Integer id, TechnologyTemplateDto technologyTemplateDto); |
| | | |
| | | /** |
| | | * æ ¹æ®idå é¤ |
| | | * @param id |
| | | */ |
| | | void delTech(Integer id); |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * @param ids |
| | | */ |
| | | void delAllTech(List<Integer> ids); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.yuanchu.mom.mapper.TechnologyTemplateMapper; |
| | | import com.yuanchu.mom.pojo.TechnologyTemplate; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyTemplateDto; |
| | | import com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1; |
| | | import com.yuanchu.mom.service.TechnologyTemplateService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * å·¥èºæ¨¡ç表(TechnologyTemplate)表æå¡å®ç°ç±» |
| | | * |
| | | * @author zss |
| | | * @since 2023-08-09 11:20:20 |
| | | */ |
| | | @Service |
| | | public class TechnologyTemplateServiceImpl extends ServiceImpl<TechnologyTemplateMapper, TechnologyTemplate> implements TechnologyTemplateService { |
| | | |
| | | |
| | | @Resource |
| | | TechnologyTemplateMapper technologyTemplateMapper; |
| | | |
| | | //æ°å¢å·¥åºæ¨¡ç |
| | | @Override |
| | | public void addTech(TechnologyTemplateDto technologyTemplateDto) { |
| | | TechnologyTemplate technologyTemplate = new TechnologyTemplate(); |
| | | BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate); |
| | | technologyTemplateMapper.insert(technologyTemplate); |
| | | } |
| | | |
| | | //æ¥è¯¢ææç±»å |
| | | @Override |
| | | public List<Integer> seleType() { |
| | | return technologyTemplateMapper.seleType(); |
| | | } |
| | | |
| | | //æ¥è¯¢å·¥åºæ¨¡çå表 |
| | | @Override |
| | | public List<TechnologyTemplateVo1> selTech( String element, String father, Integer type) { |
| | | return technologyTemplateMapper.selTech(element,father,type); |
| | | } |
| | | |
| | | //æ ¹æ®idæ¥çå·¥åºè¯¦æ
|
| | | @Override |
| | | public TechnologyTemplateDto selTechById(Integer id) { |
| | | TechnologyTemplate technologyTemplate = technologyTemplateMapper.selectById(id); |
| | | TechnologyTemplateDto technologyTemplateDto = new TechnologyTemplateDto(); |
| | | BeanUtils.copyProperties(technologyTemplate,technologyTemplateDto); |
| | | return technologyTemplateDto; |
| | | } |
| | | |
| | | //æ ¹æ®idä¿®æ¹ |
| | | @Override |
| | | public void updaTechById(Integer id, TechnologyTemplateDto technologyTemplateDto) { |
| | | TechnologyTemplate technologyTemplate = technologyTemplateMapper.selectById(id); |
| | | BeanUtils.copyProperties(technologyTemplateDto,technologyTemplate); |
| | | technologyTemplateMapper.updateById(technologyTemplate); |
| | | } |
| | | |
| | | //æ ¹æ®idå é¤ |
| | | @Override |
| | | public void delTech(Integer id) { |
| | | TechnologyTemplate technologyTemplate = technologyTemplateMapper.selectById(id); |
| | | technologyTemplate.setState(0); |
| | | technologyTemplateMapper.updateById(technologyTemplate); |
| | | } |
| | | |
| | | //æ¹éå é¤ |
| | | @Override |
| | | public void delAllTech(List<Integer> ids) { |
| | | List<TechnologyTemplate> technologyTemplates = technologyTemplateMapper.selectBatchIds(ids); |
| | | for (TechnologyTemplate technologyTemplate : technologyTemplates) { |
| | | technologyTemplate.setState(0); |
| | | technologyTemplateMapper.updateById(technologyTemplate); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.OrdersMapper"> |
| | | <select id="selectAllOrder" resultType="java.util.Map"> |
| | | select order_code, |
| | | select o.id, |
| | | order_code, |
| | | department, |
| | | province, |
| | | salesman, |
| | |
| | | o.state |
| | | from mom_ocean.orders o,mom_ocean.material m |
| | | <where> |
| | | <if test="orderCode != null"> |
| | | and order_code = #{orderCode} |
| | | <if test="orderCode != null and orderCode!=''"> |
| | | and order_code LIKE CONCAT('%',#{orderCode},'%') |
| | | </if> |
| | | <if test="time != null"> |
| | | <if test="time != null and time!=''"> |
| | | and o.create_time = #{time} |
| | | </if> |
| | | <if test="name != null"> |
| | | and m.name = #{name} |
| | | <if test="name != null and name!=''"> |
| | | and m.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="state != null"> |
| | | <if test="state != null and state!=''"> |
| | | and o.state = #{state} |
| | | </if> |
| | | and o.code=m.code |
| | | </where> |
| | | order by o.create_time desc |
| | | order by o.id desc |
| | | </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.TechnologyTemplateMapper"> |
| | | <select id="seleType" resultType="java.lang.Integer"> |
| | | select distinct type |
| | | from mom_ocean.technology_template |
| | | where state = 1 |
| | | </select> |
| | | |
| | | <resultMap id="selTech" type="com.yuanchu.mom.pojo.vo.TechnologyTemplateVo1"> |
| | | <id property="father" column="father" jdbcType="VARCHAR"/> |
| | | <collection property="children" resultMap="TechnologyTemplateVo2ListMap"/> |
| | | </resultMap> |
| | | |
| | | <resultMap id="TechnologyTemplateVo2ListMap" type="com.yuanchu.mom.pojo.vo.TechnologyTemplateVo2"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="element" column="element" jdbcType="VARCHAR"/> |
| | | <result property="base" column="base" jdbcType="VARCHAR"/> |
| | | <result property="control" column="control" jdbcType="VARCHAR"/> |
| | | <result property="note" column="note" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <select id="selTech" resultMap="selTech"> |
| | | select id, |
| | | father, |
| | | name, |
| | | element, |
| | | base, |
| | | control, |
| | | note |
| | | from mom_ocean.technology_template t |
| | | <where> |
| | | state=1 |
| | | <if test="type!=null and type!=''"> |
| | | and type=#{type} |
| | | </if> |
| | | <if test="element!=null and element!=''"> |
| | | and element like concat('%',#{element},'%') |
| | | </if> |
| | | <if test="father!=null and father!=''"> |
| | | and father like concat('%',#{father},'%') |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | |
| | | @SpringBootApplication |
| | |
| | | |
| | | # ç
§çåå¨è·¯å¾+++++++++++++++++++++++++++è¿ç»´éè¦é
ç½®+++++++++++++++++++++++++++ |
| | | file: |
| | | path: E:/webapp/images |
| | | path: D:/webapp/images |
| | | # ä¸ä¼ æä»¶å
è®¸çæ©å±å |
| | | allowed: png,jpg,jpeg,gif |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.yuanchu.mom.pojo |
| | |
| | | # redisæ°æ®åºç´¢å¼(é»è®¤ä¸º0)ï¼æä»¬ä½¿ç¨ç´¢å¼ä¸º3çæ°æ®åºï¼é¿å
åå
¶ä»æ°æ®åºå²çª |
| | | database: 0 |
| | | # redisæå¡å¨å°åï¼é»è®¤ä¸ºlocalhostï¼ |
| | | host: localhost |
| | | host: 192.168.110.209 |
| | | # redis端å£ï¼é»è®¤ä¸º6379ï¼ |
| | | port: 6379 |
| | | # redis访é®å¯ç ï¼é»è®¤ä¸ºç©ºï¼ |
| | |
| | | spring: |
| | | profiles: |
| | | active: dev |
| | | servlet: |
| | | multipart: |
| | | max-file-size: 20MB # å个æä»¶å¤§å° |
| | | max-request-size: 1024MB # 䏿¬¡è¯·æ±æä»¶æ»å¤§å° |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.yuanchu.mom.pojo |
| | |
| | | return Result.success("ç»å½æå", map); |
| | | } |
| | | |
| | | @ApiOperation(value = "tokenå·æ°") |
| | | @PostMapping("/refresh") |
| | | public Result refresh(String reToken) throws Exception { |
| | | Map<String, String> map = new Jwt().readJWT(reToken); |