已重命名4个文件
已修改36个文件
已添加12个文件
| | |
| | | create_user varchar(255) not null comment 'å½å
¥äºº', |
| | | update_user varchar(255) not null comment 'æ´æ°äºº', |
| | | tenant_id bigint not null comment 'ç§æ·id' |
| | | ); |
| | | ); |
| | | |
| | | |
| | | alter table purchase_ledger |
| | | add payment_method varchar(255) null; |
| | | alter table sales_ledger |
| | | add payment_method varchar(255) null; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | public enum FileNameType { |
| | | |
| | | SALE(1), // éå® |
| | | PURCHASE(2), // éè´ |
| | | INVOICE(3), //å票 |
| | | PURCHASELEDGER(4); // |
| | | |
| | | private final int value; |
| | | |
| | | FileNameType(int value) { |
| | | this.value = value; |
| | | } |
| | | |
| | | public int getValue() { |
| | | return value; |
| | | |
| | | } |
| | | |
| | | // æ ¹æ®æ´æ°å¼è·å对åºçæä¸¾å¼ |
| | | public static FileNameType fromValue(int value) { |
| | | for (FileNameType type : FileNameType.values()) { |
| | | if (type.getValue() == value) { |
| | | return type; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("Invalid value: " + value); |
| | | } |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | |
| | | public enum SalesLedgerType { |
| | | SALES_LEDGER_TYPE_SALES_LEDGER(1, "éå®å°è´¦"), |
| | | SALES_LEDGER_TYPE_PURCHASE_LEDGER(2, "éè´å°è´¦"); |
| | | |
| | | private final Integer value; |
| | | private final String label; |
| | | |
| | | SalesLedgerType(Integer value, String label) { |
| | | this.value = value; |
| | | this.label = label; |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public String getLabel() { |
| | | return label; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®å¼è·å对åºçæä¸¾ |
| | | */ |
| | | public static SalesLedgerType fromValue(Integer value) { |
| | | for (SalesLedgerType type : values()) { |
| | | if (type.getValue().equals(value)) { |
| | | return type; |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("æªç¥ç SalesLedgerType å¼: " + value); |
| | | } |
| | | } |
| | |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | deviceLedgerService.export(response, ids); |
| | | } |
| | | |
| | | @PostMapping("import") |
| | | @ApiModelProperty("导å
¥è®¾å¤å°è´¦") |
| | | public AjaxResult importData(MultipartFile file) { |
| | | Boolean b = deviceLedgerService.importData(file); |
| | | if (b) { |
| | | return AjaxResult.success("导å
¥æå"); |
| | | } |
| | | return AjaxResult.error("导å
¥å¤±è´¥"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("getDeviceLedger") |
| | | @ApiModelProperty("è·å设å¤å°è´¦") |
| | | public AjaxResult getDeviceLedger( ) { |
| | |
| | | import com.ruoyi.device.dto.DeviceLedgerDto; |
| | | import com.ruoyi.device.pojo.DeviceLedger; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | AjaxResult updateDeviceLedger(DeviceLedger deviceLedger); |
| | | |
| | | void export(HttpServletResponse response, Long[] ids); |
| | | |
| | | Boolean importData(MultipartFile file); |
| | | } |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean importData(MultipartFile file) { |
| | | return null; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.mapper.StockProductMapper; |
| | | import com.ruoyi.inventory.service.StockInService; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.project.system.domain.SysPost; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockin") |
| | | public class StockInController extends BaseController { |
| | | @Autowired |
| | | private StockInService stockInService; |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | @PostMapping("/add")// æ°å¢å
¥åºè®°å½ |
| | | public AjaxResult addStockIn(@RequestBody StockIn stockIn) { |
| | | int i = stockInService.addStockIn(stockIn); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @GetMapping("/list")// ååºææå
¥åºè®°å½ |
| | | public AjaxResult listStockIns() { |
| | | List<StockIn> stockIns = stockInService.listStockIns(); |
| | | return success(stockIns); |
| | | } |
| | | @GetMapping("/{id}")// æ ¹æ®IDè·åå
¥åºè®°å½ |
| | | public AjaxResult getStockInById(@PathVariable Long id) { |
| | | StockIn stockIn = stockInService.getStockInById(id); |
| | | return success(stockIn); |
| | | } |
| | | @PutMapping("/update")// æ´æ°å
¥åºè®°å½ |
| | | public AjaxResult updateStockIn(@RequestBody StockIn stockIn) { |
| | | int i = stockInService.updateStockIn(stockIn); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @DeleteMapping("/delete/{id}")// å é¤å
¥åºè®°å½ |
| | | public AjaxResult deleteStockIn(@PathVariable Long id) { |
| | | int i = stockInService.deleteStockIn(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | // @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | // @PreAuthorize("@ss.hasPermi('system:post:export')") |
| | | @GetMapping("/export")// 导åºå
¥åºæ°æ® |
| | | public AjaxResult exportStockInData() { |
| | | List<StockIn> stockIns = stockInService.listStockIns(); |
| | | ExcelUtil<StockIn> util = new ExcelUtil<StockIn>(StockIn.class); |
| | | util.exportExcel(stockIns, "åºåå
¥åºä¿¡æ¯"); |
| | | return success(); |
| | | } |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.service.StockManagementService; |
| | | import inventory.domain.StockManagement; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.framework.web.domain.AjaxResult.error; |
| | | import static com.ruoyi.framework.web.domain.AjaxResult.success; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockmanagement") |
| | | public class StockManagementController { |
| | | @Autowired |
| | | private StockManagementService stockManagementService; |
| | | @RequestMapping("/list")// ååºææåºåºè®°å½ |
| | | public AjaxResult listStockOuts() { |
| | | List<StockManagement> stockManagements = stockManagementService.getStockManagements(); |
| | | return success(stockManagements); |
| | | } |
| | | @GetMapping("/{id}")// æ ¹æ®IDè·ååºåºè®°å½ |
| | | public AjaxResult getStockOutById(@PathVariable Long id) { |
| | | StockManagement stockManagement = stockManagementService.getStockManagementById(id); |
| | | return success(stockManagement); |
| | | } |
| | | @PostMapping("add")// æ°å¢åºåºè®°å½ |
| | | public AjaxResult addStockOut(@RequestBody StockManagement stockManagement) { |
| | | int i = stockManagementService.addStockManagement(stockManagement); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @PutMapping("/update")// æ´æ°åºåºè®°å½ |
| | | public AjaxResult updateStockOut(@RequestBody StockManagement stockManagement) { |
| | | int i = stockManagementService.updateStockManagement(stockManagement); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @DeleteMapping("/delete/{id}")// å é¤åºåºè®°å½ |
| | | public AjaxResult deleteStockOut(@PathVariable Long id) { |
| | | int i = stockManagementService.deleteStockManagement(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.controller; |
| | | |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.mapper.StockProductMapper; |
| | | import com.ruoyi.inventory.service.StockOutService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockOut; |
| | | |
| | | @RestController |
| | | @RequestMapping("/stockout") |
| | | public class StockOutController extends BaseController { |
| | | @Autowired |
| | | private StockOutService stockOutService; |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | |
| | | @RequestMapping("/add") |
| | | public AjaxResult addStockOut(StockOut stockOut) { |
| | | int i = stockOutService.addStockOut(stockOut); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @RequestMapping("/list") |
| | | public AjaxResult listStockOuts() { |
| | | List<StockOut> stockOuts = stockOutService.getStockOuts(); |
| | | return success(stockOuts); |
| | | } |
| | | @RequestMapping("/{id}") |
| | | public AjaxResult getStockOutById(@PathVariable Long id) { |
| | | StockOut stockOut = stockOutService.getStockOutById(id); |
| | | return success(stockOut); |
| | | } |
| | | @RequestMapping("/update") |
| | | public AjaxResult updateStockOut(@RequestBody StockOut stockOut) { |
| | | int i = stockOutService.updateStockOut(stockOut); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | @RequestMapping("/delete/{id}") |
| | | public AjaxResult deleteStockOut(Long id) { |
| | | int i = stockOutService.deleteStockOut(id); |
| | | if(i>0){ |
| | | return success(); |
| | | } |
| | | return error(); |
| | | } |
| | | } |
| | |
| | | package inventory.domain; |
| | | package com.ruoyi.inventory.domain; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import inventory.domain.StockProduct; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | |
| | | private String inboundPerson; |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | private List<StockProduct> stockProducts; |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockIn record); |
| | | |
| | | int insertSelective(StockIn record); |
| | | |
| | | StockIn selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(StockIn record); |
| | | |
| | | int updateByPrimaryKey(StockIn record); |
| | | List<StockIn> selectList(); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockManagement; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | * @Entity inventory.domain.StockManagement |
| | | */ |
| | | public interface StockManagementMapper { |
| | | |
| | | List<StockManagement> selectAll(); |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockManagement record); |
| | | |
| | | int insertSelective(StockManagement record); |
| | | |
| | |
| | | |
| | | int updateByPrimaryKeySelective(StockManagement record); |
| | | |
| | | int updateByPrimaryKey(StockManagement record); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockOut; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockOut record); |
| | | |
| | | List<StockOut> selectAll(); |
| | | int insertSelective(StockOut record); |
| | | |
| | | StockOut selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(StockOut record); |
| | | |
| | | int updateByPrimaryKey(StockOut record); |
| | | |
| | | } |
| | |
| | | package inventory.mapper; |
| | | package com.ruoyi.inventory.mapper; |
| | | |
| | | import inventory.domain.StockProduct; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author 86151 |
| | |
| | | * @Entity inventory.domain.StockProduct |
| | | */ |
| | | public interface StockProductMapper { |
| | | |
| | | List<StockProduct> selectList(); |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(StockProduct record); |
| | | |
| | | int insertSelective(StockProduct record); |
| | | |
| | |
| | | |
| | | int updateByPrimaryKeySelective(StockProduct record); |
| | | |
| | | int updateByPrimaryKey(StockProduct record); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | public interface StockInService { |
| | | int addStockIn(StockIn stockIn); |
| | | |
| | | List<StockIn> listStockIns(); |
| | | |
| | | StockIn getStockInById(Long id); |
| | | |
| | | int updateStockIn(StockIn stockIn); |
| | | |
| | | int deleteStockIn(Long id); |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockManagement; |
| | | |
| | | public interface StockManagementService { |
| | | List<StockManagement> getStockManagements(); |
| | | StockManagement getStockManagementById(Long id); |
| | | int addStockManagement(StockManagement stockManagement); |
| | | int updateStockManagement(StockManagement stockManagement); |
| | | int deleteStockManagement(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service; |
| | | |
| | | import java.util.List; |
| | | import inventory.domain.StockOut; |
| | | |
| | | public interface StockOutService { |
| | | List<StockOut> getStockOuts(); |
| | | StockOut getStockOutById(Long id); |
| | | int addStockOut(StockOut stockOut); |
| | | int updateStockOut(StockOut stockOut); |
| | | int deleteStockOut(Long id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.domain.StockIn; |
| | | import com.ruoyi.inventory.mapper.StockInMapper; |
| | | import com.ruoyi.inventory.service.StockInService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | @Service |
| | | public class StockInServiceImpl implements StockInService { |
| | | @Autowired |
| | | private StockInMapper stockInMapper; |
| | | |
| | | @Override//æ·»å åºåå
¥åºä¿¡æ¯ |
| | | public int addStockIn(StockIn stockIn) { |
| | | int i = stockInMapper.insertSelective(stockIn); |
| | | return i; |
| | | } |
| | | |
| | | @Override//ååºææåºåå
¥åºä¿¡æ¯ |
| | | public List<StockIn> listStockIns() { |
| | | List<StockIn> stockIns = stockInMapper.selectList(); |
| | | return stockIns; |
| | | } |
| | | |
| | | @Override//æ ¹æ®idè·ååºåå
¥åºä¿¡æ¯ |
| | | public StockIn getStockInById(Long id) { |
| | | StockIn stockIn = stockInMapper.selectByPrimaryKey(id); |
| | | return stockIn; |
| | | } |
| | | |
| | | @Override//æ´æ°åºåå
¥åºä¿¡æ¯ |
| | | public int updateStockIn(StockIn stockIn) { |
| | | int i = stockInMapper.updateByPrimaryKeySelective(stockIn); |
| | | return i; |
| | | } |
| | | |
| | | @Override//å é¤åºåå
¥åºä¿¡æ¯ |
| | | public int deleteStockIn(Long id) { |
| | | int i = stockInMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.mapper.StockManagementMapper; |
| | | import com.ruoyi.inventory.service.StockManagementService; |
| | | import inventory.domain.StockManagement; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class StockManagementServiceImpl implements StockManagementService { |
| | | @Autowired |
| | | private StockManagementMapper stockManagementMapper; |
| | | |
| | | @Override |
| | | public List<StockManagement> getStockManagements() { |
| | | List<StockManagement> stockManagements = stockManagementMapper.selectAll(); |
| | | return stockManagements; |
| | | } |
| | | |
| | | @Override |
| | | public StockManagement getStockManagementById(Long id) { |
| | | StockManagement stockManagement = stockManagementMapper.selectByPrimaryKey(id); |
| | | return stockManagement; |
| | | } |
| | | |
| | | @Override |
| | | public int addStockManagement(StockManagement stockManagement) { |
| | | int i = stockManagementMapper.insertSelective(stockManagement); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStockManagement(StockManagement stockManagement) { |
| | | int i = stockManagementMapper.updateByPrimaryKeySelective(stockManagement); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStockManagement(Long id) { |
| | | int i = stockManagementMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.inventory.service.impl; |
| | | |
| | | import com.ruoyi.inventory.mapper.StockOutMapper; |
| | | import com.ruoyi.inventory.service.StockOutService; |
| | | import inventory.domain.StockOut; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class StockOutServiceImpl implements StockOutService { |
| | | @Autowired |
| | | private StockOutMapper stockOutMapper; |
| | | @Override |
| | | public List<StockOut> getStockOuts() { |
| | | List<StockOut> stockOuts = stockOutMapper.selectAll(); |
| | | return stockOuts; |
| | | } |
| | | |
| | | @Override |
| | | public StockOut getStockOutById(Long id) { |
| | | StockOut stockOut = stockOutMapper.selectByPrimaryKey(id); |
| | | return stockOut; |
| | | } |
| | | |
| | | @Override |
| | | public int addStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.insertSelective(stockOut); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int updateStockOut(StockOut stockOut) { |
| | | int i = stockOutMapper.updateByPrimaryKeySelective(stockOut); |
| | | return i; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteStockOut(Long id) { |
| | | int i = stockOutMapper.deleteByPrimaryKey(id); |
| | | return i; |
| | | } |
| | | } |
| | |
| | | private TempFileService tempFileService; |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Integer type) { |
| | | try { |
| | | return AjaxResult.success(tempFileService.uploadFile(file, type)); |
| | | } catch (Exception e) { |
| | |
| | | private String originalName; // åå§æä»¶å |
| | | private String tempPath; // 临æ¶åå¨è·¯å¾ |
| | | private LocalDateTime expireTime; // è¿ææ¶é´ |
| | | private String type; // å
³è表类å |
| | | private Integer type; // å
³è表类å |
| | | } |
| | |
| | | import java.io.IOException; |
| | | |
| | | public interface TempFileService { |
| | | TempFile uploadFile(MultipartFile file,String type) throws IOException; |
| | | TempFile uploadFile(MultipartFile file,Integer type) throws IOException; |
| | | } |
| | |
| | | |
| | | // ä¸ä¼ å°ä¸´æ¶ç®å½ |
| | | @Override |
| | | public TempFile uploadFile(MultipartFile file,String type) throws IOException { |
| | | public TempFile uploadFile(MultipartFile file,Integer type) throws IOException { |
| | | // 1. çæä¸´æ¶æä»¶IDåè·¯å¾ |
| | | String tempId = UUID.randomUUID().toString(); |
| | | Path tempFilePath = Paths.get(tempDir, tempId + "_" + file.getOriginalFilename()); |
| | |
| | | List<SysPost> list = postService.selectPostList(post);
|
| | | return getDataTable(list);
|
| | | }
|
| | | /**
|
| | | * 导åºå²ä½å表
|
| | | */
|
| | |
|
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT)
|
| | | @PreAuthorize("@ss.hasPermi('system:post:export')")
|
| | |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, Integer type) { |
| | | try { |
| | | return AjaxResult.success(commonFileService.uploadFile(file, id, type)); |
| | | } catch (Exception e) { |
| | |
| | | * æ¥è¯¢éè´å°è´¦å表 |
| | | */ |
| | | @GetMapping("/listPage") |
| | | public IPage<PurchaseLedger> listPage(Page page, PurchaseLedger purchaseLedger) { |
| | | return purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger); |
| | | public AjaxResult listPage(Page page, PurchaseLedgerDto purchaseLedger) { |
| | | return AjaxResult.success(purchaseLedgerService.selectPurchaseLedgerListPage(page ,purchaseLedger)); |
| | | } |
| | | |
| | | @ApiOperation("çæéè´åºåå·") |
| | |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.purchase.service.ITicketRegistrationService; |
| | | import com.ruoyi.sales.service.ICommonFileService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RestController |
| | | @RequestMapping("/purchase/registration") |
| | | @AllArgsConstructor |
| | | @Api(tags = "æ¥ç¥¨ç»è®°") |
| | | public class TicketRegistrationController extends BaseController { |
| | | |
| | | private ITicketRegistrationService ticketRegistrationService; |
| | |
| | | } |
| | | |
| | | @PostMapping("/upload") |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, String type) { |
| | | public AjaxResult uploadFile(MultipartFile file, Long id, Integer type) { |
| | | try { |
| | | return AjaxResult.success(commonFileService.uploadFile(file, id, type)); |
| | | } catch (Exception e) { |
| | |
| | | public IPage<TicketRegistration> listPage(Page page, TicketRegistration ticketRegistration) { |
| | | return ticketRegistrationService.selectTicketRegistrationListPage(page,ticketRegistration); |
| | | } |
| | | |
| | | @ApiModelProperty("æ ¹æ®idæ¥è¯¢æ¥æ¼ç»è®°") |
| | | @GetMapping("/getPuargeById") |
| | | public AjaxResult getPuargeById(Long id) { |
| | | return AjaxResult.success(ticketRegistrationService.getPuargeById( id)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class ProductRecordDto extends ProductRecord { |
| | |
| | | private String invoiceNumber; |
| | | |
| | | private String unTicketsPrice; |
| | | |
| | | private List<CommonFile> commonFiles; |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | */ |
| | | private Long ticketRegistrationId; |
| | | |
| | | /** |
| | | * ååéé¢ï¼äº§åå«ç¨æ»ä»·ï¼ |
| | | */ |
| | | private BigDecimal contractAmount = BigDecimal.ZERO; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("æ¥ç¥¨éé¢") |
| | | private BigDecimal receiptPaymentAmount = BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æªæ¥ç¥¨éé¢") |
| | | @TableField(exist = false) |
| | | private BigDecimal unReceiptPaymentAmount =BigDecimal.ZERO; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å å 4") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseLedger; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | |
| | | int updateContractAmountById(@Param("id") Long id, @Param("totalTaxInclusiveAmount") BigDecimal totalTaxInclusiveAmount); |
| | | |
| | | IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, @Param("c") PurchaseLedger purchaseLedger); |
| | | IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, @Param("c") PurchaseLedgerDto purchaseLedger); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String unReceiptPaymentAmount; |
| | | |
| | | @ApiModelProperty("æä»¶ç±»å å 4") |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | PurchaseLedgerDto getPurchaseNoById(Long id); |
| | | |
| | | IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedger purchaseLedger); |
| | | IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger); |
| | | |
| | | List<InvoiceRegistrationProduct> getProductBySalesNo(Long id); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.TicketRegistration; |
| | | |
| | |
| | | List getTicketNo(TicketRegistrationDto ticketRegistrationDto); |
| | | |
| | | IPage<TicketRegistration> selectTicketRegistrationListPage(Page page, TicketRegistration ticketRegistration); |
| | | |
| | | PurchaseLedgerDto getPuargeById(Long id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.utils.bean.BeanUtils; |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | |
| | | // æ¹éæ¥è¯¢è¿äºå票å
³èçæä»¶ä¿¡æ¯ |
| | | LambdaQueryWrapper<CommonFile> fileQueryWrapper = new LambdaQueryWrapper<>(); |
| | | fileQueryWrapper.in(CommonFile::getCommonId, invoiceIds) |
| | | .eq(CommonFile::getType,"3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> fileList = commonFileMapper.selectList(fileQueryWrapper); |
| | | |
| | | // å°æä»¶ä¿¡æ¯æ å°å°å¯¹åºçå票ID |
| | |
| | | // æ¥è¯¢ä¸ä¼ æä»¶ |
| | | LambdaQueryWrapper<CommonFile> commonFileLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | commonFileLambdaQueryWrapper.eq(CommonFile::getCommonId, invoicePurchaseDto.getId()) |
| | | .eq(CommonFile::getType, "3"); |
| | | .eq(CommonFile::getType, FileNameType.INVOICE.getValue()); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(commonFileLambdaQueryWrapper); |
| | | resultDto.setCommonFiles(commonFiles); |
| | | return resultDto; |
| | |
| | | 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.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.purchase.dto.ProductRecordDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | | import com.ruoyi.purchase.pojo.ProductRecord; |
| | | import com.ruoyi.purchase.service.IProductRecordService; |
| | | import com.ruoyi.sales.mapper.CommonFileMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | @AllArgsConstructor |
| | | public class ProductRecordServiceImpl extends ServiceImpl<ProductRecordMapper, ProductRecord> implements IProductRecordService { |
| | | |
| | | @Autowired |
| | | private ProductRecordMapper productRecordMapper; |
| | | |
| | | @Autowired |
| | | private CommonFileMapper commonFileMapper; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) { |
| | | |
| | | return productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | IPage<ProductRecordDto> productRecordDtoIPage = productRecordMapper.productRecordPage(page, ticketRegistrationDto); |
| | | productRecordDtoIPage.getRecords().forEach(productRecordDto -> { |
| | | productRecordDto.setCommonFiles(commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, productRecordDto.getTicketRegistrationId()) |
| | | .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()))); |
| | | }); |
| | | return productRecordDtoIPage; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.Product; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.pojo.SupplierManage; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType("2"); |
| | | fileRecord.setType(FileNameType.PURCHASE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // å é¤ä¸´æ¶æä»¶è®°å½ |
| | |
| | | // æ¹éå é¤å
³èçéè´å°è´¦äº§å |
| | | LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(SalesLedgerProduct::getSalesLedgerId, ids) |
| | | .eq(SalesLedgerProduct::getType, "2"); |
| | | .eq(SalesLedgerProduct::getType, 2); |
| | | salesLedgerProductMapper.delete(queryWrapper); |
| | | // æ¹éå é¤å
³èçéè´å°è´¦çæ¥ç¥¨ç»è®° |
| | | LambdaQueryWrapper<TicketRegistration> ticketRegistrationLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | // å建并填å
DTO |
| | | PurchaseLedgerDto resultDto = new PurchaseLedgerDto(); |
| | | resultDto.setSalesLedgerId(purchaseLedger.getSalesLedgerId()); |
| | | resultDto.setSalesContractNoId(purchaseLedger.getSalesLedgerId()); |
| | | resultDto.setSalesContractNo(purchaseLedger.getSalesContractNo()); |
| | | resultDto.setSupplierName(purchaseLedger.getSupplierName()); |
| | |
| | | public PurchaseLedgerDto getPurchaseNoById(Long id) { |
| | | PurchaseLedgerDto purchaseLedgerDto = new PurchaseLedgerDto(); |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); |
| | | |
| | | BeanUtils.copyProperties(purchaseLedger, purchaseLedgerDto); |
| | | // TicketRegistration ticketRegistration = ticketRegistrationMapper.selectOne(new LambdaQueryWrapper<TicketRegistration>().eq(TicketRegistration::getPurchaseLedgerId, id)); |
| | | // if (ticketRegistration != null) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PurchaseLedger> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedger purchaseLedger) { |
| | | |
| | | return purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger); |
| | | public IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger) { |
| | | IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger); |
| | | purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> { |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue())); |
| | | purchaseLedgerDto.setSalesLedgerFiles(commonFiles); |
| | | }); |
| | | return purchaseLedgerDtoIPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | 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.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.SalesLedgerType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | import com.ruoyi.other.mapper.TempFileMapper; |
| | | import com.ruoyi.other.pojo.TempFile; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.dto.PurchaseLedgerDto; |
| | | import com.ruoyi.purchase.dto.TicketRegistrationDto; |
| | | import com.ruoyi.purchase.mapper.PaymentRegistrationMapper; |
| | | import com.ruoyi.purchase.mapper.ProductRecordMapper; |
| | |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.pojo.CommonFile; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerProductService; |
| | | import com.ruoyi.sales.service.impl.SalesLedgerProductServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | private final TempFileMapper tempFileMapper; |
| | | |
| | | private final ProductRecordMapper productRecordMapper; |
| | | |
| | | @Autowired |
| | | private ISalesLedgerProductService salesLedgerProductService; |
| | | |
| | | @Autowired |
| | | private PaymentRegistrationMapper paymentRegistrationMapper; |
| | |
| | | queryWrapper.like(TicketRegistration::getPurchaseContractNumber, ticketRegistration.getPurchaseContractNumber()) |
| | | .like(TicketRegistration::getSupplierName, ticketRegistration.getSupplierName()); |
| | | } |
| | | if (!ObjectUtils.isEmpty(ticketRegistration.getIssueDateStart())&&!ObjectUtils.isEmpty(ticketRegistration.getIssueDateEnd())) { |
| | | queryWrapper.between(TicketRegistration::getIssueDate,LocalDate.parse(ticketRegistration.getIssueDateStart(), DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalDate.parse(ticketRegistration.getIssueDateEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | if (!ObjectUtils.isEmpty(ticketRegistration.getIssueDateStart()) && !ObjectUtils.isEmpty(ticketRegistration.getIssueDateEnd())) { |
| | | queryWrapper.between(TicketRegistration::getIssueDate, LocalDate.parse(ticketRegistration.getIssueDateStart(), DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalDate.parse(ticketRegistration.getIssueDateEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd"))); |
| | | } |
| | | IPage<TicketRegistration> ticketRegistrationIPage = ticketRegistrationMapper.selectPage(page, queryWrapper); |
| | | // 计ç®å·²ä»æ¬¾éé¢ |
| | |
| | | return ticketRegistrationIPage; |
| | | } |
| | | |
| | | @Override |
| | | public PurchaseLedgerDto getPuargeById(Long id) { |
| | | PurchaseLedger purchaseLedger = purchaseLedgerMapper.selectById(id); |
| | | PurchaseLedgerDto purchaseLedgerDto = new PurchaseLedgerDto(); |
| | | BeanUtils.copyProperties(purchaseLedger, purchaseLedgerDto); |
| | | SalesLedgerProduct salesLedgerProduct = new SalesLedgerProduct(); |
| | | salesLedgerProduct.setSalesLedgerId(id); |
| | | salesLedgerProduct.setType(SalesLedgerType.SALES_LEDGER_TYPE_SALES_LEDGER.getValue()); |
| | | List<SalesLedgerProduct> salesLedgerProducts = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | purchaseLedgerDto.setProductData(salesLedgerProducts); |
| | | List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>() |
| | | .eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()) |
| | | .eq(CommonFile::getCommonId, id)); |
| | | purchaseLedgerDto.setSalesLedgerFiles(commonFiles); |
| | | return purchaseLedgerDto; |
| | | } |
| | | |
| | | private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type) { |
| | | if (products == null || products.isEmpty()) { |
| | | return; |
| | |
| | | * æ¥è¯¢äº§åä¿¡æ¯å表 |
| | | */ |
| | | @GetMapping("/list") |
| | | public List<SalesLedgerProduct> list(SalesLedgerProduct salesLedgerProduct) |
| | | public AjaxResult list(SalesLedgerProduct salesLedgerProduct) |
| | | { |
| | | List<SalesLedgerProduct> list = salesLedgerProductService.selectSalesLedgerProductList(salesLedgerProduct); |
| | | return list; |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | /** |
| | |
| | | private LocalDate executionDate; |
| | | |
| | | private Boolean status; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | } |
| | |
| | | private String url; |
| | | |
| | | /** å
³è表 */ |
| | | private String type; |
| | | private Integer type; |
| | | |
| | | /** å建æ¶é´ */ |
| | | @TableField(fill = FieldFill.INSERT) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.sales.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class PurchaseLedgerFile { |
| | | |
| | | @ApiModelProperty(value = "æä»¶åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "æä»¶è·¯å¾") |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value = "æä»¶å¤§å°") |
| | | private int fileSize; |
| | | |
| | | @ApiModelProperty(value = "å¼ç¥¨å°è´¦ID") |
| | | private Integer purchaseLedgerId; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "å·²å¼ç¥¨éé¢(å
)") |
| | | private BigDecimal invoiceTotal; |
| | | |
| | | @ApiModelProperty(value = "仿¬¾æ¹å¼") |
| | | private String paymentMethod; |
| | | } |
| | | |
| | |
| | | |
| | | int deleteSalesLedgerByIds(Long[] ids); |
| | | |
| | | CommonFile uploadFile(MultipartFile file, Long id, String type) throws IOException; |
| | | CommonFile uploadFile(MultipartFile file, Long id, Integer type) throws IOException; |
| | | |
| | | int delCommonFileByIds(Long[] ids); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public CommonFile uploadFile(MultipartFile file, Long id, String type) throws IOException { |
| | | public CommonFile uploadFile(MultipartFile file, Long id, Integer type) throws IOException { |
| | | // 1. çææ£å¼æä»¶IDåè·¯å¾ |
| | | String tempId = UUID.randomUUID().toString(); |
| | | Path tempFilePath = Paths.get(uploadDir, tempId + "_" + file.getOriginalFilename()); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.basic.mapper.CustomerMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | |
| | | fileRecord.setName(originalFilename); |
| | | fileRecord.setUrl(formalFilePath.toString()); |
| | | fileRecord.setCreateTime(LocalDateTime.now()); |
| | | fileRecord.setType("1"); |
| | | //éå® |
| | | fileRecord.setType(FileNameType.SALE.getValue()); |
| | | commonFileMapper.insert(fileRecord); |
| | | |
| | | // å é¤ä¸´æ¶æä»¶è®°å½ |
ÎļþÃû´Ó src/main/resources/mapper/StockInMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockInMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockInMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockIn"> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.inventory.domain.StockIn"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="productId" column="product_id" jdbcType="INTEGER"/> |
| | | <result property="inboundTime" column="inbound_time" jdbcType="TIMESTAMP"/> |
| | |
| | | <result property="taxRate" column="tax_rate" jdbcType="DECIMAL"/> |
| | | <result property="taxExclusiveTotal" column="tax_exclusive_total" jdbcType="DECIMAL"/> |
| | | <result property="inboundPerson" column="inbound_person" jdbcType="VARCHAR"/> |
| | | <collection property="stockProducts" ofType="com.ruoyi.inventory.domain.StockProduct" |
| | | select="com.ruoyi.inventory.mapper.StockProductMapper.selectByPrimaryKey" column="productId"> |
| | | <id property="id" column="productId" jdbcType="INTEGER"/> |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | from stock_in |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectList" resultType="com.ruoyi.inventory.domain.StockIn"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_in |
| | | </select> |
| | | <select id="selectListByPage" resultType="com.ruoyi.inventory.domain.StockIn"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_in |
| | | limit #{pageNum},#{pageSize} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_in |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true"> |
| | | insert into stock_in |
| | | ( id,product_id,inbound_time |
| | | ,inbound_batch,supplier_name,inbound_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP} |
| | | ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockIn" useGeneratedKeys="true"> |
| | | insert into stock_in |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="inboundPerson != null">#{inboundPerson,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="inventory.domain.StockIn"> |
| | | update stock_in |
| | | <set> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockIn"> |
| | | update stock_in |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | inbound_time = #{inboundTime,jdbcType=TIMESTAMP}, |
| | | inbound_batch = #{inboundBatch,jdbcType=VARCHAR}, |
| | | supplier_name = #{supplierName,jdbcType=VARCHAR}, |
| | | inbound_quantity = #{inboundQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockManagementMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockManagementMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockManagementMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockManagement"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_management |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectAll" resultType="inventory.domain.StockManagement"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_management |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_management |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true"> |
| | | insert into stock_management |
| | | ( id,product_id,stock_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{stockQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockManagement" useGeneratedKeys="true"> |
| | | insert into stock_management |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockManagement"> |
| | | update stock_management |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | stock_quantity = #{stockQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockOutMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockOutMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockOutMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockOut"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_out |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectAll" resultType="inventory.domain.StockOut"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_out |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_out |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true"> |
| | | insert into stock_out |
| | | ( id,product_id,inbound_time |
| | | ,inbound_batch,supplier_name,inbound_quantity |
| | | ,tax_inclusive_price,tax_inclusive_total,tax_rate |
| | | ,tax_exclusive_total,inbound_person) |
| | | values (#{id,jdbcType=INTEGER},#{productId,jdbcType=INTEGER},#{inboundTime,jdbcType=TIMESTAMP} |
| | | ,#{inboundBatch,jdbcType=VARCHAR},#{supplierName,jdbcType=VARCHAR},#{inboundQuantity,jdbcType=INTEGER} |
| | | ,#{taxInclusivePrice,jdbcType=DECIMAL},#{taxInclusiveTotal,jdbcType=DECIMAL},#{taxRate,jdbcType=DECIMAL} |
| | | ,#{taxExclusiveTotal,jdbcType=DECIMAL},#{inboundPerson,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockOut" useGeneratedKeys="true"> |
| | | insert into stock_out |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockOut"> |
| | | update stock_out |
| | | set |
| | | product_id = #{productId,jdbcType=INTEGER}, |
| | | inbound_time = #{inboundTime,jdbcType=TIMESTAMP}, |
| | | inbound_batch = #{inboundBatch,jdbcType=VARCHAR}, |
| | | supplier_name = #{supplierName,jdbcType=VARCHAR}, |
| | | inbound_quantity = #{inboundQuantity,jdbcType=INTEGER}, |
| | | tax_inclusive_price = #{taxInclusivePrice,jdbcType=DECIMAL}, |
| | | tax_inclusive_total = #{taxInclusiveTotal,jdbcType=DECIMAL}, |
| | | tax_rate = #{taxRate,jdbcType=DECIMAL}, |
| | | tax_exclusive_total = #{taxExclusiveTotal,jdbcType=DECIMAL}, |
| | | inbound_person = #{inboundPerson,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
ÎļþÃû´Ó src/main/resources/mapper/StockProductMapper.xml ÐÞ¸Ä |
| | |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="inventory.mapper.StockProductMapper"> |
| | | <mapper namespace="com.ruoyi.inventory.mapper.StockProductMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="inventory.domain.StockProduct"> |
| | | <id property="id" column="id" jdbcType="INTEGER"/> |
| | |
| | | from stock_product |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </select> |
| | | <select id="selectList" resultType="inventory.domain.StockProduct"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from stock_product |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from stock_product |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </delete> |
| | | <insert id="insert" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true"> |
| | | insert into stock_product |
| | | ( id,product_category,spec_model |
| | | ,unit) |
| | | values (#{id,jdbcType=INTEGER},#{productCategory,jdbcType=VARCHAR},#{specModel,jdbcType=VARCHAR} |
| | | ,#{unit,jdbcType=VARCHAR}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="inventory.domain.StockProduct" useGeneratedKeys="true"> |
| | | insert into stock_product |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | </set> |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | <update id="updateByPrimaryKey" parameterType="inventory.domain.StockProduct"> |
| | | update stock_product |
| | | set |
| | | product_category = #{productCategory,jdbcType=VARCHAR}, |
| | | spec_model = #{specModel,jdbcType=VARCHAR}, |
| | | unit = #{unit,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=INTEGER} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | |
| | | <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto"> |
| | | SELECT |
| | | distinct |
| | | sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | sl.customer_name, |
| | |
| | | tr.invoice_number, |
| | | ROUND(pr.tickets_amount/(1+pr.tax_rate/100),2 ) as un_tickets_price, |
| | | ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount |
| | | |
| | | FROM product_record pr |
| | | left join purchase_ledger pl on pl.id = pr.purchase_ledger_id |
| | | left join sales_ledger sl on sl.id = pl.sales_ledger_id |
| | | left join ticket_registration tr on tr.purchase_ledger_id = pl.id |
| | | left join ticket_registration tr on tr.id = pr.ticket_registration_id |
| | | left join product_model pm on pm.id = pr.product_model_id |
| | | WHERE type = 2 |
| | | <if test="c.salesContractNo != null and c.salesContractNo != ''"> |
| | |
| | | SET contract_amount = #{totalTaxInclusiveAmount} |
| | | WHERE id = #{id} |
| | | </update> |
| | | <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.pojo.PurchaseLedger"> |
| | | <select id="selectPurchaseLedgerListPage" resultType="com.ruoyi.purchase.dto.PurchaseLedgerDto"> |
| | | select |
| | | pl.id, |
| | | pl.purchase_contract_number , |