浏览代码

订单统计报表

chen 2 年之前
父节点
当前提交
2a06299c5c

+ 5 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/service/impl/PurchaseWarehousingServiceImpl.java

@@ -781,7 +781,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
 
         }
         //由于前期是自己插入U8数据库 后前改变方式先择调用第三方插入接口 所以需要把字段名整体转换成第三方的
-        JSONArray resturn =InterfaceConnUtils.doPost(saveRdRecord09JSON(transVouchMao,transVouchsList,accID),"http://192.168.1.103:8087/api/U8Server/transvouch_import");
+        JSONArray resturn =InterfaceConnUtils.doPost(saveTransVouchJSON(transVouchMao,transVouchsList,accID),"http://192.168.1.103:8087/api/U8Server/transvouch_import");
         if(resturn.getJSONObject(0).get("Result").equals("T")){
             //成功
 //            String tvCode=resturn.getJSONObject(0).get("U8ReceiptNo")+"";//调拨单号
@@ -808,7 +808,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
     }
 
     //由于前期是自己插入U8数据库 后前改变方式先择调用第三方插入接口 所以需要把字段名整体转换成第三方的
-    public JSONArray saveRdRecord09JSON(Map<String,Object> transVouchMao,List<Map<String,Object>> transVouchsList,String accID){
+    public JSONArray saveTransVouchJSON(Map<String,Object> transVouchMao,List<Map<String,Object>> transVouchsList,String accID){
         JSONArray jsonArraySave=new JSONArray();
         if(transVouchMao!=null){
             //主表
@@ -826,6 +826,7 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
             saveJson.put("CIDEPCODE",transVouchMao.get("cIDepCode"));
             saveJson.put("CPERSONCODE",transVouchMao.get("cPersonCode"));
             saveJson.put("CDEFINE13",transVouchMao.get("cDefine13"));
+            saveJson.put("CGLTYPE","委外订单");
             //子表
             if(transVouchsList!=null){
                 JSONArray itemJsonArray=new JSONArray();
@@ -835,6 +836,8 @@ public class PurchaseWarehousingServiceImpl extends ServiceImpl<PurchaseWarehous
                     saveItemJson.put("IQUANTITY",m.get("iTVQuantity"));
                     saveItemJson.put("CBATCH",m.get("cTVBatch"));
                     saveItemJson.put("CBMEMO",m.get("cbMemo"));
+                    saveItemJson.put("AUTOID_PO",m.get("iomids"));
+                    saveItemJson.put("POAUTOIDCOL",m.get("MOMaterialsID"));
                     //获取自定义项 自由项 批次项
                     getCDEFINEJson(saveItemJson,m);
                     itemJsonArray.add(saveItemJson);

+ 188 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/controller/SoSoDetailsController.java

@@ -0,0 +1,188 @@
+package org.jeecg.modules.report.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.report.entity.SoSoDetails;
+import org.jeecg.modules.report.service.ISoSoDetailsService;
+import java.util.Date;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+ /**
+ * @Description: 订单统计报表
+ * @Author: jeecg-boot
+ * @Date:   2022-06-01
+ * @Version: V1.0
+ */
+@Slf4j
+@Api(tags="订单统计报表")
+@RestController
+@RequestMapping("/report/soSoDetails")
+public class SoSoDetailsController extends JeecgController<SoSoDetails, ISoSoDetailsService> {
+	@Autowired
+	private ISoSoDetailsService soSoDetailsService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param soSoDetails
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-分页列表查询")
+	@ApiOperation(value="订单统计报表-分页列表查询", notes="订单统计报表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<?> queryPageList(SoSoDetails soSoDetails,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<SoSoDetails> queryWrapper = QueryGenerator.initQueryWrapper(soSoDetails, req.getParameterMap());
+		Page<SoSoDetails> page = new Page<SoSoDetails>(pageNo, pageSize);
+		IPage<SoSoDetails> pageList = soSoDetailsService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 * 添加
+	 *
+	 * @param soSoDetails
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-添加")
+	@ApiOperation(value="订单统计报表-添加", notes="订单统计报表-添加")
+	@PostMapping(value = "/add")
+	public Result<?> add(@RequestBody SoSoDetails soSoDetails) {
+		soSoDetailsService.save(soSoDetails);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 * 编辑
+	 *
+	 * @param soSoDetails
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-编辑")
+	@ApiOperation(value="订单统计报表-编辑", notes="订单统计报表-编辑")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<?> edit(@RequestBody SoSoDetails soSoDetails) {
+		soSoDetailsService.updateById(soSoDetails);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 * 通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-通过id删除")
+	@ApiOperation(value="订单统计报表-通过id删除", notes="订单统计报表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
+		soSoDetailsService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 * 批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-批量删除")
+	@ApiOperation(value="订单统计报表-批量删除", notes="订单统计报表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.soSoDetailsService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "订单统计报表-通过id查询")
+	@ApiOperation(value="订单统计报表-通过id查询", notes="订单统计报表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
+		SoSoDetails soSoDetails = soSoDetailsService.getById(id);
+		return Result.OK(soSoDetails);
+	}
+
+  /**
+   * 导出excel
+   *
+   * @param request
+   * @param soSoDetails
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, SoSoDetails soSoDetails) {
+      return super.exportXls(request, soSoDetails, SoSoDetails.class, "订单统计报表");
+  }
+
+  /**
+   * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      return super.importExcel(request, response, SoSoDetails.class);
+  }
+
+
+	 /**
+	  * 订单统计报表查询
+	  * 根据开始年份月份(yyyy-mm)、结束年份月份(yyyy-mm)、类型(内部/外部)查询订单统计数据  如果不传类型则查询时间范围全部的
+	  * @param map startYearMonth endYearMonth vendorType
+	  * @return
+	  */
+	 @GetMapping(value = "/getSO_SOMainReport")
+	 public Result<List<Map<String,Object>>> getSO_SOMainReport(Map<String,Object> map){
+		 Result<List<Map<String,Object>>> result =new Result<>();
+		 try {
+			 List<Map<String,Object>> list=soSoDetailsService.getSO_SOMainReport(map);
+			 result.setResult(list);
+			 result.success("查询成功");
+		 } catch (Exception e) {
+			 result.error500("查询失败:"+e.getMessage());
+			 throw new RuntimeException(e);
+		 }
+		 return result;
+	 }
+
+}

+ 107 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/entity/SoSoDetails.java

@@ -0,0 +1,107 @@
+package org.jeecg.modules.report.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 订单统计报表
+ * @Author: jeecg-boot
+ * @Date:   2022-06-01
+ * @Version: V1.0
+ */
+@Data
+@TableName("demo")
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@ApiModel(value="demo对象", description="订单统计报表")
+public class SoSoDetails {
+    
+	/**主键ID*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键ID")
+	private String id;
+	/**姓名*/
+	@Excel(name = "姓名", width = 15)
+    @ApiModelProperty(value = "姓名")
+	private String name;
+	/**关键词*/
+	@Excel(name = "关键词", width = 15)
+    @ApiModelProperty(value = "关键词")
+	private String keyWord;
+	/**打卡时间*/
+	@Excel(name = "打卡时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "打卡时间")
+	private Date punchTime;
+	/**工资*/
+	@Excel(name = "工资", width = 15)
+    @ApiModelProperty(value = "工资")
+	private java.math.BigDecimal salaryMoney;
+	/**奖金*/
+	@Excel(name = "奖金", width = 15)
+    @ApiModelProperty(value = "奖金")
+	private Double bonusMoney;
+	/**性别 {男:1,女:2}*/
+	@Excel(name = "性别 {男:1,女:2}", width = 15)
+    @ApiModelProperty(value = "性别 {男:1,女:2}")
+	private String sex;
+	/**年龄*/
+	@Excel(name = "年龄", width = 15)
+    @ApiModelProperty(value = "年龄")
+	private Integer age;
+	/**生日*/
+	@Excel(name = "生日", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "生日")
+	private Date birthday;
+	/**邮箱*/
+	@Excel(name = "邮箱", width = 15)
+    @ApiModelProperty(value = "邮箱")
+	private String email;
+	/**个人简介*/
+	@Excel(name = "个人简介", width = 15)
+    @ApiModelProperty(value = "个人简介")
+	private String content;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+    @ApiModelProperty(value = "创建人")
+	private String createBy;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+    @ApiModelProperty(value = "修改人")
+	private String updateBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**所属部门编码*/
+	@Excel(name = "所属部门编码", width = 15)
+    @ApiModelProperty(value = "所属部门编码")
+	private String sysOrgCode;
+	/**tenantId*/
+	@Excel(name = "tenantId", width = 15)
+    @ApiModelProperty(value = "tenantId")
+	private Integer tenantId;
+}

+ 24 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/mapper/SoSoDetailsMapper.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.report.mapper;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.SoSoDetails;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 订单统计报表
+ * @Author: jeecg-boot
+ * @Date:   2022-06-01
+ * @Version: V1.0
+ */
+public interface SoSoDetailsMapper extends BaseMapper<SoSoDetails> {
+    /**
+     * 根据开始年份月份(yyyy-mm)、结束年份月份(yyyy-mm)、类型(内部/外部)查询订单统计数据  如果不传类型则查询时间范围全部的
+     * @param map startYearMonth endYearMonth vendorType
+     * @return
+     */
+  List<Map<String,Object>> getSO_SOMainReport(@Param("map")Map<String,Object> map);
+
+}

+ 23 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/ISoSoDetailsService.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.report.service;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.report.entity.SoSoDetails;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 订单统计报表
+ * @Author: jeecg-boot
+ * @Date:   2022-06-01
+ * @Version: V1.0
+ */
+public interface ISoSoDetailsService extends IService<SoSoDetails> {
+    /**
+     * 根据开始年份月份(yyyy-mm)、结束年份月份(yyyy-mm)、类型(内部/外部)查询订单统计数据  如果不传类型则查询时间范围全部的
+     * @param map startYearMonth endYearMonth vendorType
+     * @return
+     */
+    List<Map<String,Object>> getSO_SOMainReport(Map<String,Object> map);
+}

+ 26 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/report/service/impl/SoSoDetailsServiceImpl.java

@@ -0,0 +1,26 @@
+package org.jeecg.modules.report.service.impl;
+
+import org.jeecg.modules.report.entity.SoSoDetails;
+import org.jeecg.modules.report.mapper.SoSoDetailsMapper;
+import org.jeecg.modules.report.service.ISoSoDetailsService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description: 订单统计报表
+ * @Author: jeecg-boot
+ * @Date:   2022-06-01
+ * @Version: V1.0
+ */
+@Service
+public class SoSoDetailsServiceImpl extends ServiceImpl<SoSoDetailsMapper, SoSoDetails> implements ISoSoDetailsService {
+
+    @Override
+    public List<Map<String, Object>> getSO_SOMainReport(Map<String, Object> map) {
+        return this.baseMapper.getSO_SOMainReport(map);
+    }
+}