| | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description 报废单 |
| | |
| | | */ |
| | | @ApiOperation(value = "新增报废单", notes = "新增报废单") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param") |
| | | @ApiImplicitParam(name = "param") |
| | | }) |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody LWhFormScrappedParam param) { |
| | | public ResponseValue add() { |
| | | LWhFormScrappedParam param = CommonUtil.getObjFromReqBody(LWhFormScrappedParam.class); |
| | | LWhFormScrappedParam query = new LWhFormScrappedParam(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | int result = this.lWhFormScrappedService.add(param, this.getCurrentUser(), sysInfo); |
| | | int result = this.lWhFormScrappedService.add(param,0, this.getCurrentUser(), sysInfo); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增报废单", notes = "新增报废单") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param") |
| | | }) |
| | | @PostMapping("/deprAdd") |
| | | public ResponseValue deprAdd() { |
| | | LWhFormScrappedParam param = CommonUtil.getObjFromReqBody(LWhFormScrappedParam.class); |
| | | LWhFormScrappedParam query = new LWhFormScrappedParam(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | int result = this.lWhFormScrappedService.add(param,1, this.getCurrentUser(), sysInfo); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "列表查询", notes = "列表查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "查询条件", dataType = "LWhFormScrappedQry", paramType = "query") |
| | | @ApiImplicitParam(name = "param", value = "查询条件", dataType = "LWhFormScrappedQry", paramType = "query") |
| | | }) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryList(LWhFormScrappedQry param) { |
| | | public ResponseValue queryList() { |
| | | LWhFormScrappedQry param = CommonUtil.getObjFromReq(LWhFormScrappedQry.class); |
| | | LWhFormScrappedQry query = new LWhFormScrappedQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | List<FromTransferTemplateInfoVO> list = Lists.newArrayList(); |
| | | // 查询型号数量 |
| | | String sql = |
| | | "SELECT fsg.id,fsg.BASE_GOODS_TEMPLATE_ID goodsTemplatesId,fsg.GOODS_TEMPLATE_NAME goodsName,sum(counts) count FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID " |
| | | + "where fsg.FORM_SCRAPPED_ID =:id group by fsg.BASE_GOODS_TEMPLATE_ID"; |
| | | "SELECT fsg.id,fsg.BASE_GOODS_TEMPLATE_ID goodsTemplatesId,fsg.GOODS_TEMPLATE_NAME goodsName,sum(counts) count FROM l_wh_form_scrapped fs left join l_wh_form_scrapped_goods fsg on fs.id = fsg.FORM_SCRAPPED_ID " |
| | | + "where fsg.FORM_SCRAPPED_ID =:id group by fsg.BASE_GOODS_TEMPLATE_ID"; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", item.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhFormScrappedService.select(sql, paramMap, new MapperUtil()); |
| | |
| | | */ |
| | | @ApiOperation(value = "根据id查询详情", notes = "根据id查询详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "报废单id", dataType = "Long", paramType = "query") |
| | | @ApiImplicitParam(name = "id", value = "报废单id", dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/detail") |
| | | public ResponseValue getById(Long id) { |
| | |
| | | /** |
| | | * 报废明细 |
| | | * |
| | | * @param param |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "报废明细", notes = "报废明细") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "param", value = "查询条件", dataType = "LWhFormScrappedQry", paramType = "query") |
| | | @ApiImplicitParam(name = "param", value = "查询条件", dataType = "LWhFormScrappedQry", paramType = "query") |
| | | }) |
| | | @GetMapping("/list/detailList") |
| | | public ResponseValue queryDetailList(LWhFormScrappedQry param) { |
| | | public ResponseValue queryDetailList( ) { |
| | | LWhFormScrappedQry param = CommonUtil.getObjFromReq(LWhFormScrappedQry.class); |
| | | LWhFormScrappedQry query = new LWhFormScrappedQry(); |
| | | CommonUtil.copyProperties(param, query); |
| | | param = query; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |